81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
include.stringValue];
[_impl writeFormat: @"\n"
@"extern struct Library *%@;\n"
@"\n",
libBase];
functions = [_library elementsForName: @"function"];
for (OFXMLElement *function in functions) {
OFString *name =
[function attributeForName: @"name"].stringValue;
OFString *returnType =
[function attributeForName: @"return-type"].stringValue;
OFArray OF_GENERIC(OFXMLElement *) *arguments =
|
>
>
>
|
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
include.stringValue];
[_impl writeFormat: @"\n"
@"extern struct Library *%@;\n"
@"\n",
libBase];
[_impl writeString:
@"#pragma GCC diagnostic ignored \"-Warray-parameter\"\n\n"];
functions = [_library elementsForName: @"function"];
for (OFXMLElement *function in functions) {
OFString *name =
[function attributeForName: @"name"].stringValue;
OFString *returnType =
[function attributeForName: @"return-type"].stringValue;
OFArray OF_GENERIC(OFXMLElement *) *arguments =
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
if (argumentIndex++ > 0)
[_impl writeString: @", "];
[_impl writeString: argType];
if (![argType hasSuffix: @"*"])
[_impl writeString: @" "];
[_impl writeFormat: @"__asm__(\"%@\")",
m68kReg];
}
[_impl writeFormat: @"))(((uintptr_t)%@) - %zu))(",
libBase, 30 + funcIndex * 6];
argumentIndex = 0;
for (OFXMLElement *argument in
|
|
<
|
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
if (argumentIndex++ > 0)
[_impl writeString: @", "];
[_impl writeString: argType];
if (![argType hasSuffix: @"*"])
[_impl writeString: @" "];
[_impl writeFormat: @"__asm__(\"%@\")", m68kReg];
}
[_impl writeFormat: @"))(((uintptr_t)%@) - %zu))(",
libBase, 30 + funcIndex * 6];
argumentIndex = 0;
for (OFXMLElement *argument in
|