hplatform.h 645 B

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