Exemple #1
0
 def Define(self):
     s = "#ifdef %s\n" % self.name
     if self.submacros:
         s += self.DefineSubmacros()
     else:
         self.members = util.listifyElements(self.members)
         s += self.XMacroEntries()
     s += "#undef %s\n" % self.name
     s += "#endif\n"
     return s
 def Define(self):
     s = "#ifdef %s\n" % self.name
     if self.submacros:
         s += self.DefineSubmacros()
     else:
         self.members = util.listifyElements(self.members)
         s += self.XMacroEntries()
     s += "#undef %s\n" % self.name
     s += "#endif\n"
     return s
Exemple #3
0
    def DefineSubmacros(self):

        s = ""
        members = util.listifyElements(self.members)

        for entry in members:
            s += "#ifndef %s\n#define %s %s\n#endif\n\n" % (entry[0], entry[0],
                                                            self.name)
        for entry in members:
            subgen = CXMacroGenerator(name=entry[0], initargs=entry[1])
            s += subgen.XMacroEntries()

        s += "\n"
        for entry in members:
            s += "#undef %s\n" % entry[0]

        return s
    def DefineSubmacros(self):

        s = ""
        members = util.listifyElements(self.members)

        for entry in members:
            s += "#ifndef %s\n#define %s %s\n#endif\n\n" % (entry[0], 
                                                            entry[0], 
                                                            self.name)
        for entry in members:
            subgen = CXMacroGenerator(name=entry[0], initargs=entry[1])
            s += subgen.XMacroEntries()
        
        s += "\n"
        for entry in members:
            s += "#undef %s\n" % entry[0]

        return s