Confirmed users
1,345
edits
Nnethercote (talk | contribs) |
Nnethercote (talk | contribs) |
||
| Line 250: | Line 250: | ||
== #include ordering == | == #include ordering == | ||
The following order is used for | The following order is used for module X: | ||
* If X-inl.h exists, it goes first. (And X-inl.h's first #include should be X.h.) Otherwise, X.h goes first. This rule ensures that X.h and X-inl.h both #include all the headers that they need themselves. | |||
* mozilla/*.h | |||
* <*.h> | |||
* js*.h | |||
* */*.h (this includes the public JSAPI headers in js/public/*.h which should be included using the form js/*.h) | |||
* js*inlines.h | |||
* */*-inl.h. | |||
Example for | Example for X.cpp: | ||
#include " | #include "X.h" // put "X-inl.h" instead, if it exists | ||
#include "mozilla/StdInt.h" | #include "mozilla/StdInt.h" | ||
| Line 273: | Line 280: | ||
#include "vm/VirtualReality-inl.h" | #include "vm/VirtualReality-inl.h" | ||
If possible, keep lexicographic order with each section. | |||
= C++ = | = C++ = | ||