Nitlanguage.org
  • Nitdoc
  • nitc
  • compiler
  • separate_compiler
  • SeparateCompiler
  • compile_header_attribute_structs

fun compile_header_attribute_structs

nitc :: SeparateCompiler :: compile_header_attribute_structs

  • Doc
  • Linearization

Summary

  • Property definitions

  • nitc$SeparateCompiler$compile_header_attribute_structs

Property definitions

nitc $ SeparateCompiler :: compile_header_attribute_structs
	fun compile_header_attribute_structs
	do
		if modelbuilder.toolcontext.opt_no_union_attribute.value then
			self.header.add_decl("typedef void* nitattribute_t; /* general C type representing a Nit attribute. */")
		else
			self.header.add_decl("typedef union \{")
			self.header.add_decl("void* val;")
			for c, v in self.box_kinds do
				var t = c.mclass_type

				# `Pointer` reuse the `val` field
				if t.mclass.name == "Pointer" then continue

				self.header.add_decl("{t.ctype_extern} {t.ctypename};")
			end
			self.header.add_decl("\} nitattribute_t; /* general C type representing a Nit attribute. */")
		end
	end
src/compiler/separate_compiler.nit:242,2--259,4
Nit tools. Version .