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

Jump to navigation Jump to search
No edit summary
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"


Example:
  #include "mozilla/StdInt.h"
  #include "mozilla/StdInt.h"
#include <string.h>
   
   
  #include "jsbar.h"
  #include "jsbar.h"
  #include "jsfoo.h"
  #include "jsbaz.h"
   
   
  #include "ds/Baz.h"
  #include "ds/Baz.h"
Confirmed users
1,345

edits

Navigation menu