00001 #ifndef _libqthippo_H_ 00002 #define _libqthippo_H_ 00003 00004 // Matthew D. Langston <langston@SLAC.Stanford.EDU> 00005 // 00006 // Every header file in our library that wants to export symbols 00007 // (e.g. class definitions) from a DLL on Windows must include this 00008 // header. It works on all platforms, both Windows and Linux/Unix. 00009 // 00010 // The following ifdef block is the standard way of exporting symbols 00011 // (e.g. class definitions) from a DLL on Windows. The macro 00012 // MDL_QTHIPPOPLOT_EXPORTS is defined when source code is compiled to 00013 // create the DLL, which causes MDL_QTHIPPOPLOT_API to expand to 00014 // __declspec(dllexport) so that symbols decorated with 00015 // MDL_QTHIPPOPLOT_API are exported from the DLL. 00016 // 00017 // Clients of our DLL don't have to do anything special to use it, since 00018 // they won't define MDL_QTHIPPOPLOT_EXPORTS, which means 00019 // MDL_QTHIPPOPLOT_API will expand to __declspec(dllimport) so that 00020 // symbols decorated with MDL_QTHIPPOPLOT_API are imported from the DLL. 00021 00022 #if defined(_WIN32) && defined(_MSC_VER) && defined( MDL_QTHIPPOPLOT_EXPORTS ) 00023 #undef MDL_QTHIPPOPLOT_API 00024 #define MDL_QTHIPPOPLOT_API __declspec(dllexport) 00025 #elif defined(_WIN32) && defined(_MSC_VER) && defined( MDL_QTHIPPOPLOT_IMPORTS ) 00026 #undef MDL_QTHIPPOPLOT_API 00027 #define MDL_QTHIPPOPLOT_API __declspec(dllimport) 00028 #else 00029 // The gcc compiler (i.e. the Linux/Unix compiler) exports the Universe 00030 // of symbols from a shared library, meaning that we can't control the 00031 // API of our shared libraries. We therefore just define the Symbol 00032 // Export Macro to expand to nothing. 00033 // Or if on Windows but using a static library (neither IMPORTS nor EXPORTS) 00034 // then we don't need this goofy declspec stuff. 00035 #undef MDL_QTHIPPOPLOT_API 00036 #define MDL_QTHIPPOPLOT_API 00037 #endif 00038 00039 #endif // _libqthippo_H_