sv_binutils: output header guard
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sun, 23 Jan 2022 10:33:27 +0000 (10:33 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Sun, 23 Jan 2022 11:01:02 +0000 (11:01 +0000)
src/openpower/sv/sv_binutils.py

index 0b733ca0ecea43f8a43f3288c2c352b2f104c31e..389e0e3cb247f18aebdb0bd8ab727d6802d65a2a 100644 (file)
@@ -246,6 +246,11 @@ class Codegen(_enum.Enum):
             yield "#include <stdint.h>"
             yield ""
 
+            yield "#ifdef __cplusplus"
+            yield "extern \"C\" {"
+            yield "#endif"
+            yield ""
+
             yield from Opcode.c_decl()
             yield ""
 
@@ -265,6 +270,11 @@ class Codegen(_enum.Enum):
             yield "extern const unsigned int svp64_num_entries;"
             yield ""
 
+            yield "#ifdef __cplusplus"
+            yield "}"
+            yield "#endif"
+            yield ""
+
             yield f"#endif /* {self.name} */"
             yield ""