mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 15:31:39 +00:00
ef3c9f708d
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1472 af15c1b1-3010-417e-b628-4374ebc0bcbd
38 lines
1.1 KiB
Awk
38 lines
1.1 KiB
Awk
# get uppercased module name
|
|
/^[ \t]*LIBRARY/ { ModuleName = toupper( $2 ); next }
|
|
|
|
# skip uninteresting lines
|
|
/^[ \t]*(EXPORTS|;)/ { next }
|
|
|
|
# NB: Calling conventions essentially do not exist on non-x86 platforms,
|
|
# we simply strip the decoration unless 'cpu' equals 386.
|
|
|
|
# process fastcall symbols "@symbol@size"
|
|
/^[ \t]*@[A-Za-z0-9_]+@[0-9]+/ {
|
|
split( $1, parts, "@" ) # split the import name on the at signs
|
|
if( cpu == "386" )
|
|
printf( "++'%s'.'%s'..'%s'\n", $1, ModuleName, parts[2] )
|
|
else
|
|
printf( "++'%s'.'%s'\n", parts[2], ModuleName )
|
|
next
|
|
}
|
|
|
|
# process stdcall symbols using "symbol@size" format
|
|
/^[ \t]*[A-Za-z0-9_]+@[0-9]+/ {
|
|
split( $1, parts, "@" ) # split the import name on the at sign
|
|
if( cpu == "386" )
|
|
printf( "++'_%s'.'%s'..'%s'\n", $1, ModuleName, parts[1] )
|
|
else
|
|
printf( "++'%s'.'%s'\n", parts[1], ModuleName )
|
|
next
|
|
}
|
|
|
|
# process cdecl symbols using plain "symbol" format
|
|
/^[ \t]*[A-Za-z0-9_]+/ {
|
|
split( $1, parts, "@" ) # split the import name on the at sign
|
|
if( cpu == "386" )
|
|
printf( "++'_%s'.'%s'..'%s'\n", $1, ModuleName, $1 )
|
|
else
|
|
printf( "++'%s'.'%s'\n", parts[1], ModuleName )
|
|
next
|
|
}
|