libhippo.h
Go to the documentation of this file.
1 #ifndef _libhippo_H_
2 #define _libhippo_H_
3 
4 // Matthew D. Langston <langston@SLAC.Stanford.EDU>
5 //
6 // Every header file in our library that wants to export symbols
7 // (e.g. class definitions) from a DLL on Windows must include this
8 // header. It works on all platforms, both Windows and Linux/Unix.
9 //
10 // The following ifdef block is the standard way of exporting symbols
11 // (e.g. class definitions) from a DLL on Windows. The macro
12 // MDL_HIPPOPLOT_EXPORTS is defined when source code is compiled to
13 // create the DLL, which causes MDL_HIPPOPLOT_API to expand to
14 // __declspec(dllexport) so that symbols decorated with
15 // MDL_HIPPOPLOT_API are exported from the DLL.
16 //
17 // Clients of our DLL don't have to do anything special to use it, since
18 // they won't define MDL_HIPPOPLOT_EXPORTS, which means
19 // MDL_HIPPOPLOT_API will expand to __declspec(dllimport) so that
20 // symbols decorated with MDL_HIPPOPLOT_API are imported from the DLL.
21 
22 #if defined(_WIN32) && defined(_MSC_VER) && defined( MDL_HIPPOPLOT_EXPORTS )
23  #undef MDL_HIPPOPLOT_API
24  #define MDL_HIPPOPLOT_API __declspec(dllexport)
25 #elif defined(_WIN32) && defined(_MSC_VER) && defined( MDL_HIPPOPLOT_IMPORTS )
26  #undef MDL_HIPPOPLOT_API
27  #define MDL_HIPPOPLOT_API __declspec(dllimport)
28 #else
29  // The gcc compiler (i.e. the Linux/Unix compiler) exports the Universe
30  // of symbols from a shared library, meaning that we can't control the
31  // API of our shared libraries. We therefore just define the Symbol
32  // Export Macro to expand to nothing.
33  // Or if on Windows but using a static library (neither IMPORTS nor EXPORTS)
34  // then we don't need this goofy declspec stuff.
35  #undef MDL_HIPPOPLOT_API
36  #define MDL_HIPPOPLOT_API
37 #endif
38 
39 #endif // _libhippo_H_

Generated for HippoDraw Class Library by doxygen