1 //////////////////////////////////////////////////////////////////////////////// 2 // The Loki Library 3 // Copyright (c) 2006 by Peter K�mmel 4 // Permission to use, copy, modify, distribute and sell this software for any 5 // purpose is hereby granted without fee, provided that the above copyright 6 // notice appear in all copies and that both that copyright notice and this 7 // permission notice appear in supporting documentation. 8 // The author makes no representations about the 9 // suitability of this software for any purpose. It is provided "as is" 10 // without express or implied warranty. 11 //////////////////////////////////////////////////////////////////////////////// 12 #ifndef LOKI_LOKIEXPORT_INC_ 13 #define LOKI_LOKIEXPORT_INC_ 14 15 // $Id: LokiExport.h 748 2006-10-17 19:49:08Z syntheticpp $ 16 17 18 #ifdef __GNUC__ 19 20 #ifdef _HAVE_GCC_VISIBILITY 21 #define LOKI_EXPORT_SPEC __attribute__ ((visibility("default"))) 22 #define LOKI_IMPORT_SPEC 23 #else 24 #define LOKI_EXPORT_SPEC 25 #define LOKI_IMPORT_SPEC 26 #endif 27 28 #else 29 30 #ifdef _WIN32 31 #define LOKI_EXPORT_SPEC __declspec(dllexport) 32 #define LOKI_IMPORT_SPEC __declspec(dllimport) 33 #else 34 #define LOKI_EXPORT_SPEC 35 #define LOKI_IMPORT_SPEC 36 #endif 37 38 #endif 39 40 41 #if (defined(LOKI_MAKE_DLL) && defined(LOKI_DLL)) || \ 42 (defined(LOKI_MAKE_DLL) && defined(LOKI_STATIC)) || \ 43 (defined(LOKI_DLL) && defined(LOKI_STATIC)) 44 #error export macro error: you could not build AND use the library 45 #endif 46 47 #ifdef LOKI_MAKE_DLL 48 #define LOKI_EXPORT LOKI_EXPORT_SPEC 49 #endif 50 51 #ifdef LOKI_DLL 52 #define LOKI_EXPORT LOKI_IMPORT_SPEC 53 #endif 54 55 #ifdef LOKI_STATIC 56 #define LOKI_EXPORT 57 #endif 58 59 #if !defined(LOKI_EXPORT) && !defined(EXPLICIT_EXPORT) 60 #define LOKI_EXPORT 61 #endif 62 63 #ifndef LOKI_EXPORT 64 #error export macro error: LOKI_EXPORT was not defined, disable EXPLICIT_EXPORT or define a export specification 65 #endif 66 67 68 #endif // end file guardian 69 70