config.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef TOOLKIT_CONFIG_H
  2. #define TOOLKIT_CONFIG_H
  3. #ifndef TOOLKIT_LINKED_AS_STATIC_LIBRARY
  4. #ifdef _WIN32
  5. #ifdef LIBTOOLKIT_EXPORTS
  6. #define TOOLKIT_API _declspec(dllexport)
  7. #else //LIBTOOLKIT_EXPORTS
  8. #define TOOLKIT_API _declspec(dllimport)
  9. #endif //LIBTOOLKIT_EXPORTS
  10. #elif defined(__GNUC__)
  11. #if __GNUC__ >= 4
  12. #define TOOLKIT_API __attribute__((visibility("default")))
  13. #else
  14. #define TOOLKIT_API
  15. #endif // __GUNC__ >= 4
  16. #else //_WIN32
  17. #define TOOLKIT_API
  18. #endif //_WIN32
  19. #else //TOOLKIT_LINKED_AS_STATIC_LIBRARY
  20. #define TOOLKIT_API
  21. #endif //TOOLKIT_LINKED_AS_STATIC_LIBRARY
  22. #ifdef _WIN32
  23. #define TOOLKIT_CC __cdecl
  24. #else
  25. #define TOOLKIT_CC
  26. #endif
  27. #ifndef _WIN32
  28. #ifndef MAX_PATH
  29. #define MAX_PATH 260
  30. #endif
  31. #endif
  32. //#define NO_FIXED_ADDR
  33. //#define DEBUD_MEM_TRACE
  34. #ifdef DEBUD_MEM_TRACE
  35. #define MEM_TRACE_LOCATION __FILE__, __FUNCTION__, __LINE__
  36. #endif // DEBUD_MEM_TRACE
  37. //for linux compatibility. linux is unable to recognize __int64
  38. #ifdef _WIN32
  39. #ifndef u__int64_t
  40. #define u__int64_t unsigned __int64
  41. #endif //u__int64_t
  42. #endif
  43. #include <winpr/wtypes.h>
  44. #ifndef TOOLKIT_TAG
  45. #include <winpr/wlog.h>
  46. #define RVC_TAG(tag) "rvc." tag
  47. #define TOOLKIT_TAG(tag) RVC_TAG("libtoolkit.") tag
  48. #endif //TOOLKIT_TAG
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52. #ifndef __cplusplus
  53. #ifndef max
  54. #define max(a,b) (((a) > (b)) ? (a) : (b))
  55. #endif
  56. #ifndef min
  57. #define min(a,b) (((a) < (b)) ? (a) : (b))
  58. #endif
  59. #endif /* __cplusplus */
  60. #ifdef __cplusplus
  61. } // extern "C" {
  62. #endif
  63. #endif // TOOLKIT_CONFIG_H