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 /* Do not #define nullptr if the code is compiled in c++11 mode. */ 32 #if __cplusplus > 199711L 33 #define R__NULLPTR 34 #endif 35 36 /*---- machines --------------------------------------------------------------*/ 37 38 #ifdef __hpux 39 /* R__HPUX10 or R__HPUX11 is determined in the Makefile */ 40 # define R__HPUX 41 # define R__UNIX 42 # define ANSICPP 43 # ifdef __LP64__ 44 # define R__B64 45 # endif 46 # ifdef R__HPUX10 47 # define NEED_SNPRINTF 48 # endif 49 #endif 50 51 #ifdef _AIX 52 # define R__AIX 53 # define R__UNIX 54 # define ANSICPP 55 # define R__SEEK64 56 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 57 # define NEED_STRCASECMP 58 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 59 #endif 60 61 #ifdef __linux 62 # ifndef linux 63 # define linux 64 # endif 65 #endif 66 67 #if defined(__CYGWIN__) && defined(__GNUC__) 68 # ifndef linux 69 # define linux 70 # endif 71 # ifndef R__WINGCC 72 # define R__WINGCC 73 # endif 74 #endif 75 76 #if defined(__alpha) && !defined(linux) 77 # include <standards.h> 78 # ifndef __USE_STD_IOSTREAM 79 # define __USE_STD_IOSTREAM 80 # endif 81 # define R__ANSISTREAM 82 # define R__SSTREAM 83 # define R__TMPLTSTREAM 84 # ifdef _XOPEN_SOURCE 85 # if _XOPEN_SOURCE+0 > 0 86 # define R__TRUE64 87 # endif 88 # endif 89 # define R__ALPHA 90 # define ANSICPP 91 # ifndef R__TRUE64 92 # define NEED_SNPRINTF 93 # endif 94 # ifndef __VMS 95 # define R__UNIX 96 # define R__B64 97 # define R__BYTESWAP 98 # if __DECCXX_VER >= 60060002 99 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */ 100 # define R__PLACEMENTDELETE /* supports overloading placement delete */ 101 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 102 # define R__THROWNEWDELETE /* new/delete throw exceptions */ 103 # endif 104 # if defined __GNUC__ 105 # define R__NAMESPACE_TEMPLATE_IMP_BUG 106 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 107 # else 108 # define R__TEMPLATE_OVERLOAD_BUG 109 # endif 110 # endif 111 #endif 112 113 #if defined(__sun) && !(defined(linux) || defined(__FCC_VERSION)) 114 # ifdef __SVR4 115 # define R__SOLARIS 116 # define R__SEEK64 117 # define ANSICPP 118 # ifdef __i386 119 # define R__BYTESWAP 120 # endif 121 # ifdef __x86_64 122 # define R__B64 123 # define R__BYTESWAP 124 # endif 125 # else 126 # define R__SUN 127 # include <stdlib.h> 128 # endif 129 # define R__UNIX 130 # define NEED_STRING 131 # define NEED_SIGJMP 132 # if __SUNPRO_CC > 0x420 133 # define R__SOLARIS_CC50 134 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 135 # define R__SSTREAM /* use sstream or strstream header */ 136 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 137 # endif 138 # if __SUNPRO_CC >= 0x420 139 # define R__SUNCCBUG /* to work around a compiler bug */ 140 # endif 141 # if __SUNPRO_CC >= 0x5110 142 # define R__THROWNEWDELETE 143 # endif 144 # if __GNUC__ >= 3 || __GNUC_MINOR__ >= 90 /* modern egcs/gcc */ 145 # define R__SUNGCC3 146 # endif 147 #endif 148 149 #if defined(__FCC_VERSION) /* Solaris with Fujitsu compiler */ 150 # define R__SOLARIS 151 # define R__SEEK64 152 # define ANSICPP 153 # define R__UNIX 154 # define NEED_STRING 155 # define NEED_SIGJMP 156 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 157 #endif 158 159 #if defined(__sgi) && !defined(linux) 160 # define R__SGI 161 # define R__UNIX 162 # define ANSICPP 163 # define NEED_STRING 164 # define NEED_SIGJMP 165 # define R__SEEK64 166 # if !defined(__KCC) 167 # define R__THROWNEWDELETE /* new/delete throw exceptions */ 168 # endif 169 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 170 # ifdef IRIX64 171 # define R__SGI64 172 # endif 173 # if defined(__mips64) || defined(_ABI64) 174 # define R__B64 175 # undef R__SEEK64 176 # endif 177 # if !defined(__KCC) 178 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 179 # endif 180 #endif 181 182 #if defined(linux) 183 # ifndef _LARGEFILE64_SOURCE 184 # define _LARGEFILE64_SOURCE 185 # endif 186 # include <features.h> 187 # if __GNU_LIBRARY__ == 6 188 # ifndef R__GLIBC 189 # define R__GLIBC 190 # endif 191 # endif 192 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 193 # define R__NONSCALARFPOS2 194 # define R__USESTHROW 195 # define R__SEEK64 196 # endif 197 #endif 198 199 #if defined(linux) && defined(__i386__) 200 # define R__LINUX 201 # define R__UNIX 202 # define R__BYTESWAP 203 # ifndef __i486__ 204 # define __i486__ /* turn off if you really want to run on an i386 */ 205 # endif 206 # define NEED_SIGJMP 207 #endif 208 209 #if defined(linux) && defined(__ia64__) 210 # define R__LINUX 211 # define R__UNIX 212 # define R__BYTESWAP 213 # define R__B64 214 # define NEED_SIGJMP 215 #endif 216 217 #if defined(linux) && defined(__x86_64__) 218 # define R__LINUX 219 # define R__UNIX 220 # define R__BYTESWAP 221 # define R__B64 222 # define NEED_SIGJMP 223 #endif 224 225 #if defined(linux) && defined(__aarch64__) 226 # define R__LINUX 227 # define R__UNIX 228 # define R__BYTESWAP 229 # define R__B64 230 # define NEED_SIGJMP 231 #endif 232 233 #if defined(linux) && defined(__alpha__) 234 # define R__LINUX 235 # define R__UNIX 236 # define R__BYTESWAP 237 # define R__B64 238 # define NEED_SIGJMP 239 #endif 240 241 #if defined(linux) && defined(__arm__) 242 # define R__LINUX 243 # define R__UNIX 244 # define R__BYTESWAP 245 # define NEED_SIGJMP 246 #endif 247 248 #if defined(linux) && defined(__sparc__) 249 # define R__LINUX 250 # define R__UNIX 251 # define NEED_SIGJMP 252 /*# define R__B64 */ /* enable when 64 bit machine */ 253 #endif 254 255 #if defined(linux) && defined(__sgi) 256 # define R__LINUX 257 # define R__UNIX 258 # define NEED_SIGJMP 259 # if defined(__mips64) || defined(_ABI64) 260 # define R__B64 /* enable when 64 bit machine */ 261 # endif 262 #endif 263 264 /* 265 Note, that there are really 3 APIs: 266 267 mips, mipsel: 268 O32 ABI, ILP32, "long long" in a "aligned" even-odd register 269 pair, 4 argument registers 270 271 mipsn32, mipsn32el 272 N32 ABI, ILP32, but with 64 bit wide registers, and "long long" 273 in a single register, 8 argument registers 274 275 mips64, mips64el 276 N64 ABI, LP64, 8 argument registers 277 278 where O32, N32, and N64 are the ABI names. ILP32 means that 279 (I)int, (L)long, (P)pointer are 32bit long. LP64 means that 280 long and pointer are 64bit long. "el" denotes if the ABI is 281 little endian. 282 283 N32 is different from 032, in the calling convention. Arguments 284 passed as 64bit (long long) reference, and there are 8 of those. 285 O32 is the one closest to "normal" GNU/Linux on i386. 286 287 It's a bit more complex. MIPS spans probably the largest 288 performance range of any CPU family, from a 32bit 20 MHz 289 Microcontroller (made by Microchip) up to a 64bit monster with 290 over 5000 CPUs (made by SiCortex). Obviously, only the 64bit 291 CPUs can run 64bit code, but 32bit code runs on all of them. 292 293 The use cases for the different ABIs are: 294 - O32: Most compatible, runs everywhere 295 - N32: Best performance on 64 bit if a large address space isn't 296 needed. It is faster than O32 due to improved calling 297 conventions, and it is faster than N64 due to reduced 298 pointer size. 299 - N64: Huge address space. 300 301 Currently (end 2007) Debian GNU/Linux only supports O32 302 303 Thanks to Thiemo Seufer <ths@networkno.de> of Debian 304 */ 305 #if defined(__linux) && defined(__mips__) 306 # define R__LINUX 307 # define R__UNIX 308 # define NEED_SIGJMP 309 # if _MIPS_SIM == _ABI64 310 # define R__B64 /* enable when 64 bit machine */ 311 # endif 312 # if defined(__MIPSEL__) /* Little endian */ 313 # define R__BYTESWAP 314 # endif 315 #endif 316 317 #if defined(linux) && defined(__hppa) 318 # define R__LINUX 319 # define R__UNIX 320 # define NEED_SIGJMP 321 #endif 322 323 #if defined(linux) && defined(__powerpc__) 324 # define R__LINUX 325 # define R__UNIX 326 # define NEED_SIGJMP 327 # if defined(R__ppc64) 328 # define R__B64 329 # endif 330 #endif 331 332 #if defined(__MACH__) && defined(__i386__) && !defined(__APPLE__) 333 # define R__HURD 334 # define f2cFortran /* cfortran.h does not know HURD - sigh */ 335 # define R__UNIX 336 # define R__BYTESWAP 337 # define R__GLIBC /* GNU/Hurd always use GLIBC 2.x :-) */ 338 # define NEED_SIGJMP 339 #endif 340 341 #if defined(__Lynx__) && defined(__powerpc__) 342 # define R__LYNXOS 343 # define R__UNIX 344 # define ANSICPP 345 # define NEED_SIGJMP 346 # define NEED_STRCASECMP 347 # define NEED_SNPRINTF 348 #endif 349 350 #if defined(__FreeBSD__) 351 # define R__FBSD 352 # define R__UNIX 353 # define R__BYTESWAP 354 # if defined(__i386__) 355 # ifndef __i486__ 356 # define __i486__ /* turn off if you really want to run on an i386 */ 357 # endif 358 # endif 359 # if defined(__amd64__) 360 # define R__B64 361 # endif 362 # define R__THROWNEWDELETE /* new/delete throw exceptions */ 363 # define HAS_STRLCPY 364 #endif 365 366 #if defined(__OpenBSD__) 367 # define R__OBSD 368 # define R__UNIX 369 # define R__BYTESWAP 370 # if defined(__i386__) 371 # ifndef __i486__ 372 # define __i486__ /* turn off if you really want to run on an i386 */ 373 # endif 374 # endif 375 # if defined(__amd64__) 376 # define R__B64 377 # endif 378 # define R__THROWNEWDELETE /* new/delete throw exceptions */ 379 # define HAS_STRLCPY 380 #endif 381 382 #if defined(__APPLE__) /* MacOS X support, initially following FreeBSD */ 383 # include <AvailabilityMacros.h> 384 # ifndef __CINT__ 385 # include <TargetConditionals.h> 386 # endif 387 # define R__MACOSX 388 # define R__UNIX 389 # if defined(__xlC__) || defined(__xlc__) 390 # define ANSICPP 391 # define R__ANSISTREAM 392 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 393 # endif 394 # if defined(__ppc64__) 395 # define R__B64 /* enable when 64 bit machine */ 396 # endif 397 # if defined(__i386__) 398 # define R__BYTESWAP 399 # endif 400 # if defined(__arm__) 401 # define R__BYTESWAP 402 # endif 403 # if defined(__x86_64__) 404 # define R__BYTESWAP 405 # define R__B64 /* enable when 64 bit machine */ 406 # endif 407 # define HAS_STRLCPY 408 #endif 409 410 #ifdef _HIUX_SOURCE 411 # define R__HIUX 412 # define R__UNIX 413 # define NEED_SIGJMP 414 # define NEED_SNPRINTF 415 # define ANSICPP 416 #endif 417 418 #ifdef __GNUC__ 419 # define R__GNU 420 # define ANSICPP 421 # if __GNUC__ >= 3 || __GNUC_MINOR__ >= 90 /* egcs 1.0.3 */ 422 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */ 423 # define R__PLACEMENTDELETE /* supports overloading placement delete */ 424 # endif 425 # if __GNUC__ >= 3 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95) 426 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 427 # endif 428 # if __GNUC__ >= 3 || __GNUC_MINOR__ >= 91 /* egcs 1.1.x */ 429 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 430 # endif 431 # if __GNUC__ >= 3 432 # define R__SSTREAM /* use sstream or strstream header */ 433 # endif 434 # if defined(__ia64__) && __GNUC__ < 3 /* gcc 2.9x (MINOR is 9!) */ 435 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */ 436 # define R__PLACEMENTDELETE /* supports overloading placement delete */ 437 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 438 # endif 439 # if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ > 1) 440 # define R__PRAGMA_DIAGNOSTIC 441 # endif 442 #endif 443 444 /* allows symbols to be hidden from the shared library export symbol table */ 445 /* use typically on file statics and private methods */ 446 #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) 447 # define R__HIDDEN __attribute__((__visibility__("hidden"))) 448 #else 449 # define R__HIDDEN 450 #endif 451 452 #ifdef __INTEL_COMPILER 453 # define R__INTEL_COMPILER 454 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 455 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */ 456 # define R__PLACEMENTDELETE /* supports overloading placement delete */ 457 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 458 # define ANSICPP 459 #endif 460 461 #ifdef __HP_aCC 462 # define R__ACC 463 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */ 464 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 465 # define R__THROWNEWDELETE /* new/delete throw exceptions */ 466 # if __HP_aCC <= 015000 467 # define R__OLDHPACC 468 # define R__TEMPLATE_OVERLOAD_BUG 469 # define R__GLOBALSTL /* STL in global name space */ 470 # else 471 # define R__PLACEMENTDELETE /* supports overloading placement delete */ 472 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 473 # define R__TMPLTSTREAM /* iostream implemented with templates */ 474 # endif 475 # ifndef _INCLUDE_LONGLONG 476 # define _INCLUDE_LONGLONG 477 # endif 478 #endif 479 480 #ifdef _WIN32 481 # define R__WIN32 482 # ifndef WIN32 483 # define WIN32 484 # endif 485 # define R__BYTESWAP 486 # define R__ACCESS_IN_SYMBOL 487 #endif 488 489 #ifdef __SC__ 490 # define SC 491 # define R__SC 492 # if defined(WIN32) 493 # define NEED_STRING 494 # define NEED_STRCASECMP 495 # define NEED_SNPRINTF 496 # define ANSICPP 497 # else 498 # define MSDOS 499 # define NEED_STRCASECMP 500 # define R__BYTESWAP 501 # endif 502 #endif 503 504 #ifdef _MSC_VER 505 # define R__VISUAL_CPLUSPLUS 506 # define NEED_STRING 507 # define NEED_STRCASECMP 508 # define NEED_SNPRINTF 509 # define ANSICPP 510 # define R__VECNEWDELETE /* supports overloading of new[] and delete[] */ 511 # define R__PLACEMENTDELETE /* supports overloading placement delete */ 512 # define R__PLACEMENTINLINE /* placement new/delete is inline in <new> */ 513 # if _MSC_VER >= 1200 514 # define R__ANSISTREAM /* ANSI C++ Standard Library conformant */ 515 # endif 516 # if _MSC_VER >= 1310 517 # define R__SSTREAM /* has <sstream> iso <strstream> */ 518 # endif 519 # if _MSC_VER >= 1400 520 # define DONTNEED_VSNPRINTF 521 # endif 522 # if _MSC_VER < 1310 523 # define R__NO_CLASS_TEMPLATE_SPECIALIZATION 524 # endif 525 #endif 526 527 /*--- memory and object statistics -------------------------------------------*/ 528 529 /* #define R__NOSTATS */ 530 531 /*--- cpp --------------------------------------------------------------------*/ 532 533 #ifdef ANSICPP 534 /* symbol concatenation operator */ 535 # define _NAME1_(name) name 536 # define _NAME2_(name1,name2) name1##name2 537 # define _NAME3_(name1,name2,name3) name1##name2##name3 538 539 /* stringizing */ 540 # define _QUOTE_(name) #name 541 542 #else 543 544 # define _NAME1_(name) name 545 # define _NAME2_(name1,name2) _NAME1_(name1)name2 546 # define _NAME3_(name1,name2,name3) _NAME2_(name1,name2)name3 547 548 # define _QUOTE_(name) "name" 549 550 #endif 551 552 /* produce an identifier that is almost unique inside a file */ 553 #ifndef __CINT__ 554 # define _R__JOIN_(X,Y) _NAME2_(X,Y) 555 # define _R__JOIN3_(F,X,Y) _NAME3_(F,X,Y) 556 #ifdef R__DICTIONARY_FILENAME 557 # define _R__UNIQUE_(X) _R__JOIN3_(R__DICTIONARY_FILENAME,X,__LINE__) 558 #else 559 # define _R__UNIQUE_(X) _R__JOIN_(X,__LINE__) 560 #endif 561 #else 562 /* Currently CINT does not really mind to have duplicates and */ 563 /* does not work correctly as far as merging tokens is concerned. */ 564 # define _R__UNIQUE_(X) X 565 #endif 566 567 /*---- misc ------------------------------------------------------------------*/ 568 569 #ifdef R__GNU 570 # define SafeDelete(p) { if (p) { delete p; p = 0; } } 571 #else 572 # define SafeDelete(p) { delete p; p = 0; } 573 #endif 574 575 #endif 576