1 | #ifndef BENCHMARK_EXPORT_H |
2 | #define BENCHMARK_EXPORT_H |
3 | |
4 | #if defined(_WIN32) |
5 | #define EXPORT_ATTR __declspec(dllexport) |
6 | #define IMPORT_ATTR __declspec(dllimport) |
7 | #define NO_EXPORT_ATTR |
8 | #define DEPRECATED_ATTR __declspec(deprecated) |
9 | #else // _WIN32 |
10 | #define EXPORT_ATTR __attribute__((visibility("default"))) |
11 | #define IMPORT_ATTR __attribute__((visibility("default"))) |
12 | #define NO_EXPORT_ATTR __attribute__((visibility("hidden"))) |
13 | #define DEPRECATE_ATTR __attribute__((__deprecated__)) |
14 | #endif // _WIN32 |
15 | |
16 | #ifdef BENCHMARK_STATIC_DEFINE |
17 | #define BENCHMARK_EXPORT |
18 | #define BENCHMARK_NO_EXPORT |
19 | #else // BENCHMARK_STATIC_DEFINE |
20 | #ifndef BENCHMARK_EXPORT |
21 | #ifdef benchmark_EXPORTS |
22 | /* We are building this library */ |
23 | #define BENCHMARK_EXPORT EXPORT_ATTR |
24 | #else // benchmark_EXPORTS |
25 | /* We are using this library */ |
26 | #define BENCHMARK_EXPORT IMPORT_ATTR |
27 | #endif // benchmark_EXPORTS |
28 | #endif // !BENCHMARK_EXPORT |
29 | |
30 | #ifndef BENCHMARK_NO_EXPORT |
31 | #define BENCHMARK_NO_EXPORT NO_EXPORT_ATTR |
32 | #endif // !BENCHMARK_NO_EXPORT |
33 | #endif // BENCHMARK_STATIC_DEFINE |
34 | |
35 | #ifndef BENCHMARK_DEPRECATED |
36 | #define BENCHMARK_DEPRECATED DEPRECATE_ATTR |
37 | #endif // BENCHMARK_DEPRECATED |
38 | |
39 | #ifndef BENCHMARK_DEPRECATED_EXPORT |
40 | #define BENCHMARK_DEPRECATED_EXPORT BENCHMARK_EXPORT BENCHMARK_DEPRECATED |
41 | #endif // BENCHMARK_DEPRECATED_EXPORT |
42 | |
43 | #ifndef BENCHMARK_DEPRECATED_NO_EXPORT |
44 | #define BENCHMARK_DEPRECATED_NO_EXPORT BENCHMARK_NO_EXPORT BENCHMARK_DEPRECATED |
45 | #endif // BENCHMARK_DEPRECATED_EXPORT |
46 | |
47 | #endif /* BENCHMARK_EXPORT_H */ |
48 | |