Go to the documentation of this file.
42 #include "graphfab/core/SagittariusConfigure.h"
44 #ifndef __SAGITTARIUS_PLATFORM_H_
45 #define __SAGITTARIUS_PLATFORM_H_
50 #define SAGITTARIUS_PLATFORM_WIN 1
51 #define SAGITTARIUS_PLATFORM_APPLE 2
52 #define SAGITTARIUS_PLATFORM_LINUX 3
54 #define SAGITTARIUS_COMPILER_GNUC 1
55 #define SAGITTARIUS_COMPILER_MINGW 2
56 #define SAGITTARIUS_COMPILER_MSVC 3
57 #define SAGITTARIUS_COMPILER_BORL 4
59 #define SAGITTARIUS_LITTLE_ENDIAN 1
60 #define SAGITTARIUS_BIG_ENDIAN 2
62 #define SAGITTARIUS_ARCH_32 1
63 #define SAGITTARIUS_ARCH_64 2
66 #if defined ( __MINGW32__ )
68 # define SAGITTARIUS_COMPILER SAGITTARIUS_COMPILER_MINGW
70 #elif defined( __GNUC__ )
71 # define SAGITTARIUS_COMPILER SAGITTARIUS_COMPILER_GNUC
72 # if defined ( __GNUC_PATCHLEVEL__ )
73 # define SAGITTARIUS_COMPILER_VERSION ( ( __GNUC__ )*100 ) + ( ( __GNUC_MINOR__ )*10 ) + __GNUC_PATCHLEVEL__
75 # define SAGITTARIUS_COMPILER_VERSION ( ( __GNUC__ )*100 ) + ( ( __GNUC_MINOR__ )*10 )
76 # define SAGITTARIUS_CXX_STD_LIB_VER __GLIBCXX__
79 # define SAGITTARIUS_CXX_STD_LIB_VER __GLIBCXX__
80 #elif defined ( _MSC_VER )
81 # define SAGITTARIUS_COMPILER SAGITTARIUS_COMPILER_MSVC
82 # define SAGITTARIUS_COMPILER_VERSION _MSC_VER
83 #elif defined ( __BORLANDC__ )
84 # error "Borland C/C++ is not supported"
86 # error "This compiler does not appear to be supported"
90 # if (SAGITTARIUS_COMPILER == SAGITTARIUS_COMPILER_MSVC)
91 # define SAGITTARIUS_DEPRECATED(f) __declspec(deprecated) f
93 # define SAGITTARIUS_DEPRECATED(f) f __attribute__((deprecated))
97 #if SAGITTARIUS_COMPILER == SAGITTARIUS_COMPILER_MSVC
98 # if SAGITTARIUS_COMPILER_VERSION >= 1200
99 # define FORCEINLINE __forceinline
101 #elif defined( __MINGW32__ )
102 # if !defined(FORCEINLINE)
103 # define FORCEINLINE __inline
106 # define FORCEINLINE __inline
110 #if defined( __WIN32__ ) || defined ( _WIN32 )
111 # define SAGITTARIUS_PLATFORM SAGITTARIUS_PLATFORM_WIN
112 # define SAGITTARIUS_IS_POSIX_VAR 0 //True if on a POSIX variant
113 #elif defined ( __APPLE_CC__ )
114 # define SAGITTARIUS_PLATFORM SAGITTARIUS_PLATFORM_APPLE
115 # define SAGITTARIUS_IS_POSIX_VAR 1
116 #elif defined ( __linux__ )
117 # define SAGITTARIUS_PLATFORM SAGITTARIUS_PLATFORM_LINUX
118 # define SAGITTARIUS_IS_POSIX_VAR 1
120 # warning Platform unknown trying Linux
121 # define SAGITTARIUS_PLATFORM SAGITTARIUS_PLATFORM_LINUX
125 #if defined( __x86_64__ ) || defined( _M_X64 )
126 # define SAGITTARIUS_ARCH SAGITTARIUS_ARCH_64
127 # define SG_PTR_SIZE 8
129 # define SAGITTARIUS_ARCH SAGITTARIUS_ARCH_32
130 # define SG_PTR_SIZE 4
133 #define GF_MACRO_QUOTE( x ) # x
134 #define GF_EXPAND_AND_QUOTE( x ) GF_MACRO_QUOTE(x)
135 #define SAGITTARIUS_WARN( x ) message( __FILE__ "(" MACRO_QUOTE( __LINE__ ) ") : " x "\n" )
138 #if SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_WIN
139 # include "SagittariusPlatformWin.h"
140 # define OS_SEP MACRO_QUOTE(/)
146 # if(!SBNW_CLIENT_BUILD)
147 # define _GraphfabExport __declspec(dllexport)
148 # define _GraphfabPrivate
150 # define _GraphfabExport __declspec(dllimport)
151 # define _GraphfabPrivate
153 #elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_APPLE
154 # define _GraphfabExport
155 # define _GraphfabPrivate
156 #elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_LINUX
157 # define OS_SEP MACRO_QUOTE(/)
158 # if defined( SAGITTARIUS_GCC_VISIBILITY )
159 # define _GraphfabExport __attribute__ ((visibility("default")))
160 # define _GraphfabPrivate __attribute__ ((visibility("hidden")))
162 # define _GraphfabExport
163 # define _GraphfabPrivate
167 #define SAGITTARIUS_UNICODE_SUPPORT 0
169 #ifdef SAGITTARIUS_CONFIG_BIG_ENDIAN
170 # define SAGITTARIUS_ENDIAN SAGITTARIUS_BIG_ENDIAN
172 # define SAGITTARIUS_ENDIAN SAGITTARIUS_LITTLE_ENDIAN