/
gendef.pl
28 lines (25 loc) · 658 Bytes
1
2
3
4
#!/usr/bin/perl
#
# Program to take a set of header files and generate DLL export definitions
5
6
7
# Special exports to ignore for this platform
$exclude{"SDL_putenv"} = 1;
$exclude{"SDL_getenv"} = 1;
8
9
10
11
12
13
14
15
while ( ($file = shift(@ARGV)) ) {
if ( ! defined(open(FILE, $file)) ) {
warn "Couldn't open $file: $!\n";
next;
}
$file =~ s,.*/,,;
while (<FILE>) {
16
if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
17
18
19
if ( not $exclude{$1} ) {
print "\t_$1\n";
}
20
21
22
23
}
}
close(FILE);
}
24
25
# Special exports to include for this platform
26
print "\tSDL_iconv_string\n";
27
28
print "\t.objc_class_name_SDL_QuartzWindow\n";
print "\t.objc_class_name_SDL_QuartzWindowDelegate\n";