OpendTect  6.3
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 ________________________________________________________________________
10 
11 */
12 
13 
64 /*____________________________________________________________________________*/
65 /* OS type */
66 
67 #undef __unix__
68 #undef __win__
69 
70 #if defined( __win64__ ) || defined ( __win32__ )
71 # define __win__ 1
72 #endif
73 
74 #if defined ( __lux32__ ) || defined ( __lux64__ )
75 # define __unix__ 1
76 # define __lux__ 1
77 #endif
78 
79 #if defined( __mac__ )
80 # define __unix__ 1
81 #endif
82 
83 #ifndef __unix__
84 #ifndef __win__
85 # error "Platform not detected."
86 #endif
87 #endif
88 
89 #ifdef __lux__
90 # define __islinux__ true
91 #else
92 # define __islinux__ false
93 #endif
94 #ifdef __mac__
95 # define __ismac__ true
96 #else
97 # define __ismac__ false
98 #endif
99 #ifdef __win__
100 # define __iswin__ true
101 #else
102 # define __iswin__ false
103 #endif
104 
105 
106 /*____________________________________________________________________________*/
107 /* Machine type */
108 
109 
110 #undef __little__
111 // All platforms are little endian
112 # define __little__ 1
113 # define __islittle__ true
114 
115 #ifdef __win32__
116 # define __plfsubdir__ "win32"
117 # define __plfname__ "MS Windows 32 bits"
118 # define __is32bits__ true
119 #endif
120 #ifdef __win64__
121 # define __plfsubdir__ "win64"
122 # define __plfname__ "MS Windows 64 bits"
123 # define __is32bits__ false
124 #endif
125 #ifdef __lux32__
126 # define __plfsubdir__ "lux32"
127 # define __plfname__ "Linux 32 bits"
128 # define __is32bits__ true
129 #endif
130 #ifdef __lux64__
131 # define __plfsubdir__ "lux64"
132 # define __plfname__ "Linux 64 bits"
133 # define __is32bits__ false
134 #endif
135 #ifdef __mac__
136 # define __plfsubdir__ "mac"
137 # define __plfname__ "Mac"
138 # define __is32bits__ false
139 #endif
140 
141 /*____________________________________________________________________________*/
142 /* Language type */
143 
144 #undef __cpp__
145 #ifdef __cplusplus
146 # if __cplusplus >= 201103L
147 # define __cpp11__ 1
148 # endif
149 # define __cpp__ 1
150 #endif
151 #ifdef _LANGUAGE_C_PLUS_PLUS
152 # undef __cpp__
153 # define __cpp__ 2
154 #endif
155 #ifdef c_plusplus
156 # undef __cpp__
157 # define __cpp__ 3
158 #endif
159 
160 
161 /*____________________________________________________________________________*/
162 /* Compiler type */
163 
164 #undef __gnu__
165 #undef __msvc__
166 #ifdef __lux__
167 # define __gnuc__ 1
168 #endif
169 #ifdef __GNUC__
170 # undef __gnuc__
171 # define __gnuc__ 1
172 #endif
173 #if defined( __win__ ) || defined( WIN32 )
174 # ifndef __gnuc__
175 # define __msvc__ 1
176 # endif
177 #endif
178 
179 #if defined( __win__ ) && !defined( __msvc__ )
180 # define __cygwin__ 1
181 #endif
182 
183 
184 #undef mUnusedVar
185 #if defined( __gnuc__ )
186 # define mUnusedVar __attribute__ ((unused))
187 
188 //Support for deprecation under gcc is fully available in gcc 4.8
189 # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7 )
190 # define mDeprecated __attribute__ ((deprecated))
191 # define mStartAllowDeprecatedSection \
192  _Pragma ( "GCC diagnostic push" ) \
193  _Pragma ( "GCC diagnostic ignored \"-Wdeprecated-declarations\"" )
194 # define mStopAllowDeprecatedSection \
195  _Pragma ( "GCC diagnostic pop" )
196 # else
197 # ifdef __clang__
198 # define mDeprecated __attribute__ ((deprecated))
199 # else
200 # define mDeprecated
201 # endif
202 # define mStartAllowDeprecatedSection \
203  _Pragma("clang diagnostic push") \
204  _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
205 # define mStopAllowDeprecatedSection \
206  _Pragma("clang diagnostic pop")
207 # endif
208 #else
209 # define mUnusedVar
210 # if defined( __win__ )
211 # define mDeprecated __declspec(deprecated)
212 # else
213 # define mDeprecated
214 # endif
215 # define mStartAllowDeprecatedSection \
216  __pragma(warning(push)) \
217  __pragma(warning(disable:4996))
218 # define mStopAllowDeprecatedSection \
219  __pragma(warning(pop))
220 #endif
221 
222 #ifdef __win__
223 # define mODRestrict __restrict
224 # else
225 # define mODRestrict __restrict__
226 #endif
227 
228 
229 /* And, probably unnecessary, for external header files: */
230 #ifndef NeedFunctionPrototypes
231 # define NeedFunctionPrototypes 1
232 #endif
233 #ifndef _ANSI_C_SOURCE
234 # define _ANSI_C_SOURCE 1
235 #endif

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