123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- {$IFDEF FPC}
- {$MODE DELPHI}
- {$ENDIF}
- {$H+}
- {$IFDEF WIN32}
- {$IFNDEF MSWINDOWS}
- {$DEFINE MSWINDOWS}
- {$ENDIF}
- {$ENDIF}
- unit synafpc;
- interface
- uses
- {$IFDEF FPC}
- dynlibs, sysutils;
- {$ELSE}
- {$IFDEF MSWINDOWS}
- Windows;
- {$ELSE}
- SysUtils;
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC}
- type
- TLibHandle = dynlibs.TLibHandle;
-
- function LoadLibrary(ModuleName: PChar): TLibHandle;
- function FreeLibrary(Module: TLibHandle): LongBool;
- function GetProcAddress(Module: TLibHandle; Proc: PChar): Pointer;
- function GetModuleFileName(Module: TLibHandle; Buffer: PChar; BufLen: Integer): Integer;
- {$ELSE}
- type
- {$IFDEF CIL}
- TLibHandle = Integer;
- PtrInt = Integer;
- {$ELSE}
- TLibHandle = HModule;
- {$IFNDEF WIN64}
- PtrInt = Integer;
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VER100}
- LongWord = DWord;
- {$ENDIF}
- {$ENDIF}
- procedure Sleep(milliseconds: Cardinal);
- implementation
- {$IFDEF FPC}
- function LoadLibrary(ModuleName: PChar): TLibHandle;
- begin
- Result := dynlibs.LoadLibrary(Modulename);
- end;
- function FreeLibrary(Module: TLibHandle): LongBool;
- begin
- Result := dynlibs.UnloadLibrary(Module);
- end;
- function GetProcAddress(Module: TLibHandle; Proc: PChar): Pointer;
- begin
- Result := dynlibs.GetProcedureAddress(Module, Proc);
- end;
- function GetModuleFileName(Module: TLibHandle; Buffer: PChar; BufLen: Integer): Integer;
- begin
- Result := 0;
- end;
- {$ELSE}
- {$ENDIF}
- procedure Sleep(milliseconds: Cardinal);
- begin
- {$IFDEF MSWINDOWS}
- {$IFDEF FPC}
- sysutils.sleep(milliseconds);
- {$ELSE}
- windows.sleep(milliseconds);
- {$ENDIF}
- {$ELSE}
- sysutils.sleep(milliseconds);
- {$ENDIF}
- end;
- end.
|