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