Document macro naming style and struct naming style in C-compatible code, where C++ namespaces can't be used to avoid name collisions. No bug, r=luke over IRC, DONTBUILD because this is modifying docs but touching no code

This commit is contained in:
Jeff Walden 2012-03-28 15:42:40 -07:00
parent bfb97277f6
commit a8a3846d0b

View File

@ -192,6 +192,12 @@ indented.
Don't use |using| in a header unless it's confined to a class or method.
Implementation files for out-of-line functionality may use |using|.
Name data structures and methods which must be usable in C code with a Moz*
prefix, e.g. MozCustomStructure. If the data structure is not meant to be used
outside of the header in which it is found (i.e. it would be in mozilla::detail
but for its being required to work in C code), add a corresponding comment to
highlight this.
== #includes ==
Headers that include mfbt headers use a fully-qualified include path, even if
@ -267,6 +273,11 @@ But don't distinguish clang's feature support using version checks: use the
__has_feature() and __has_extension() macros instead, because vendors may
customize clang's version numbers.
Use a MOZ_* prefix when defining macros (e.g. MOZ_OVERRIDE, MOZ_LIKELY, and so
on) that are part of the mfbt interface. (C++ implementation files implementing
mfbt's interface but which are not directly part of that interface may ignore
this rule.)
Prefer inline functions to macros whenever possible.
== Comments ==