OpendTect-6_4  6.4
plfdefs.h
Go to the documentation of this file.
1 #ifndef plfdefs_h
2 #define plfdefs_h
3 
4 /*
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H.Bril
9  Contents: Defines that encapsulate system things
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 */
14 
15 
66 /*____________________________________________________________________________*/
67 /* OS type */
68 
69 #undef __unix__
70 #undef __win__
71 
72 #if defined( __win64__ ) || defined ( __win32__ )
73 # define __win__ 1
74 #endif
75 
76 #if defined ( __lux32__ ) || defined ( __lux64__ )
77 # define __unix__ 1
78 # define __lux__ 1
79 #endif
80 
81 #if defined( __mac__ )
82 # define __unix__ 1
83 
84 //This is a fix to fix the bug 6644037 at bugreport.apple.com
85 //This bug makes the compiler not link the objectset's virtual functions under
86 //some conditions.
87 # if defined( __clang__)
88 # if ( __clang_major__==5 ) && ( __clang_minor__==1 )
89 # ifndef __MAC_LLVM_COMPILER_ERROR__
90 # define LLVM_ERROR
91 # endif
92 # endif
93 # endif
94 # if ( __clang_major__==6 ) && ( __clang_minor__==0 )
95 # ifndef __MAC_LLVM_COMPILER_ERROR__
96 # define LLVM_ERROR
97 # endif
98 # endif
99 # endif
100 
101 # ifdef LLVM_ERROR
102 # pragma message "This version of clang is prone to errors " \
103  "Set __MAC_LLVM_COMPILER_ERROR__ to fix it"
104 # endif
105 
106 #ifndef __unix__
107 #ifndef __win__
108 # error "Platform not detected."
109 #endif
110 #endif
111 
112 #ifdef __lux__
113 # define __islinux__ true
114 #else
115 # define __islinux__ false
116 #endif
117 #ifdef __mac__
118 # define __ismac__ true
119 #else
120 # define __ismac__ false
121 #endif
122 #ifdef __win__
123 # define __iswin__ true
124 #else
125 # define __iswin__ false
126 #endif
127 
128 
129 /*____________________________________________________________________________*/
130 /* Machine type */
131 
132 
133 #undef __little__
134 // All platforms are little endian
135 # define __little__ 1
136 # define __islittle__ true
137 
138 #ifdef __win32__
139 # define __plfsubdir__ "win32"
140 # define __plfname__ "MS Windows 32 bits"
141 # define __is32bits__ true
142 #endif
143 #ifdef __win64__
144 # define __plfsubdir__ "win64"
145 # define __plfname__ "MS Windows 64 bits"
146 # define __is32bits__ false
147 #endif
148 #ifdef __lux32__
149 # define __plfsubdir__ "lux32"
150 # define __plfname__ "Linux 32 bits"
151 # define __is32bits__ true
152 #endif
153 #ifdef __lux64__
154 # define __plfsubdir__ "lux64"
155 # define __plfname__ "Linux 64 bits"
156 # define __is32bits__ false
157 #endif
158 #ifdef __mac__
159 # define __plfsubdir__ "mac"
160 # define __plfname__ "Mac"
161 # define __is32bits__ false
162 #endif
163 
164 /*____________________________________________________________________________*/
165 /* Language type */
166 
167 #undef __cpp__
168 #ifdef __cplusplus
169 # if __cplusplus >= 201103L
170 # define __cpp11__ 1
171 # endif
172 # define __cpp__ 1
173 #endif
174 #ifdef _LANGUAGE_C_PLUS_PLUS
175 # undef __cpp__
176 # define __cpp__ 2
177 #endif
178 #ifdef c_plusplus
179 # undef __cpp__
180 # define __cpp__ 3
181 #endif
182 
183 
184 /*____________________________________________________________________________*/
185 /* Compiler type */
186 
187 #undef __gnu__
188 #undef __msvc__
189 #ifdef __lux__
190 # define __gnuc__ 1
191 #endif
192 #ifdef __GNUC__
193 # undef __gnuc__
194 # define __gnuc__ 1
195 #endif
196 #if defined( __win__ ) || defined( WIN32 )
197 # ifndef __gnuc__
198 # define __msvc__ 1
199 # endif
200 #endif
201 
202 #if defined( __win__ ) && !defined( __msvc__ )
203 # define __cygwin__ 1
204 #endif
205 
206 
207 #undef mUnusedVar
208 #if defined( __gnuc__ )
209 # define mUnusedVar __attribute__ ((unused))
210 
211 //Support for deprecation under gcc is fully available in gcc 4.6
212 # if __GNUC__ > 4 || (__GNUC__ == 6 && __GNUC_MINOR__ > 0 )
213 # define mDeprecated __attribute__ ((deprecated))
214 # define mStartAllowDeprecatedSection \
215  _Pragma ( "GCC diagnostic push" ) \
216  _Pragma ( "GCC diagnostic ignored \"-Wdeprecated-declarations\"" )
217 # define mStopAllowDeprecatedSection \
218  _Pragma ( "GCC diagnostic pop" )
219 # else
220 # ifdef __clang__
221 # define mDeprecated __attribute__ ((deprecated))
222 # else
223 # define mDeprecated
224 # endif
225 # define mStartAllowDeprecatedSection
226 # define mStopAllowDeprecatedSection
227 # endif
228 #else
229 # define mUnusedVar
230 # if defined( __win__ )
231 # define mDeprecated __declspec(deprecated)
232 # else
233 # define mDeprecated
234 # endif
235 # define mStartAllowDeprecatedSection
236 # define mStopAllowDeprecatedSection
237 #endif
238 
239 #ifdef __win__
240 # define mODRestrict __restrict
241 # else
242 # define mODRestrict __restrict__
243 #endif
244 
245 
246 /* And, probably unnecessary, for external header files: */
247 #ifndef NeedFunctionPrototypes
248 # define NeedFunctionPrototypes 1
249 #endif
250 #ifndef _ANSI_C_SOURCE
251 # define _ANSI_C_SOURCE 1
252 #endif
253 
254 
255 #endif

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019