Atomic.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef ATOMIC_API_H
  2. #define ATOMIC_API_H
  3. #ifdef _MSC_VER
  4. #pragma warning(disable: 4251)
  5. #pragma warning(disable: 4275)
  6. #ifdef ATOMIC_STATIC_DEFINE
  7. # define ATOMIC_API
  8. # define ATOMIC_NO_EXPORT
  9. #else
  10. # ifndef ATOMIC_API
  11. # ifdef ATOMIC_EXPORTS
  12. /* We are building this library */
  13. # define ATOMIC_API __declspec(dllexport)
  14. # else
  15. /* We are using this library */
  16. # define ATOMIC_API __declspec(dllimport)
  17. # endif
  18. # endif
  19. # ifndef ATOMIC_NO_EXPORT
  20. # define ATOMIC_NO_EXPORT
  21. # endif
  22. #endif
  23. #ifndef ATOMIC_DEPRECATED
  24. # define ATOMIC_DEPRECATED __declspec(deprecated)
  25. #endif
  26. #ifndef ATOMIC_DEPRECATED_EXPORT
  27. # define ATOMIC_DEPRECATED_EXPORT ATOMIC_API ATOMIC_DEPRECATED
  28. #endif
  29. #ifndef ATOMIC_DEPRECATED_NO_EXPORT
  30. # define ATOMIC_DEPRECATED_NO_EXPORT ATOMIC_NO_EXPORT ATOMIC_DEPRECATED
  31. #endif
  32. #define DEFINE_NO_DEPRECATED 0
  33. #if DEFINE_NO_DEPRECATED
  34. # define ATOMIC_NO_DEPRECATED
  35. #endif
  36. #else
  37. #ifdef ATOMIC_STATIC_DEFINE
  38. #ifndef ATOMIC_API
  39. # define ATOMIC_API
  40. #endif
  41. # define ATOMIC_NO_EXPORT
  42. #else
  43. # ifndef ATOMIC_API
  44. # ifdef ATOMIC_EXPORTS
  45. /* We are building this library */
  46. # define ATOMIC_API __attribute__((visibility("default")))
  47. # else
  48. /* We are using this library */
  49. # define ATOMIC_API __attribute__((visibility("default")))
  50. # endif
  51. # endif
  52. # ifndef ATOMIC_NO_EXPORT
  53. # define ATOMIC_NO_EXPORT __attribute__((visibility("hidden")))
  54. # endif
  55. #endif
  56. #ifndef ATOMIC_DEPRECATED
  57. # define ATOMIC_DEPRECATED __attribute__ ((__deprecated__))
  58. #endif
  59. #ifndef ATOMIC_DEPRECATED_EXPORT
  60. # define ATOMIC_DEPRECATED_EXPORT ATOMIC_API ATOMIC_DEPRECATED
  61. #endif
  62. #ifndef ATOMIC_DEPRECATED_NO_EXPORT
  63. # define ATOMIC_DEPRECATED_NO_EXPORT ATOMIC_NO_EXPORT ATOMIC_DEPRECATED
  64. #endif
  65. #define DEFINE_NO_DEPRECATED 0
  66. #if DEFINE_NO_DEPRECATED
  67. # define ATOMIC_NO_DEPRECATED
  68. #endif
  69. #endif
  70. #endif