Logo ROOT   6.13/01
Reference Guide
RConfig.h
Go to the documentation of this file.
1 /* @(#)root/base:$Id$ */
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_RConfig
12 #define ROOT_RConfig
13 
14 /*************************************************************************
15  * *
16  * RConfig *
17  * *
18  * Defines used by ROOT. *
19  * *
20  *************************************************************************/
21 
22 #include "RVersion.h"
23 
24 
25 /*---- new C++ features ------------------------------------------------------*/
26 
27 #if defined __has_feature
28 # if __has_feature(modules)
29 # define R__CXXMODULES
30 # endif
31 #endif
32 
33 #define R__USE_SHADOW_CLASS
34 
35 /* Now required, thus defined by default for backward compatibility */
36 #define R__ANSISTREAM /* ANSI C++ Standard Library conformant */
37 #define R__SSTREAM /* use sstream or strstream header */
38 
39 #if defined(_MSC_VER)
40 # if (_MSC_VER < 1910)
41 # error "ROOT requires Visual Studio 2017 or higher."
42 # else
43 # define R__NULLPTR
44 # endif
45 #else
46 # if defined(__cplusplus) && (__cplusplus < 201103L)
47 # error "ROOT requires support for C++11 or higher."
48 # if defined(__GNUC__) || defined(__clang__)
49 # error "Pass `-std=c++11` as compiler argument."
50 # endif
51 # endif
52 #endif
53 
54 /*---- machines --------------------------------------------------------------*/
55 
56 #ifdef __hpux
57  /* R__HPUX10 or R__HPUX11 is determined in the Makefile */
58 # define R__HPUX
59 # define R__UNIX
60 # define ANSICPP
61 # ifdef __LP64__
62 # define R__B64
63 # endif
64 # ifdef R__HPUX10
65 # define NEED_SNPRINTF
66 # endif
67 #endif
68 
69 #ifdef _AIX
70 # define R__AIX
71 # define R__UNIX
72 # define ANSICPP
73 # define R__SEEK64
74 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
75 # define NEED_STRCASECMP
76 #endif
77 
78 #if defined(__linux) || defined(__linux__)
79 # ifndef linux
80 # define linux
81 # endif
82 #endif
83 
84 #if defined(__CYGWIN__) && defined(__GNUC__)
85 # ifndef linux
86 # define linux
87 # endif
88 # ifndef R__WINGCC
89 # define R__WINGCC
90 # endif
91 #endif
92 
93 #if defined(__sun) && !(defined(linux) || defined(__FCC_VERSION))
94 # ifdef __SVR4
95 # define R__SOLARIS
96 # define R__SEEK64
97 # define ANSICPP
98 # ifdef __i386
99 # define R__BYTESWAP
100 # endif
101 # ifdef __x86_64
102 # define R__B64
103 # define R__BYTESWAP
104 # endif
105 # else
106 # define R__SUN
107 # include <stdlib.h>
108 # endif
109 # define R__UNIX
110 # define NEED_STRING
111 # define NEED_SIGJMP
112 # if __SUNPRO_CC > 0x420
113 # define R__SOLARIS_CC50
114 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
115 # endif
116 # if __SUNPRO_CC >= 0x420
117 # define R__SUNCCBUG /* to work around a compiler bug */
118 # endif
119 # if __GNUC__ >= 3 || __GNUC_MINOR__ >= 90 /* modern egcs/gcc */
120 # define R__SUNGCC3
121 # endif
122 #endif
123 
124 #if defined(__FCC_VERSION) /* Solaris with Fujitsu compiler */
125 # define R__SOLARIS
126 # define R__SEEK64
127 # define ANSICPP
128 # define R__UNIX
129 # define NEED_STRING
130 # define NEED_SIGJMP
131 #endif
132 
133 #if defined(linux)
134 # ifndef _LARGEFILE64_SOURCE
135 # define _LARGEFILE64_SOURCE
136 # endif
137 # include <features.h>
138 # if __GNU_LIBRARY__ == 6
139 # ifndef R__GLIBC
140 # define R__GLIBC
141 # endif
142 # endif
143 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2
144 # define R__NONSCALARFPOS2
145 # define R__USESTHROW
146 # define R__SEEK64
147 # endif
148 #endif
149 
150 #if defined(linux) && defined(__i386__)
151 # define R__LINUX
152 # define R__UNIX
153 # define R__BYTESWAP
154 # ifndef __i486__
155 # define __i486__ /* turn off if you really want to run on an i386 */
156 # endif
157 # define NEED_SIGJMP
158 #endif
159 
160 #if defined(linux) && defined(__ia64__)
161 # define R__LINUX
162 # define R__UNIX
163 # define R__BYTESWAP
164 # define R__B64
165 # define NEED_SIGJMP
166 #endif
167 
168 #if defined(linux) && defined(__x86_64__)
169 # define R__LINUX
170 # define R__UNIX
171 # define R__BYTESWAP
172 # define R__B64
173 # define NEED_SIGJMP
174 #endif
175 
176 #if defined(linux) && defined(__arm__)
177 # define R__LINUX
178 # define R__UNIX
179 # define R__BYTESWAP
180 # define NEED_SIGJMP
181 #endif
182 
183 #if defined(linux) && defined(__sparc__)
184 # define R__LINUX
185 # define R__UNIX
186 # define NEED_SIGJMP
187 /*# define R__B64 */ /* enable when 64 bit machine */
188 #endif
189 
190 #if defined(linux) && defined(__hppa)
191 # define R__LINUX
192 # define R__UNIX
193 # define NEED_SIGJMP
194 #endif
195 
196 #if defined(linux) && defined(__powerpc__)
197 # define R__LINUX
198 # define R__UNIX
199 # define NEED_SIGJMP
200 # if defined(R__ppc64)
201 # define R__B64
202 # endif
203 # if defined(_LITTLE_ENDIAN)
204 # define R__BYTESWAP
205 # endif
206 #endif
207 
208 #if defined(linux) && defined(__aarch64__)
209 # define R__LINUX
210 # define R__UNIX
211 # define R__BYTESWAP
212 # define R__B64
213 # define NEED_SIGJMP
214 #endif
215 
216 #if defined(linux) && defined(__s390__)
217 # define R__LINUX
218 # define R__UNIX
219 # define NEED_SIGJMP
220 #endif
221 
222 #if defined(linux) && defined(__s390x__)
223 # define R__LINUX
224 # define R__UNIX
225 # define R__B64
226 # define NEED_SIGJMP
227 #endif
228 
229 #if defined(__MACH__) && defined(__i386__) && !defined(__APPLE__)
230 # define R__HURD
231 # define f2cFortran /* cfortran.h does not know HURD - sigh */
232 # define R__UNIX
233 # define R__BYTESWAP
234 # define R__GLIBC /* GNU/Hurd always use GLIBC 2.x :-) */
235 # define NEED_SIGJMP
236 #endif
237 
238 #if defined(__Lynx__) && defined(__powerpc__)
239 # define R__LYNXOS
240 # define R__UNIX
241 # define ANSICPP
242 # define NEED_SIGJMP
243 # define NEED_STRCASECMP
244 # define NEED_SNPRINTF
245 #endif
246 
247 #if defined(__FreeBSD__)
248 # define R__FBSD
249 # define R__UNIX
250 # define R__BYTESWAP
251 # if defined(__i386__)
252 # ifndef __i486__
253 # define __i486__ /* turn off if you really want to run on an i386 */
254 # endif
255 # endif
256 # if defined(__amd64__)
257 # define R__B64
258 # endif
259 # define HAS_STRLCPY
260 #endif
261 
262 #if defined(__OpenBSD__)
263 # define R__OBSD
264 # define R__UNIX
265 # define R__BYTESWAP
266 # if defined(__i386__)
267 # ifndef __i486__
268 # define __i486__ /* turn off if you really want to run on an i386 */
269 # endif
270 # endif
271 # if defined(__amd64__)
272 # define R__B64
273 # endif
274 # define HAS_STRLCPY
275 #endif
276 
277 #if defined(__APPLE__) /* MacOS X support, initially following FreeBSD */
278 # include <AvailabilityMacros.h>
279 # ifndef __CINT__
280 # include <TargetConditionals.h>
281 # endif
282 # define R__MACOSX
283 # define R__UNIX
284 # if defined(__xlC__) || defined(__xlc__)
285 # define ANSICPP
286 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
287 # endif
288 # if defined(__ppc64__)
289 # define R__B64 /* enable when 64 bit machine */
290 # endif
291 # if defined(__i386__)
292 # define R__BYTESWAP
293 # endif
294 # if defined(__arm__)
295 # define R__BYTESWAP
296 # endif
297 # if defined(__x86_64__)
298 # define R__BYTESWAP
299 # define R__B64 /* enable when 64 bit machine */
300 # endif
301 # define HAS_STRLCPY
302 #endif
303 
304 #ifdef _HIUX_SOURCE
305 # define R__HIUX
306 # define R__UNIX
307 # define NEED_SIGJMP
308 # define NEED_SNPRINTF
309 # define ANSICPP
310 #endif
311 
312 #ifdef __GNUC__
313 # define R__GNU
314 # define ANSICPP
315 # if __GNUC__ >= 3 || __GNUC_MINOR__ >= 90 /* egcs 1.0.3 */
316 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */
317 # define R__PLACEMENTDELETE /* supports overloading placement delete */
318 # endif
319 # if __GNUC__ >= 3 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)
320 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
321 # endif
322 # if defined(__ia64__) && __GNUC__ < 3 /* gcc 2.9x (MINOR is 9!) */
323 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */
324 # define R__PLACEMENTDELETE /* supports overloading placement delete */
325 # endif
326 # if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ > 1)
327 # define R__PRAGMA_DIAGNOSTIC
328 # endif
329 #endif
330 
331 #ifdef R__USE_CXX14
332 # if defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_12)
333  // At least on 10.11, the compiler defines but the c++ library does not provide the size operator delete.
334  // See for example https://llvm.org/bugs/show_bug.cgi?id=22951 or
335  // https://github.com/gperftools/gperftools/issues/794.
336 # elif !defined(__GNUC__)
337 # define R__SIZEDDELETE
338 # elif __GNUC__ > 4
339 # define R__SIZEDDELETE
340 # endif
341 #endif
342 
343 /* allows symbols to be hidden from the shared library export symbol table */
344 /* use typically on file statics and private methods */
345 #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
346 # define R__HIDDEN __attribute__((__visibility__("hidden")))
347 #else
348 # define R__HIDDEN
349 #endif
350 
351 #ifdef __INTEL_COMPILER
352 # define R__INTEL_COMPILER
353 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */
354 # define R__PLACEMENTDELETE /* supports overloading placement delete */
355 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
356 # define ANSICPP
357 #endif
358 
359 #ifdef __HP_aCC
360 # define R__ACC
361 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */
362 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
363 # if __HP_aCC <= 015000
364 # define R__OLDHPACC
365 # define R__TEMPLATE_OVERLOAD_BUG
366 # define R__GLOBALSTL /* STL in global name space */
367 # else
368 # define R__PLACEMENTDELETE /* supports overloading placement delete */
369 # define R__TMPLTSTREAM /* std::iostream implemented with templates */
370 # endif
371 # ifndef _INCLUDE_LONGLONG
372 # define _INCLUDE_LONGLONG
373 # endif
374 #endif
375 
376 #ifdef _WIN32
377 # define R__WIN32
378 # ifndef WIN32
379 # define WIN32
380 # endif
381 # define R__BYTESWAP
382 # define R__ACCESS_IN_SYMBOL
383 //# define __attribute__(X)
384 //# define thread_local static __declspec(thread)
385 #endif
386 
387 #ifdef __SC__
388 # define SC
389 # define R__SC
390 # if defined(WIN32)
391 # define NEED_STRING
392 # define NEED_STRCASECMP
393 # define NEED_SNPRINTF
394 # define ANSICPP
395 # else
396 # define MSDOS
397 # define NEED_STRCASECMP
398 # define R__BYTESWAP
399 # endif
400 #endif
401 
402 #ifdef _MSC_VER
403 # define R__VISUAL_CPLUSPLUS
404 # define NEED_STRING
405 # define NEED_STRCASECMP
406 # if _MSC_VER < 1900
407 # define NEED_SNPRINTF
408 # endif
409 # define ANSICPP
410 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */
411 # define R__PLACEMENTDELETE /* supports overloading placement delete */
412 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */
413 # if _MSC_VER >= 1400
414 # define DONTNEED_VSNPRINTF
415 # endif
416 # if _MSC_VER < 1310
417 # define R__NO_CLASS_TEMPLATE_SPECIALIZATION
418 # endif
419 # if _MSC_VER <= 1800
420 # define R__NO_ATOMIC_FUNCTION_POINTER
421 # endif
422 #endif
423 
424 /*--- memory and object statistics -------------------------------------------*/
425 
426 /* #define R__NOSTATS */
427 
428 /*--- cpp --------------------------------------------------------------------*/
429 
430 #ifdef ANSICPP
431  /* symbol concatenation operator */
432 # define _NAME1_(name) name
433 # define _NAME2_(name1,name2) name1##name2
434 # define _NAME3_(name1,name2,name3) name1##name2##name3
435 
436  /* stringizing */
437 # define _QUOTE_(name) #name
438 
439 #else
440 
441 # define _NAME1_(name) name
442 # define _NAME2_(name1,name2) _NAME1_(name1)name2
443 # define _NAME3_(name1,name2,name3) _NAME2_(name1,name2)name3
444 
445 # define _QUOTE_(name) "name"
446 
447 #endif
448 
449 /* produce an identifier that is almost unique inside a file */
450 #ifndef __CINT__
451 # define _R__JOIN_(X,Y) _NAME2_(X,Y)
452 # define _R__JOIN3_(F,X,Y) _NAME3_(F,X,Y)
453 # define _R__UNIQUE_DICT_(X) _R__JOIN3_(R__DICTIONARY_FILENAME,X,__LINE__)
454 # define _R__UNIQUE_(X) _R__JOIN_(X,__LINE__)
455 #else
456  /* Currently CINT does not really mind to have duplicates and */
457  /* does not work correctly as far as merging tokens is concerned. */
458 # define _R__UNIQUE_(X) X
459 #endif
460 
461 /*---- deprecation -----------------------------------------------------------*/
462 #if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
463 # if __GNUC__ == 5 && (__GNUC_MINOR__ == 1 || __GNUC_MINOR__ == 2)
464 /* GCC 5.1, 5.2: false positives due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15269 */
465 # define _R__DEPRECATED_LATER(REASON)
466 # else
467 # define _R__DEPRECATED_LATER(REASON) __attribute__((deprecated(REASON)))
468 # endif
469 #elif defined(_MSC_VER)
470 # define _R__DEPRECATED_LATER(REASON) __declspec(deprecated(REASON))
471 #else
472 /* Deprecation not supported for this compiler. */
473 # define _R__DEPRECATED_LATER(REASON)
474 #endif
475 #define _R_DEPRECATED_REMOVE_NOW(REASON) __attribute__((REMOVE_THIS_NOW))
476 
477 /* To be removed by 6.12 */
478 #if ROOT_VERSION_CODE < ROOT_VERSION(6,11,0)
479 # define _R__DEPRECATED_612(REASON) _R__DEPRECATED_LATER(REASON)
480 #else
481 # define _R__DEPRECATED_612(REASON) _R_DEPRECATED_REMOVE_NOW(REASON)
482 #endif
483 
484 /* To be removed by 6.14 */
485 #if ROOT_VERSION_CODE < ROOT_VERSION(6,13,0)
486 # define _R__DEPRECATED_614(REASON) _R__DEPRECATED_LATER(REASON)
487 #else
488 # define _R__DEPRECATED_614(REASON) _R_DEPRECATED_REMOVE_NOW(REASON)
489 #endif
490 
491 /* To be removed by 7.00 */
492 #if ROOT_VERSION_CODE < ROOT_VERSION(6,99,0)
493 # define _R__DEPRECATED_700(REASON) _R__DEPRECATED_LATER(REASON)
494 #else
495 # define _R__DEPRECATED_700(REASON) _R_DEPRECATED_REMOVE_NOW(REASON)
496 #endif
497 
498 
499 /* Spell as R__DEPRECATED(6,04, "Not threadsafe; use TFoo::Bar().") */
500 #define R__DEPRECATED(MAJOR, MINOR, REASON) \
501  _R__JOIN3_(_R__DEPRECATED_,MAJOR,MINOR)("will be removed in ROOT v" #MAJOR "." #MINOR ": " REASON)
502 
503 /*---- misc ------------------------------------------------------------------*/
504 
505 #ifdef R__GNU
506 # define SafeDelete(p) { if (p) { delete p; p = 0; } }
507 #else
508 # define SafeDelete(p) { delete p; p = 0; }
509 #endif
510 
511 #ifdef __FAST_MATH__
512 #define R__FAST_MATH
513 #endif
514 
515 #if (__GNUC__ >= 7)
516 #define R__DO_PRAGMA(x) _Pragma (#x)
517 # define R__INTENTIONALLY_UNINIT_BEGIN \
518  R__DO_PRAGMA(GCC diagnostic push) \
519  R__DO_PRAGMA(GCC diagnostic ignored "-Wmaybe-uninitialized") \
520  R__DO_PRAGMA(GCC diagnostic ignored "-Wuninitialized")
521 # define R__INTENTIONALLY_UNINIT_END \
522  R__DO_PRAGMA(GCC diagnostic pop)
523 #else
524 # define R__INTENTIONALLY_UNINIT_BEGIN
525 # define R__INTENTIONALLY_UNINIT_END
526 
527 #endif
528 
529 #ifdef R__HAS_ATTRIBUTE_ALWAYS_INLINE
530 #define R__ALWAYS_INLINE inline __attribute__((always_inline))
531 #else
532 #define R__ALWAYS_INLINE inline
533 #endif
534 
535 /*---- unlikely / likely expressions -----------------------------------------*/
536 // These are meant to use in cases like:
537 // if (R__unlikely(expression)) { ... }
538 // in performance-critical sessions. R__unlikely / R__likely provide hints to
539 // the compiler code generation to heavily optimize one side of a conditional,
540 // causing the other branch to have a heavy performance cost.
541 //
542 // It is best to use this for conditionals that test for rare error cases or
543 // backward compatibility code.
544 
545 #if (__GNUC__ >= 3) || defined(__INTEL_COMPILER)
546 #if !defined(R__unlikely)
547  #define R__unlikely(expr) __builtin_expect(!!(expr), 0)
548 #endif
549 #if !defined(R__likely)
550  #define R__likely(expr) __builtin_expect(!!(expr), 1)
551 #endif
552 #else
553  #define R__unlikely(expr) expr
554  #define R__likely(expr) expr
555 #endif
556 
557 
558 #endif