1
0

hplatform.h 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef HW_PLATFORM_H_
  2. #define HW_PLATFORM_H_
  3. #ifdef _WIN32
  4. #define WIN32_LEAN_AND_MEAN
  5. #define _CRT_SECURE_NO_WARNINGS
  6. #define _CRT_NONSTDC_NO_DEPRECATE
  7. #include <winsock2.h>
  8. #include <windows.h>
  9. #include <direct.h> // for mkdir,rmdir,chdir,getcwd
  10. #define strcasecmp stricmp
  11. #define strncasecmp strnicmp
  12. #else
  13. #include <unistd.h> // for daemon
  14. #include <dirent.h> // for mkdir,rmdir,chdir,getcwd
  15. #include <sys/time.h> // for gettimeofday
  16. #include <pthread.h>
  17. #include <strings.h>
  18. #define stricmp strcasecmp
  19. #define strnicmp strncasecmp
  20. #endif
  21. #ifdef _MSC_VER
  22. typedef int pid_t;
  23. typedef int gid_t;
  24. typedef int uid_t;
  25. #endif
  26. #ifdef __GNUC__
  27. #define GNUC_ALIGN(n) __attribute__((aligned(n)))
  28. #else
  29. #define GNUC_ALIGN(n)
  30. #endif
  31. #include <sys/types.h>
  32. #include <sys/stat.h>
  33. #include <signal.h>
  34. #ifdef __unix__
  35. #define MKDIR(dir) mkdir(dir, 0777)
  36. #else
  37. #define MKDIR(dir) mkdir(dir)
  38. #endif
  39. #endif // HW_PLATFORM_H_