Audacity 3.2.0
ScripterCallback.h
Go to the documentation of this file.
1
2// The following ifdef block is the standard way of creating macros which make exporting
3// from a DLL simpler. All files within this DLL are compiled with the LIBSCRIPT_EXPORTS
4// symbol defined on the command line. this symbol should not be defined on any project
5// that uses this DLL. This way any other project whose source files include this file see
6// SCRIPT_PIPE_DLL_API functions as being imported from a DLL, whereas this DLL sees symbols
7// defined with this macro as being exported.
8
9
10/* Magic for dynamic library import and export. This is unfortunately
11 * compiler-specific because there isn't a standard way to do it. Currently it
12 * works with the Visual Studio compiler for windows, and for GCC 4+. Anything
13 * else gets all symbols made public, which gets messy */
14/* The Visual Studio implementation */
15#ifdef _MSC_VER
16 #define SCRIPT_PIPE_DLL_IMPORT _declspec(dllimport)
17 #ifdef BUILDING_SCRIPT_PIPE
18 #define SCRIPT_PIPE_DLL_API _declspec(dllexport)
19 #elif _DLL
20 #define SCRIPT_PIPE_DLL_API _declspec(dllimport)
21 #else
22 #define AUDACITY_DLL_API
23 #endif
24#endif //_MSC_VER
25
26/* The GCC implementation */
27#ifdef CC_HASVISIBILITY // this is provided by the configure script, is only
28// enabled for suitable GCC versions
29/* The incantation is a bit weird here because it uses ELF symbol stuff. If we
30 * make a symbol "default" it makes it visible (for import or export). Making it
31 * "hidden" means it is invisible outside the shared object. */
32 #define SCRIPT_PIPE_DLL_IMPORT __attribute__((visibility("default")))
33 #ifdef BUILDING_SCRIPT_PIPE
34 #define SCRIPT_PIPE_DLL_API __attribute__((visibility("default")))
35 #else
36 #define SCRIPT_PIPE_DLL_API __attribute__((visibility("default")))
37 #endif
38#endif
39