Confirmed users
1,345
edits
No edit summary |
Nnethercote (talk | contribs) |
||
| Line 24: | Line 24: | ||
== Includes == | == Includes == | ||
The following order is used for includes: mozilla/*.h; js*.h; */*.h; js*inlines.h and js*-inl.h; */*-inl.h. The public JSAPI headers in js/public/*.h should be included as js/*.h in the */*.h block. | The following order is used for includes: the module's .h (this ensures it includes all the headers it needs itself), mozilla/*.h; standard .h, js*.h; */*.h; js*inlines.h and js*-inl.h; */*-inl.h. The public JSAPI headers in js/public/*.h should be included as js/*.h in the */*.h block. | ||
Example for jsfoo.cpp: | |||
#include "jsfoo.h" | |||
#include "mozilla/StdInt.h" | #include "mozilla/StdInt.h" | ||
#include <string.h> | |||
#include "jsbar.h" | #include "jsbar.h" | ||
#include " | #include "jsbaz.h" | ||
#include "ds/Baz.h" | #include "ds/Baz.h" | ||