PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pldll.h
Go to the documentation of this file.
1 #ifndef __PL_DLL_H
2 #define __PL_DLL_H
3 
4 #ifdef USINGDLL
5  #if defined ( WIN32 )
6 // Visual C/C++, Borland, MinGW and Watcom
7  #if defined ( __VISUALC__ ) || defined ( _MSC_VER ) || defined ( __BORLANDC__ ) || defined ( __GNUC__ ) || defined ( __WATCOMC__ )
8  #define PLDLLEXPORT __declspec( dllexport )
9  #define PLDLLIMPORT __declspec( dllimport )
10  #else
11  #define PLDLLEXPORT
12  #define PLDLLIMPORT
13  #endif
14  #elif defined ( __CYGWIN__ )
15  #define PLDLLEXPORT __declspec( dllexport )
16  #define PLDLLIMPORT __declspec( dllimport )
17  #elif defined ( __GNUC__ ) && __GNUC__ > 3
18 // Follow ideas in http://gcc.gnu.org/wiki/Visibility for GCC version 4.x
19 // The following forces exported symbols specifically designated with
20 // PLDLLEXPORT to be visible.
21  #define PLDLLEXPORT __attribute__ ( ( visibility( "default" ) ) )
22  #define PLDLLIMPORT
23  #endif
24 #endif
25 
26 // For an unknown compiler or static built we clear the macros
27 #ifndef PLDLLEXPORT
28  #define PLDLLEXPORT
29  #define PLDLLIMPORT
30 #endif
31 
32 // The IMPEXP macros will always be set to DLLIMPORT (even for
33 // the static library, but DLLIMPORT is empty in this case), if
34 // cmake didn't set the corresponding macro xxxx_EXPORTS when the
35 // corresponding library is built (DLLIMPEXP is set to DLLEXPORT
36 // then)
37 #if defined ( plplot_EXPORTS )
38  #define PLDLLIMPEXP PLDLLEXPORT
39  #define PLDLLIMPEXP_DATA( type ) PLDLLEXPORT type
40 #else
41  #define PLDLLIMPEXP PLDLLIMPORT
42  #define PLDLLIMPEXP_DATA( type ) PLDLLIMPORT type
43 #endif
44 
45 // for dynamic drivers set the macros correctly. If a shared library is built,
46 // but dyanmic drivers disabled, the driver dll macros are the same as the
47 // plplot dll macros
48 #ifdef ENABLE_DYNDRIVERS
49  #if defined ( aqt_EXPORTS ) || defined ( cairo_EXPORTS ) || defined ( cgm_EXPORTS ) || \
50  defined ( dg300_EXPORTS ) || defined ( gd_EXPORTS ) || defined ( gcw_EXPORTS ) || \
51  defined ( hpgl_EXPORTS ) || defined ( impress_EXPORTS ) || defined ( linuxvga_EXPORTS ) || \
52  defined ( ljii_EXPORTS ) || defined ( ljiip_EXPORTS ) || defined ( mem_EXPORTS ) || \
53  defined ( ntk_EXPORTS ) || defined ( null_EXPORTS ) || defined ( pbm_EXPORTS ) || \
54  defined ( pdf_EXPORTS ) || defined ( plmeta_EXPORTS ) || defined ( ps_EXPORTS ) || \
55  defined ( pstex_EXPORTS ) || defined ( psttf_EXPORTS ) || defined ( svg_EXPORTS ) || \
56  defined ( tek_EXPORTS ) || defined ( tk_EXPORTS ) || defined ( tkwin_EXPORTS ) || \
57  defined ( wingcc_EXPORTS ) || defined ( wxwidgets_EXPORTS ) || defined ( xfig_EXPORTS ) || \
58  defined ( xwin_EXPORTS ) || defined ( qt_EXPORTS )
59  #define PLDLLIMPEXP_DRIVER PLDLLEXPORT
60  #define PLDLLIMPEXP_DRIVER_DATA( type ) PLDLLEXPORT type
61  #else
62  #define PLDLLIMPEXP_DRIVER PLDLLIMPORT
63  #define PLDLLIMPEXP_DRIVER_DATA( type ) PLDLLIMPORT type
64  #endif
65 #else
66  #define PLDLLIMPEXP_DRIVER PLDLLIMPEXP
67  #define PLDLLIMPEXP_DRIVER_DATA( type ) PLDLLIMPEXP_DATA( type )
68 #endif
69 
70 #if defined ( plplotcxx_EXPORTS )
71  #define PLDLLIMPEXP_CXX PLDLLEXPORT
72  #define PLDLLIMPEXP_CXX_DATA( type ) PLDLLEXPORT type
73 #else
74  #define PLDLLIMPEXP_CXX PLDLLIMPORT
75  #define PLDLLIMPEXP_CXX_DATA( type ) PLDLLIMPORT type
76 #endif
77 
78 #if defined ( plplotf95c_EXPORTS )
79  #define PLDLLIMPEXP_F95C PLDLLEXPORT
80  #define PLDLLIMPEXP_F95C_DATA( type ) PLDLLEXPORT type
81 #else
82  #define PLDLLIMPEXP_F95C PLDLLIMPORT
83  #define PLDLLIMPEXP_F95C_DATA( type ) PLDLLIMPORT type
84 #endif
85 
86 #if defined ( plplotwxwidgets_EXPORTS )
87  #define PLDLLIMPEXP_WX PLDLLEXPORT
88  #define PLDLLIMPEXP_WX_DATA( type ) PLDLLEXPORT type
89 #else
90  #define PLDLLIMPEXP_WX PLDLLIMPORT
91  #define PLDLLIMPEXP_WX_DATA( type ) PLDLLIMPORT type
92 #endif
93 
94 #if defined ( tclmatrix_EXPORTS )
95  #define PLDLLIMPEXP_TCLMAT PLDLLEXPORT
96  #define PLDLLIMPEXP_TCLMAT_DATA( type ) PLDLLEXPORT type
97 #else
98  #define PLDLLIMPEXP_TCLMAT PLDLLIMPORT
99  #define PLDLLIMPEXP_TCLMAT_DATA( type ) PLDLLIMPORT type
100 #endif
101 
102 #if defined ( plplottcltk_Main_EXPORTS ) | defined ( plplottcltk_EXPORTS )
103  #define PLDLLIMPEXP_TCLTK PLDLLEXPORT
104  #define PLDLLIMPEXP_TCLTK_DATA( type ) PLDLLEXPORT type
105 #else
106  #define PLDLLIMPEXP_TCLTK PLDLLIMPORT
107  #define PLDLLIMPEXP_TCLTK_DATA( type ) PLDLLIMPORT type
108 #endif
109 
110 #if defined ( plplotgnome2_EXPORTS )
111  #define PLDLLIMPEXP_GNOME2 PLDLLEXPORT
112  #define PLDLLIMPEXP_GNOME2_DATA( type ) PLDLLEXPORT type
113 #else
114  #define PLDLLIMPEXP_GNOME2 PLDLLIMPORT
115  #define PLDLLIMPEXP_GNOME2_DATA( type ) PLDLLIMPORT type
116 #endif
117 
118 #if defined ( cplplotcanvasmodule_EXPORTS )
119  #define PLDLLIMPEXP_CPLPLOTCANVASMODULE PLDLLEXPORT
120  #define PLDLLIMPEXP_CPLPLOTCANVASMODULE_DATA( type ) PLDLLEXPORT type
121 #else
122  #define PLDLLIMPEXP_CPLPLOTCANVASMODULE PLDLLIMPORT
123  #define PLDLLIMPEXP_CPLPLOTCANVASMODULE_DATA( type ) PLDLLIMPORT type
124 #endif
125 
126 #if defined ( plplot_widgetmodule_EXPORTS )
127  #define PLDLLIMPEXP_PLPLOT_WIDGETMODULE PLDLLEXPORT
128  #define PLDLLIMPEXP_PLPLOT_MODULE_DATA( type ) PLDLLEXPORT type
129 #else
130  #define PLDLLIMPEXP_PLPLOT_MODULE PLDLLIMPORT
131  #define PLDLLIMPEXP_PLPLOT_MODULE_DATA( type ) PLDLLIMPORT type
132 #endif
133 
134 // Note for the case when ENABLE_DYNDRIVERS is not defined, the
135 // libplplot build specifically includes bindings/qt-gui/plqt.cpp (see
136 // cmake/modules/qt.cmake).
137 #if defined ( plplotqt_EXPORTS ) || ( !defined ( ENABLE_DYNDRIVERS ) && defined ( plplot_EXPORTS ) )
138  #define PLDLLIMPEXP_QT PLDLLEXPORT
139  #define PLDLLIMPEXP_QT_DATA( type ) PLDLLEXPORT type
140 #else
141  #define PLDLLIMPEXP_QT PLDLLIMPORT
142  #define PLDLLIMPEXP_QT_DATA( type ) PLDLLIMPORT type
143 #endif
144 
145 #if defined ( plplot_pyqt4_EXPORTS )
146  #define PLDLLIMPEXP_PYQT4 PLDLLEXPORT
147  #define PLDLLIMPEXP_PYQT4_DATA( type ) PLDLLEXPORT type
148 #else
149  #define PLDLLIMPEXP_PYQT4 PLDLLIMPORT
150  #define PLDLLIMPEXP_PYQT4_DATA( type ) PLDLLIMPORT type
151 #endif
152 
153 #endif // __PL_DLL_H