diff options
Diffstat (limited to 'tutorial/chapter-8/lib/lib_global.h')
-rw-r--r-- | tutorial/chapter-8/lib/lib_global.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tutorial/chapter-8/lib/lib_global.h b/tutorial/chapter-8/lib/lib_global.h new file mode 100644 index 000000000..d830dd8ab --- /dev/null +++ b/tutorial/chapter-8/lib/lib_global.h @@ -0,0 +1,25 @@ +#ifndef LIB_GLOBAL_H +#define LIB_GLOBAL_H + +#if defined(_WIN32) || defined(WIN32) +#define MY_LIB_DECL_EXPORT __declspec(dllexport) +#define MY_LIB_DECL_IMPORT __declspec(dllimport) +#else +#define MY_LIB_DECL_EXPORT __attribute__((visibility("default"))) +#define MY_LIB_DECL_IMPORT __attribute__((visibility("default"))) +#endif + +// ![0] +// lib/lib_global.h +#if defined(MYLIB_STATIC_LIBRARY) +#define MYLIB_EXPORT +#else +#if defined(MYLIB_LIBRARY) +#define MYLIB_EXPORT MY_LIB_DECL_EXPORT +#else +#define MYLIB_EXPORT MY_LIB_DECL_IMPORT +#endif +#endif +// ![0] + +#endif // LIB_GLOBAL_H
\ No newline at end of file |