Atomic.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. # define ATOMIC_API
  39. # define ATOMIC_NO_EXPORT
  40. #else
  41. # ifndef ATOMIC_API
  42. # ifdef ATOMIC_EXPORTS
  43. /* We are building this library */
  44. # define ATOMIC_API __attribute__((visibility("default")))
  45. # else
  46. /* We are using this library */
  47. # define ATOMIC_API __attribute__((visibility("default")))
  48. # endif
  49. # endif
  50. # ifndef ATOMIC_NO_EXPORT
  51. # define ATOMIC_NO_EXPORT __attribute__((visibility("hidden")))
  52. # endif
  53. #endif
  54. #ifndef ATOMIC_DEPRECATED
  55. # define ATOMIC_DEPRECATED __attribute__ ((__deprecated__))
  56. #endif
  57. #ifndef ATOMIC_DEPRECATED_EXPORT
  58. # define ATOMIC_DEPRECATED_EXPORT ATOMIC_API ATOMIC_DEPRECATED
  59. #endif
  60. #ifndef ATOMIC_DEPRECATED_NO_EXPORT
  61. # define ATOMIC_DEPRECATED_NO_EXPORT ATOMIC_NO_EXPORT ATOMIC_DEPRECATED
  62. #endif
  63. #define DEFINE_NO_DEPRECATED 0
  64. #if DEFINE_NO_DEPRECATED
  65. # define ATOMIC_NO_DEPRECATED
  66. #endif
  67. #endif
  68. #endif