Go to the documentation of this file.
11 #pragma warning( disable : 4127 )
17 #define UNUSED __attribute__ ((unused))
22 #define INT16_MAX 32767
25 #define INT16_MIN (-INT16_MAX - 1)
28 #if SHRT_MAX == INT16_MAX
29 typedef short int int16;
30 #elif INT_MAX == INT16_MAX
33 #error failed to define int16, please report this to gary@pa.uky.edu
37 #define UINT16_MAX 65535
40 #if USHRT_MAX == UINT16_MAX
41 typedef unsigned short int uint16;
42 #elif UINT_MAX == UINT16_MAX
43 typedef unsigned int uint16;
45 #error failed to define uint16, please report this to gary@pa.uky.edu
49 #define INT32_MAX 2147483647L
52 #define INT32_MIN (-INT32_MAX - 1)
55 #if INT_MAX == INT32_MAX
57 #elif LONG_MAX == INT32_MAX
58 typedef long int int32;
60 #error failed to define int32, please report this to gary@pa.uky.edu
64 #define UINT32_MAX 4294967295UL
67 #if UINT_MAX == UINT32_MAX
68 typedef unsigned int uint32;
69 #elif ULONG_MAX == UINT32_MAX
70 typedef unsigned long int uint32;
72 #error failed to define uint32, please report this to gary@pa.uky.edu
75 #if LONG_MAX > INT32_MAX
84 #define INT64_MAX 9223372036854775807L
87 #define INT64_MIN (-INT64_MAX - 1L)
89 #if LONG_MAX == INT64_MAX
91 typedef long int int64;
96 #if ULONG_MAX > UINT32_MAX
99 #define UINT64_MAX 18446744073709551615UL
101 #if ULONG_MAX == UINT64_MAX
102 #define HAVE_UINT64 1
103 typedef unsigned long int uint64;
142 #if defined(_ARCH_PPC) || defined(__POWERPC__) || defined(__powerpc__) || defined(PPC)
153 #if defined(unix) || defined(__unix__)
160 #if defined(linux) || defined(__linux)
175 #if defined(__GNUC__) && ! ( defined(__ICC) || defined(__PATHSCALE__) || defined(__OPENCC__) || defined(__clang__) )
176 #define __GNUC_EXCL__ 1
182 #define __func__ DEBUG_ENTRY.name()
212 const ios_base::openmode
mode_r = ios_base::in;
213 const ios_base::openmode
mode_w = ios_base::out | ios_base::trunc;
214 const ios_base::openmode
mode_a = ios_base::out | ios_base::app;
215 const ios_base::openmode
mode_rp = ios_base::in | ios_base::out;
216 const ios_base::openmode
mode_wp = ios_base::in | ios_base::out | ios_base::trunc;
217 const ios_base::openmode
mode_ap = ios_base::in | ios_base::out | ios_base::app;
252 struct sigaction p_action;
253 struct sigaction p_default;
294 const struct sigaction* action()
const {
return &p_action; }
295 const struct sigaction* deflt()
const {
return &p_default; }
306 sigaction( SIGABRT, deflt(), NULL );
308 sigaction( SIGABRT, action(), NULL );
312 signal( SIGABRT, SIG_DFL );
336 friend void open_data( fstream& stream,
const char* fname, ios_base::openmode mode,
access_scheme scheme );
340 friend void set_NaN(
double &x);
341 friend void set_NaN(
double x[],
long n);
379 #define NORETURN __declspec(noreturn)
380 #elif defined(__GNUC__) || ( defined(__INTEL_COMPILER) && defined(__linux__) )
381 #define NORETURN __attribute__ ((noreturn))
387 #define UNLIKELY(x) (x)
391 #define UNLIKELY(x) __builtin_expect((x),0)
394 #define RESTRICT __restrict
402 #define DO_EXPAND(VAL) VAL ## 1
403 #define EXPAND(VAL) DO_EXPAND(VAL)
408 #if defined __INTEL_COMPILER
409 # define __COMP "icc"
410 # define __COMP_VER __INTEL_COMPILER
414 #elif defined __PATHSCALE__
415 # define __COMP "pathCC"
416 # define __COMP_VER __PATHCC__ * 100 + __PATHCC_MINOR__ * 10 + __PATHCC_PATCHLEVEL__
420 #elif defined __OPENCC__
421 # define __COMP "Open64"
422 # if EXPAND(__OPENCC_PATCHLEVEL__) == 1
423 # define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10
425 # define __COMP_VER __OPENCC__ * 100 + __OPENCC_MINOR__ * 10 + __OPENCC_PATCHLEVEL__
430 #elif defined __clang__
431 # define __COMP "clang++"
432 # define __COMP_VER __clang_major__ * 100 + __clang_minor__ * 10 + __clang_patchlevel__
435 #elif defined __GNUC__
436 # define __COMP "g++"
437 # if defined(__GNUC_PATCHLEVEL__)
438 # define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
440 # define __COMP_VER (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
444 # define __COMP "Portland Group"
445 # if defined(__PGIC__)
446 # define __COMP_VER (__PGIC__ * 100 + __PGIC_MINOR__ * 10 + __PGIC_PATCHLEVEL__)
448 # define __COMP_VER 0
453 #elif defined(__sgi) && defined(_COMPILER_VERSION)
454 # define __COMP "MIPSpro"
455 # define __COMP_VER _COMPILER_VERSION
458 #elif defined __HP_aCC
459 # define __COMP "HP aCC"
460 # define __COMP_VER __HP_aCC
464 # define __COMP "DEC CC"
465 # define __COMP_VER __DECC_VER
468 #elif defined _MSC_VER
470 # define __COMP_VER _MSC_VER
473 #elif defined __SUNPRO_CC
474 # define __COMP "Solaris Studio"
475 # define __COMP_VER __SUNPRO_CC
479 # define __COMP "unknown"
480 # define __COMP_VER 0
485 #if defined __linux__
487 # define __OS "Linux (IA32)"
488 # elif defined __amd64
489 # define __OS "Linux (AMD64)"
490 # elif defined __ia64
491 # define __OS "Linux (IA64)"
492 # elif defined __ppc__
493 # define __OS "Linux (PowerPC)"
495 # define __OS "Linux (other)"
499 #elif defined macintosh
500 # define __OS "Mac OS 9"
503 #elif defined __MACOSX__
504 # define __OS "Mac OS X"
507 #elif defined __APPLE__
508 # define __OS "Apple MacOS"
512 # define __OS "HP-UX"
516 # define __OS "Solaris"
524 # define __OS "Ultrix"
527 #elif defined __FreeBSD__
528 # define __OS "FreeBSD"
530 #elif defined __NetBSD__
531 # define __OS "NetBSD"
533 #elif defined __OpenBSD__
534 # define __OS "OpenBSD"
539 # define __OS "Win64"
543 # define __OS "Win32"
546 #elif defined __CYGWIN__
547 # define __OS "Cygwin"
555 # define __OS "unknown"
561 # if defined(__GNUC_EXCL__) && ((__GNUC__ == 2 && __GNUC_MINOR__ == 96) || (__GNUC__ == 3 && __GNUC_MINOR__ == 4))
562 # 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/CompilingCloudyC13 for more details."
565 # if __INTEL_COMPILER >= 1200 && __INTEL_COMPILER < 1300
566 # 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/CompilingCloudyC13 for more details."
571 #pragma warning( default : 4127 )
bool p_lgMPISingleRankMode
void getPathList(const char *fname, vector< string > &PathList, access_scheme scheme) const
const char * host_name() const
void set_MPISingleRankMode(bool mode)
void enable_traps() const
const ios_base::openmode mode_rp
double min_double() const
const ios_base::openmode UNUSED mode_wb
const ios_base::openmode UNUSED mode_rb
bool lgMPISingleRankMode() const
friend FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
void set_signal_handlers()
const ios_base::openmode mode_ap
sys_float min_float() const
const ios_base::openmode mode_r
bool little_endian() const
bool lgAssertAbort() const
vector< string > p_exit_status
char chDirSeparator() const
void setAssertAbort(bool val)
friend void set_NaN(sys_float &x)
const ios_base::openmode mode_w
const UNUSED realnum BIGFLOAT
int32 Double_SNaN_Value[2]
const ios_base::openmode UNUSED mode_wpb
void set_NaN(sys_float &x)
const ios_base::openmode mode_a
const ios_base::openmode UNUSED mode_ab
const ios_base::openmode UNUSED mode_apb
void printDataPath() const
const ios_base::openmode mode_wp
vector< string > chSearchPath
const ios_base::openmode UNUSED mode_rpb
bool MyIsnan(const sys_float &x)
const string & chExitStatus(exit_type s) const
FILE * open_data(const char *fname, const char *mode, access_scheme scheme=AS_DATA_ONLY)
static void signal_handler(int sig)