Bug 1528071 - Add include guards to StaticAtoms.py r=heycam
authorDavid Major <dmajor@mozilla.com>
Wed, 06 Mar 2019 04:40:03 +0000
changeset 520472 0d659b1c6de3bc90ac8cb964717142f49f3f0d8e
parent 520471 bfa18558c4e7caf378e7e6c62534565422304414
child 520479 4ab143dde4dc3424cfedc74b3648fbf2e47fb7bf
child 520480 020e9abe510a885e1ce61db806fc5f65b0568014
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1528071
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528071 - Add include guards to StaticAtoms.py r=heycam This will make the headers more unified-build-friendly. Differential Revision: https://phabricator.services.mozilla.com/D22012
xpcom/ds/StaticAtoms.py
--- a/xpcom/ds/StaticAtoms.py
+++ b/xpcom/ds/StaticAtoms.py
@@ -2506,18 +2506,21 @@ def generate_nsgkatomconsts_h(output, *i
             if pseudo_index is None:
                 pseudo_index = i
             pseudo_count += 1
         elif atom.atom_type is "NonInheritingAnonBoxAtom" or atom.atom_type is "InheritingAnonBoxAtom":
             if anon_box_index is None:
                 anon_box_index = i
             anon_box_count += 1
     output.write("/* THIS IS AN AUTOGENERATED FILE.  DO NOT EDIT */\n\n"
+                 "#ifndef nsGkAtomConsts_h\n"
+                 "#define nsGkAtomConsts_h\n\n"
                  "namespace mozilla {\n"
                  "  constexpr uint32_t kAtomIndex_PseudoElements = %d;\n"
                  "  constexpr uint32_t kAtomCount_PseudoElements = %d;\n"
                  "  constexpr uint32_t kAtomIndex_AnonBoxes = %d;\n"
                  "  constexpr uint32_t kAtomCount_AnonBoxes = %d;\n"
-                 "}\n" % (pseudo_index, pseudo_count, anon_box_index, anon_box_count))
+                 "}\n\n"
+                 "#endif\n" % (pseudo_index, pseudo_count, anon_box_index, anon_box_count))
 
 
 if __name__ == '__main__':
     generate_nsgkatomlist_h(sys.stdout)