JavaScript:SpiderMonkey:C++ Coding Style: Difference between revisions

Line 24: Line 24:
== Includes ==
== Includes ==


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.
The following order is used for includes:  the module's .h (this ensures it includes all the headers it needs itself), mozilla/*.h; <*.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:
Example for jsfoo.cpp:


  #include "jsfoo.h"
  #include "jsfoo.h"
 
  #include "mozilla/StdInt.h"
  #include "mozilla/StdInt.h"
 
  #include <string.h>
  #include <string.h>
   
   
Confirmed users
1,345

edits