sysinitpas.pp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2006 by Florian Klaempfl and Pavel Ozerski
  4. member of the Free Pascal development team.
  5. Win32 pascal only startup code
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit SysInitPas;
  13. interface
  14. implementation
  15. procedure asm_exit;stdcall;public name 'asm_exit';
  16. begin
  17. end;
  18. {$i sysinit.inc}
  19. procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
  20. begin
  21. IsConsole:=true;
  22. { do it like it is necessary for the startup code linking against cygwin }
  23. GetConsoleMode(GetStdHandle((Std_Input_Handle)),StartupConsoleMode);
  24. {$ifdef FPC_USE_TLS_DIRECTORY}
  25. LinkIn(@tlsdir,@tls_callback_end,@tls_callback);
  26. {$endif}
  27. SetupEntryInformation;
  28. Exe_entry(SysInitEntryInformation);
  29. end;
  30. procedure _FPC_WinMainCRTStartup;stdcall;public name '_WinMainCRTStartup';
  31. begin
  32. IsConsole:=false;
  33. {$ifdef FPC_USE_TLS_DIRECTORY}
  34. LinkIn(@tlsdir,@tls_callback_end,@tls_callback);
  35. {$endif}
  36. SetupEntryInformation;
  37. Exe_entry(SysInitEntryInformation);
  38. end;
  39. procedure _FPC_DLLMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLMainCRTStartup';
  40. begin
  41. IsConsole:=true;
  42. sysinstance:=_hinstance;
  43. dllreason:=_dllreason;
  44. dllparam:=PtrInt(_dllparam);
  45. SetupEntryInformation;
  46. DLL_Entry(SysInitEntryInformation);
  47. end;
  48. procedure _FPC_DLLWinMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLWinMainCRTStartup';
  49. begin
  50. IsConsole:=false;
  51. sysinstance:=_hinstance;
  52. dllreason:=_dllreason;
  53. dllparam:=PtrInt(_dllparam);
  54. SetupEntryInformation;
  55. DLL_Entry(SysInitEntryInformation);
  56. end;
  57. end.