Platform.pas 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. (* _ _
  2. * | |__ _ __ ___ ___ | | __
  3. * | '_ \| '__/ _ \ / _ \| |/ /
  4. * | |_) | | | (_) | (_) | <
  5. * |_.__/|_| \___/ \___/|_|\_\
  6. *
  7. * Microframework which helps to develop web Pascal applications.
  8. *
  9. * Copyright (c) 2012-2019 Silvio Clecio <[email protected]>
  10. *
  11. * Brook framework is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU Lesser General Public
  13. * License as published by the Free Software Foundation; either
  14. * version 2.1 of the License, or (at your option) any later version.
  15. *
  16. * Brook framework is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * Lesser General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public
  22. * License along with Brook framework; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. *)
  25. { Platform symbols. }
  26. unit Platform;
  27. {$IFDEF FPC}
  28. {$MODE DELPHI}
  29. {$ENDIF}
  30. interface
  31. uses
  32. {$IF DEFINED(MSWINDOWS)}
  33. Windows
  34. {$ELSEIF DEFINED(FPC) AND DEFINED(UNIX)}
  35. BaseUnix
  36. {$ELSEIF DEFINED(POSIX)}
  37. Posix.Errno
  38. {$ENDIF};
  39. const
  40. {$IF DEFINED(FPC) AND DEFINED(UNIX)}
  41. EINVAL = ESysEINVAL;
  42. ENOENT = ESysENOENT;
  43. EALREADY = ESysEALREADY;
  44. {$ELSEIF DEFINED(POSIX)}
  45. EINVAL = Posix.Errno.EINVAL;
  46. ENOENT = Posix.Errno.ENOENT;
  47. EALREADY = Posix.Errno.EALREADY;
  48. {$ELSEIF DEFINED(MSWINDOWS)}
  49. EINVAL = 22;
  50. ENOENT = ERROR_FILE_NOT_FOUND;
  51. EALREADY = ERROR_TOO_MANY_SEM_REQUESTS;
  52. {$ENDIF}
  53. implementation
  54. end.