From: Lisandro Dalcin Date: Fri, 20 Aug 2010 15:53:48 +0000 (-0300) Subject: fix support for packed structs with SunPro compiler X-Git-Tag: 0.13~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb13f3b7684719cb3ed353c04b321929fbe9dbb4;p=cython.git fix support for packed structs with SunPro compiler --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index f143a62e..9eb18e77 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -748,8 +748,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): self.sue_header_footer(type, kind, type.cname) code.putln("") if packed: - code.putln("#if !defined(__GNUC__)") - code.putln("#pragma pack(push, 1)") + code.putln("#if defined(__SUNPRO_C)") + code.putln(" #pragma pack(1)") + code.putln("#elif !defined(__GNUC__)") + code.putln(" #pragma pack(push, 1)") code.putln("#endif") code.putln(header) var_entries = scope.var_entries @@ -763,8 +765,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): attr.type.declaration_code(attr.cname)) code.putln(footer) if packed: - code.putln("#if !defined(__GNUC__)") - code.putln("#pragma pack(pop)") + code.putln("#if defined(__SUNPRO_C)") + code.putln(" #pragma pack()") + code.putln("#elif !defined(__GNUC__)") + code.putln(" #pragma pack(pop)") code.putln("#endif") def generate_enum_definition(self, entry, code):