blosc-export.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*********************************************************************
  2. Blosc - Blocked Shuffling and Compression Library
  3. Author: Francesc Alted <francesc@blosc.org>
  4. See LICENSES/BLOSC.txt for details about copyright and rights to use.
  5. **********************************************************************/
  6. #ifndef BLOSC_EXPORT_H
  7. #define BLOSC_EXPORT_H
  8. /* Macros for specifying exported symbols.
  9. BLOSC_EXPORT is used to decorate symbols that should be
  10. exported by the blosc shared library.
  11. BLOSC_NO_EXPORT is used to decorate symbols that should NOT
  12. be exported by the blosc shared library.
  13. */
  14. #if defined(BLOSC_SHARED_LIBRARY)
  15. #if defined(_MSC_VER)
  16. #define BLOSC_EXPORT __declspec(dllexport)
  17. #elif (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)
  18. #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
  19. #define BLOSC_EXPORT __attribute__((dllexport))
  20. #else
  21. #define BLOSC_EXPORT __attribute__((visibility("default")))
  22. #endif /* defined(_WIN32) || defined(__CYGWIN__) */
  23. #else
  24. #error Cannot determine how to define BLOSC_EXPORT for this compiler.
  25. #endif
  26. #else
  27. #define BLOSC_EXPORT
  28. #endif /* defined(BLOSC_SHARED_LIBRARY) */
  29. #if defined(__GNUC__) || defined(__clang__)
  30. #define BLOSC_NO_EXPORT __attribute__((visibility("hidden")))
  31. #else
  32. #define BLOSC_NO_EXPORT
  33. #endif /* defined(__GNUC__) || defined(__clang__) */
  34. /* When testing, export everything to make it easier to implement tests. */
  35. #if defined(BLOSC_TESTING)
  36. #undef BLOSC_NO_EXPORT
  37. #define BLOSC_NO_EXPORT BLOSC_EXPORT
  38. #endif /* defined(BLOSC_TESTING) */
  39. #endif /* BLOSC_EXPORT_H */