Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tweak to SpiderMonkey's #include rules

17 views
Skip to first unread message

Nicholas Nethercote

unread,
Apr 24, 2013, 5:32:09 PM4/24/13
to JS Internals list
Hi all,

In https://bugzilla.mozilla.org/show_bug.cgi?id=634839#c27, Luke
(module owner) endorsed a slight change to the rules for #include
ordering in SpiderMonkey.

The new rule is that in a jsfoo.cpp file, the jsfoo.h header should be
the first header #included in the file. (Simliarly, in foo/Bar.cpp,
foo/Bar.h should be the first header.)

The rationale is that this ensures that the header itself includes all
the headers it depends on.

I would modify the SM style guide, but it's currently AWOL due to
https://bugzilla.mozilla.org/show_bug.cgi?id=861017 :(

Nick

Nicholas Nethercote

unread,
Apr 25, 2013, 9:11:55 PM4/25/13
to JS Internals list
On Wed, Apr 24, 2013 at 2:32 PM, Nicholas Nethercote
<n.neth...@gmail.com> wrote:
>
> I would modify the SM style guide, but it's currently AWOL due to
> https://bugzilla.mozilla.org/show_bug.cgi?id=861017 :(

That's now been fixed, and on Luke's request, I've combined the C and
C++ guidelines into a single page at
https://wiki.mozilla.org/JavaScript:SpiderMonkey:Coding_Style. I
updated the link from https://wiki.mozilla.org/JavaScript and the old
pages now redirect to the single page.

To combine them I just crudely appended the C++ guide to the end of
the C guide. I'll try to fix them up a bit, but I'm not sure how far
I'll get.

Nick
0 new messages