11 #pragma warning( disable : 4127 )
16 #define INT16_MAX 32767
19 #define INT16_MIN (-INT16_MAX - 1)
22 #if SHRT_MAX == INT16_MAX
23 typedef short int int16;
24 #elif INT_MAX == INT16_MAX
27 #error failed to define int16, please report this to gary@pa.uky.edu
31 #define UINT16_MAX 65535
34 #if USHRT_MAX == UINT16_MAX
35 typedef unsigned short int uint16;
36 #elif UINT_MAX == UINT16_MAX
37 typedef unsigned int uint16;
39 #error failed to define uint16, please report this to gary@pa.uky.edu
43 #define INT32_MAX 2147483647L
46 #define INT32_MIN (-INT32_MAX - 1)
49 #if INT_MAX == INT32_MAX
51 #elif LONG_MAX == INT32_MAX
52 typedef long int int32;
54 #error failed to define int32, please report this to gary@pa.uky.edu
58 #define UINT32_MAX 4294967295UL
61 #if UINT_MAX == UINT32_MAX
62 typedef unsigned int uint32;
63 #elif ULONG_MAX == UINT32_MAX
64 typedef unsigned long int uint32;
66 #error failed to define uint32, please report this to gary@pa.uky.edu
69 #if LONG_MAX > INT32_MAX
78 #define INT64_MAX 9223372036854775807L
81 #define INT64_MIN (-INT64_MAX - 1L)
83 #if LONG_MAX == INT64_MAX
85 typedef long int int64;
90 #if ULONG_MAX > UINT32_MAX
93 #define UINT64_MAX 18446744073709551615UL
95 #if ULONG_MAX == UINT64_MAX
97 typedef unsigned long int uint64;
136 #if defined(_ARCH_PPC) || defined(__POWERPC__) || defined(__powerpc__) || defined(PPC)
147 #if defined(unix) || defined(__unix__)
162 #if defined(__GNUC__) && ! ( defined(__ICC) || defined(__PATHSCALE__) || defined(__OPENCC__) || defined(__clang__) )
163 #define __GNUC_EXCL__ 1
169 #define __func__ DEBUG_ENTRY.name()
199 const ios_base::openmode
mode_r = ios_base::in;
200 const ios_base::openmode
mode_w = ios_base::out | ios_base::trunc;
201 const ios_base::openmode
mode_a = ios_base::out | ios_base::app;
202 const ios_base::openmode
mode_rp = ios_base::in | ios_base::out;
203 const ios_base::openmode
mode_wp = ios_base::in | ios_base::out | ios_base::trunc;
204 const ios_base::openmode
mode_ap = ios_base::in | ios_base::out | ios_base::app;
239 struct sigaction p_action;
240 struct sigaction p_default;
281 const struct sigaction* action()
const {
return &p_action; }
282 const struct sigaction* deflt()
const {
return &p_default; }
293 sigaction( SIGABRT, deflt(), NULL );
295 sigaction( SIGABRT, action(), NULL );
299 signal( SIGABRT, SIG_DFL );
323 friend void open_data( fstream& stream,
const char* fname, ios_base::openmode mode,
access_scheme scheme );
327 friend void set_NaN(
double &x);
328 friend void set_NaN(
double x[],
long n);
366 #define NORETURN __declspec(noreturn)
367 #elif defined(__GNUC__) || ( defined(__INTEL_COMPILER) && defined(__linux) )
368 #define NORETURN __attribute__ ((noreturn))
374 #define UNLIKELY(x) (x)
378 #define UNLIKELY(x) __builtin_expect((x),0)
381 #define RESTRICT __restrict
382 #define UNUSED __attribute__ ((unused))
391 #define DO_EXPAND(VAL) VAL ## 1
392 #define EXPAND(VAL) DO_EXPAND(VAL)
397 #if defined __INTEL_COMPILER
398 # define __COMP "icc"
399 # define __COMP_VER __INTEL_COMPILER
403 #elif defined __PATHSCALE__
404 # define __COMP "pathCC"
405 # define __COMP_VER __PATHCC__ * 100 + __PATHCC_MINOR__ * 10 + __PATHCC_PATCHLEVEL__
409 #elif defined __OPENCC__
410 # define __COMP "Open64"
411 # if EXPAND(__OPENCC_PATCHLEVEL__) == 1
412 # define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10
414 # define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10 + __OPENCC_PATCHLEVEL__
419 #elif defined __clang__
420 # define __COMP "clang++"
421 # define __COMP_VER __clang_major__ * 100 + __clang_minor__ * 10 + __clang_patchlevel__
424 #elif defined __GNUC__
425 # define __COMP "g++"
426 # if defined(__GNUC_PATCHLEVEL__)
427 # define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
429 # define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
433 # define __COMP "Portland Group"
434 # if defined(__PGIC__)
435 # define __COMP_VER (__PGIC__ * 100 + __PGIC_MINOR__ * 10 + __PGIC_PATCHLEVEL__)
437 # define __COMP_VER 0
442 #elif defined(__sgi) && defined(_COMPILER_VERSION)
443 # define __COMP "MIPSpro"
444 # define __COMP_VER _COMPILER_VERSION
447 #elif defined __HP_aCC
448 # define __COMP "HP aCC"
449 # define __COMP_VER __HP_aCC
453 # define __COMP "DEC CC"
454 # define __COMP_VER __DECC_VER
457 #elif defined _MSC_VER
459 # define __COMP_VER _MSC_VER
462 #elif defined __SUNPRO_CC
463 # define __COMP "Solaris Studio"
464 # define __COMP_VER __SUNPRO_CC
468 # define __COMP "unknown"
469 # define __COMP_VER 0
476 # define __OS "Linux (IA32)"
477 # elif defined __amd64
478 # define __OS "Linux (AMD64)"
479 # elif defined __ia64
480 # define __OS "Linux (IA64)"
481 # elif defined __ppc__
482 # define __OS "Linux (PowerPC)"
484 # define __OS "Linux (other)"
488 #elif defined macintosh
489 # define __OS "Mac OS 9"
492 #elif defined __MACOSX__
493 # define __OS "Mac OS X"
496 #elif defined __APPLE__
497 # define __OS "Apple MacOS"
501 # define __OS "HP-UX"
505 # define __OS "Solaris"
513 # define __OS "Ultrix"
516 #elif defined __FreeBSD__
517 # define __OS "FreeBSD"
519 #elif defined __NetBSD__
520 # define __OS "NetBSD"
522 #elif defined __OpenBSD__
523 # define __OS "OpenBSD"
528 # define __OS "Win64"
532 # define __OS "Win32"
535 #elif defined __CYGWIN__
536 # define __OS "Cygwin"
544 # define __OS "unknown"
550 #if defined(__GNUC_EXCL__) && ((__GNUC__ == 2 && __GNUC_MINOR__ == 96) || (__GNUC__ == 3 && __GNUC_MINOR__ == 4))
551 #error "This g++ version cannot compile Cloudy and must not be used! Please update g++ to a functional version. See http://wiki.nublado.org/wiki/CompilingCloudy for more details."
554 #if __INTEL_COMPILER >= 1200 && __INTEL_COMPILER < 1300
555 #error "This icc version cannot compile Cloudy and must not be used! Please use a functional version of icc, or g++. See http://wiki.nublado.org/wiki/CompilingCloudy for more details."
560 #pragma warning( default : 4127 )
const ios_base::openmode mode_wpb
const ios_base::openmode mode_wp
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
static void signal_handler(int sig)
void getPathList(const char *fname, vector< string > &PathList, access_scheme scheme) const
bool p_lgMPISingleRankMode
const ios_base::openmode mode_apb
void set_NaN(sys_float &x)
friend void set_NaN(sys_float &x)
const ios_base::openmode mode_rb
int32 Double_SNaN_Value[2]
void setAssertAbort(bool val)
bool MyIsnan(const sys_float &x)
double min_double() const
bool little_endian() const
bool lgAssertAbort() const
friend FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
const ios_base::openmode mode_a
const ios_base::openmode mode_r
const ios_base::openmode mode_rpb
void printDataPath() const
vector< string > p_exit_status
const ios_base::openmode mode_ap
const ios_base::openmode mode_w
sys_float min_float() const
void set_signal_handlers()
void set_MPISingleRankMode(bool mode)
void enable_traps() const
vector< string > chSearchPath
const ios_base::openmode mode_ab
const ios_base::openmode mode_wb
const ios_base::openmode mode_rp
char chDirSeparator() const
bool lgMPISingleRankMode() const
const char * host_name() const
const string & chExitStatus(exit_type s) const