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