Example #1
0
 def forward_declaration(self):
     if llgroup.member_of_group(self.obj):
         return
     type, name = self.get_declaration()
     yield '%s;' % (
         forward_cdecl(type, name, self.db.standalone,
                       self.is_thread_local()))
Example #2
0
 def forward_declaration(self):
     if llgroup.member_of_group(self.obj):
         return
     type, name, is_union = self.get_declaration()
     yield '%s;' % (
         forward_cdecl(type, name, self.db.standalone,
                       is_thread_local=self.is_thread_local(),
                       is_exported=self.is_exported()))
Example #3
0
 def implementation(self):
     if llgroup.member_of_group(self.obj):
         return []
     lines = list(self.initializationexpr())
     type, name = self.get_declaration()
     if name != self.name:
         lines[0] = '{ ' + lines[0]    # extra braces around the 'a' part
         lines[-1] += ' }'             # of the union
     lines[0] = '%s = %s' % (
         cdecl(type, name, self.is_thread_local()),
         lines[0])
     lines[-1] += ';'
     return lines
Example #4
0
 def implementation(self):
     if llgroup.member_of_group(self.obj):
         return []
     lines = list(self.initializationexpr())
     type, name = self.get_declaration()
     if name != self.name and len(lines) < 2:
         # a union with length 0
         lines[0] = cdecl(type, name, self.is_thread_local())
     else:
         if name != self.name:
             lines[0] = "{ " + lines[0]  # extra braces around the 'a' part
             lines[-1] += " }"  # of the union
         lines[0] = "%s = %s" % (cdecl(type, name, self.is_thread_local()), lines[0])
     lines[-1] += ";"
     return lines
Example #5
0
 def implementation(self):
     if llgroup.member_of_group(self.obj):
         return []
     lines = list(self.initializationexpr())
     type, name, is_union = self.get_declaration()
     if is_union and len(lines) < 2:
         # a union with length 0
         lines[0] = cdecl(type, name, self.is_thread_local())
     else:
         if is_union:
             lines[0] = '{ ' + lines[0]  # extra braces around the 'a' part
             lines[-1] += ' }'  # of the union
         lines[0] = '%s = %s' % (cdecl(type, name,
                                       self.is_thread_local()), lines[0])
     lines[-1] += ';'
     return lines