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

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