include/berkelium/Platform.hpp
Go to the documentation of this file.00001 #ifndef _BERKELIUM_PLATFORM_HPP_
00002 #define _BERKELIUM_PLATFORM_HPP_
00003
00004
00005 #define PLATFORM_WINDOWS 0
00006 #define PLATFORM_LINUX 1
00007 #define PLATFORM_MAC 2
00008
00009
00010 #if defined(__WIN32__) || defined(_WIN32)
00011
00012 #pragma warning (disable: 4251)
00013
00014 #pragma warning (disable: 4661)
00015
00016 #pragma warning (disable : 4275)
00017 # define BERKELIUM_PLATFORM PLATFORM_WINDOWS
00018 #elif defined(__APPLE_CC__) || defined(__APPLE__)
00019 # define BERKELIUM_PLATFORM PLATFORM_MAC
00020 # ifndef __MACOSX__
00021 # define __MACOSX__
00022 # endif
00023 #else
00024 # define BERKELIUM_PLATFORM PLATFORM_LINUX
00025 #endif
00026
00027 #ifdef NDEBUG
00028 #define BERKELIUM_DEBUG 0
00029 #else
00030 #define BERKELIUM_DEBUG 1
00031 #endif
00032
00033 #ifndef BERKELIUM_EXPORT
00034 # if BERKELIUM_PLATFORM == PLATFORM_WINDOWS
00035 # if defined(STATIC_LINKED)
00036 # define BERKELIUM_EXPORT
00037 # else
00038 # if defined(BERKELIUM_BUILD)
00039 # define BERKELIUM_EXPORT __declspec(dllexport)
00040 # else
00041 # define BERKELIUM_EXPORT __declspec(dllimport)
00042 # endif
00043 # endif
00044 # define BERKELIUM_PLUGIN_EXPORT __declspec(dllexport)
00045 # else
00046 # if defined(__GNUC__) && __GNUC__ >= 4
00047 # define BERKELIUM_EXPORT __attribute__ ((visibility("default")))
00048 # define BERKELIUM_PLUGIN_EXPORT __attribute__ ((visibility("default")))
00049 # else
00050 # define BERKELIUM_EXPORT
00051 # define BERKELIUM_PLUGIN_EXPORT
00052 # endif
00053 # endif
00054 #endif
00055
00056
00057 #ifndef BERKELIUM_FUNCTION_EXPORT
00058 # if BERKELIUM_PLATFORM == PLATFORM_WINDOWS
00059 # if defined(STATIC_LINKED)
00060 # define BERKELIUM_FUNCTION_EXPORT
00061 # else
00062 # if defined(BERKELIUM_BUILD)
00063 # define BERKELIUM_FUNCTION_EXPORT __declspec(dllexport)
00064 # else
00065 # define BERKELIUM_FUNCTION_EXPORT __declspec(dllimport)
00066 # endif
00067 # endif
00068 # else
00069 # define BERKELIUM_FUNCTION_EXPORT
00070 # endif
00071 #endif
00072
00073 #endif
00074
00075 #define UNIMPLEMENTED() (fprintf(stderr,"UNIMPLEMENTED %s:%d\n",__FILE__,__LINE__))
00076
00077
00078 #include <cstddef>