hplatform.h 658 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef HW_PLATFORM_H_
  2. #define HW_PLATFORM_H_
  3. #ifdef _MSC_VER
  4. #ifndef WIN32_LEAN_AND_MEAN
  5. #define WIN32_LEAN_AND_MEAN
  6. #endif
  7. #include <winsock2.h>
  8. #include <windows.h>
  9. #undef WIN32_LEAN_AND_MEAN
  10. #define strcasecmp stricmp
  11. #define strncasecmp strnicmp
  12. #else
  13. #include <sys/types.h>
  14. #include <sys/time.h> // for gettimeofday
  15. #include <unistd.h>
  16. #include <pthread.h>
  17. #include <strings.h>
  18. #define stricmp strcasecmp
  19. #define strnicmp strncasecmp
  20. #endif
  21. #ifdef __GNUC__
  22. #define GNUC_ALIGN(n) __attribute__((aligned(n)))
  23. #else
  24. #define GNUC_ALIGN(n)
  25. #endif
  26. #endif // HW_PLATFORM_H_