mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
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:
parent
bfb97277f6
commit
a8a3846d0b
11
mfbt/STYLE
11
mfbt/STYLE
@ -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 ==
|
||||
|
Loading…
x
Reference in New Issue
Block a user