dllimpexp.h

Go to the documentation of this file.
00001 
00007 /*
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Lesser General Public
00010     License as published by the Free Software Foundation; either
00011     version 2.1 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public
00019     License along with this library; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00021 */
00022 
00023 #ifndef OMGUI_DLLIMPEXP_H
00024 #define OMGUI_DLLIMPEXP_H
00025 
00026 #ifdef OMGUI_WIN32
00027 #   define OMGUI_IMPORT __declspec(dllimport)
00028 #   define OMGUI_EXPORT __declspec(dllexport)
00029 #   define OMGUI_DLL_LOCAL
00030 #   define OMGUI_DLL_PUBLIC
00031 #else
00032 #   define OMGUI_IMPORT
00033 #   if __GNUC__ >= 4 // Using GCC which has C++ visibility support
00034 #       define OMGUI_EXPORT      __attribute__ ((visibility("default")))
00035 #       define OMGUI_DLL_LOCAL   __attribute__ ((visibility("hidden")))
00036 // A macro for default visibility without __declspec(dllexport) on win32.
00037 // Do we ever need this? Also, do we need a macro for __declspec(dllexport)
00038 // only, without default visibility? - class forward declarations?
00039 #       define OMGUI_DLL_PUBLIC  __attribute__ ((visibility("default")))
00040 #   else
00041 #       define OMGUI_EXPORT
00042 #       define OMGUI_DLL_LOCAL
00043 #       define OMGUI_DLL_PUBLIC
00044 #   endif
00045 #endif // !OMGUI_WIN32
00046 
00047 // For every non-templated class definition in the library (both header and
00048 // source files), decide if it is publicially use or internally used:
00049 // * If it's publicially used, mark with OMGUI_API like "class OMGUI_API PublicClass"
00050 // * If it's only internally used, optionally mark with OMGUI_DLL_LOCAL like
00051 //   "class OMGUI_DLL_LOCAL PrivateClass". It is probably better to not use
00052 //   OMGUI_DLL_LOCAL at all, and instead make sure every API interface is
00053 //   marked with OMGUI_API, and enforce the usage of -fvisibility=hidden in
00054 //   our Makefile's CXXFLAGS when the compiler is gcc4 or newer. Some more
00055 //   research required to make the final decision on that.
00056 #ifdef OMGUI_DLL
00057 #   ifdef OMGUI_BUILDING // Use the more standard OMGUI_EXPORTS instead?
00058 #       define OMGUI_API OMGUI_EXPORT
00059 #   else
00060 #       define OMGUI_API OMGUI_IMPORT
00061 #   endif
00062 #else
00063 #   define OMGUI_API
00064 #endif
00065 
00066 // Use OMGUI_EXCEPTION_API(OMGUI_API) for exceptions that can be thrown
00067 // across a shared object boundary, like this:
00068 // "class OMGUI_EXCEPTION_API(OMGUI_API) PublicThrowableClass"
00069 // No need to do this for types which are never thrown across the shared
00070 // object bounary. That is, don't use this if the application must not be
00071 // able to catch the exception.
00072 #ifdef OMGUI_WIN32
00073 #   define OMGUI_EXCEPTION_API(api) api
00074 #elif __GNUC__ >= 4 // Using GCC which has C++ visibility support
00075 #   define OMGUI_EXCEPTION_API(api) OMGUI_EXPORT
00076 #else
00077 #   define OMGUI_EXCEPTION_API(api)
00078 #endif
00079 
00080 #endif // OMGUI_DLLIMPEXP_H

doxygen SourceForge.net Logo