fhandle.h 576 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "defaults.h"
  3. using WIN_HANDLE = void*;
  4. #define INVALID_WIN_HANDLE ((WIN_HANDLE)(long)-1)
  5. using UNIX_HANDLE = int;
  6. #define INVALID_UNIX_HANDLE -1
  7. #if defined(_win_)
  8. using FHANDLE = WIN_HANDLE;
  9. #define INVALID_FHANDLE INVALID_WIN_HANDLE
  10. #elif defined(_unix_)
  11. using FHANDLE = UNIX_HANDLE;
  12. #define INVALID_FHANDLE INVALID_UNIX_HANDLE
  13. #else
  14. #error
  15. #endif
  16. #if defined(_cygwin_)
  17. using OS_HANDLE = WIN_HANDLE;
  18. #define INVALID_OS_HANDLE INVALID_WIN_HANDLE
  19. #else
  20. using OS_HANDLE = FHANDLE;
  21. #define INVALID_OS_HANDLE INVALID_FHANDLE
  22. #endif