Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.6 KiB

  1. setlocal ENABLEDELAYEDEXPANSION
  2. del %2\alias_*.obj %2\thunk_*.c %2\thunk_*.obj
  3. del %2\genstubs.log
  4. set LastDll=
  5. for /f "tokens=1,2,3,4 delims=," %%h in (%1) do (
  6. aliasobj __imp_%%k _%%i_%%j_Ptr %2\alias_%%i_%%j.obj
  7. aliasobj %%k _DirectCall_%%j@0 %2\alias_%%i_%%j_DirectCall.obj
  8. echo #define _DLLNAME_ %%i > %2\thunk_%%i_%%j.c
  9. echo #define _DLLEXT_ %%h >> %2\thunk_%%i_%%j.c
  10. echo #define _APINAME_ %%j >> %2\thunk_%%i_%%j.c
  11. call :GetArgType %%k
  12. if "!ApiArgs!" == "0" echo void !ApiCall! GodotFail%%j ^(void^); >>%2\thunk_%%i_%%j.c
  13. if "!ApiArgs!" == "1" echo void !ApiCall! GodotFail%%j ^(int^); >>%2\thunk_%%i_%%j.c
  14. if "!ApiArgs!" == "2" echo void !ApiCall! GodotFail%%j ^(int,int^); >>%2\thunk_%%i_%%j.c
  15. if "!ApiArgs!" == "3" echo void !ApiCall! GodotFail%%j ^(int,int,int^); >>%2\thunk_%%i_%%j.c
  16. if "!ApiArgs!" == "4" echo void !ApiCall! GodotFail%%j ^(int,int,int,int^); >>%2\thunk_%%i_%%j.c
  17. if "!ApiArgs!" == "5" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  18. if "!ApiArgs!" == "6" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  19. if "!ApiArgs!" == "7" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  20. if "!ApiArgs!" == "8" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  21. if "!ApiArgs!" == "9" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  22. if "!ApiArgs!" == "10" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  23. if "!ApiArgs!" == "11" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  24. if "!ApiArgs!" == "12" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  25. if "!ApiArgs!" == "13" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  26. if "!ApiArgs!" == "14" echo void !ApiCall! GodotFail%%j ^(int,int,int,int,int,int,int,int,int,int,int,int,int,int^); >>%2\thunk_%%i_%%j.c
  27. echo #include "thunk_stub.c" >> %2\thunk_%%i_%%j.c
  28. echo %2\thunk_%%i_%%j.c >> %2\cl_filenames.txt
  29. echo Processed %%i,%%j,%%k>>%2\genstubs.log.tmp
  30. )
  31. ren %2\genstubs.log.tmp genstubs.log
  32. goto :eof
  33. :GetArgType
  34. set ApiName=%1
  35. for %%i in (%ApiName:@= %) do set ApiArgs=%%i
  36. if "%ApiName%" == "%ApiArgs%" set ApiArgs=0
  37. set /a ApiArgs=%ApiArgs%/4
  38. if "%ApiName%" == "%ApiName:@=^%" goto _cdecl
  39. set ApiCall=__stdcall
  40. goto :eof
  41. :_cdecl
  42. set ApiCall=__cdecl
  43. goto :eof