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