src/main/win32/exports/gendef.pl
author Sam Lantinga <slouken@libsdl.org>
Thu, 11 Apr 2002 14:35:16 +0000
changeset 337 9154ec9ca3d2
parent 145 29a638dc26db
child 345 05b97424225f
permissions -rwxr-xr-x
Explicitly specify the SDL API calling convention (C by default)
slouken@0
     1
#!/usr/bin/perl
slouken@0
     2
#
slouken@0
     3
# Program to take a set of header files and generate DLL export definitions
slouken@0
     4
slouken@0
     5
while ( ($file = shift(@ARGV)) ) {
slouken@0
     6
	if ( ! defined(open(FILE, $file)) ) {
slouken@0
     7
		warn "Couldn't open $file: $!\n";
slouken@0
     8
		next;
slouken@0
     9
	}
slouken@0
    10
	$printed_header = 0;
slouken@0
    11
	$file =~ s,.*/,,;
slouken@0
    12
	while (<FILE>) {
slouken@337
    13
		if ( /DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
slouken@0
    14
			print "\t$1\n";
slouken@0
    15
		}
slouken@0
    16
	}
slouken@0
    17
	close(FILE);
slouken@0
    18
}
slouken@0
    19
# Special exports not in the header files
slouken@0
    20
print "\tSDL_RegisterApp\n";
slouken@145
    21
print "\tSDL_SetModuleHandle\n";