libfilezilla
visibility_helper.hpp
Go to the documentation of this file.
1 #ifndef LIBFILEZILLA_VISIBILITY_HELPER_HEADER
2 #define LIBFILEZILLA_VISIBILITY_HELPER_HEADER
3 
34 #ifdef DOXYGEN
36 #define FZ_EXPORT_PUBLIC
37 
39 #define FZ_EXPORT_PRIVATE
40 
42 #define FZ_IMPORT_SHARED
43 
45 #define FZ_IMPORT_STATIC
46 
47 #else
48 
49 #include "private/defs.hpp"
50 
51 // Two cases when building: Windows, other platform
52 #ifdef FZ_WINDOWS
53 
54  // Under Windows we can either use Visual Studio or a proper compiler
55  #ifdef _MSC_VER
56  #ifdef DLL_EXPORT
57  #define FZ_EXPORT_PUBLIC __declspec(dllexport)
58  #else
59  #define FZ_EXPORT_PUBLIC
60  #endif
61  #define FZ_EXPORT_PRIVATE
62  #else
63  #ifdef DLL_EXPORT
64  #define FZ_EXPORT_PUBLIC __declspec(dllexport)
65  #define FZ_EXPORT_PRIVATE
66  #else
67  #define FZ_EXPORT_PUBLIC __attribute__((visibility("default")))
68  #define FZ_EXPORT_PRIVATE __attribute__((visibility("hidden")))
69  #endif
70  #endif
71 
72 #else
73 
74  #define FZ_EXPORT_PUBLIC __attribute__((visibility("default")))
75  #define FZ_EXPORT_PRIVATE __attribute__((visibility("hidden")))
76 
77 #endif
78 
79 
80 // Under MSW it makes a difference whether we use a static library or a DLL
81 #if defined(FZ_WINDOWS)
82  #define FZ_IMPORT_SHARED __declspec(dllimport)
83 #else
84  #define FZ_IMPORT_SHARED
85 #endif
86 #define FZ_IMPORT_STATIC
87 
88 #endif
89 
90 #endif