32 |
32 |
33 |
33 |
34 #ifndef _MAIN_HH |
34 #ifndef _MAIN_HH |
35 #define _MAIN_HH |
35 #define _MAIN_HH |
36 |
36 |
|
37 |
|
38 /* Get the definition of INT16_MAX, INT16_MIN, UINT64_MAX, INT64_MAX, INT64_MIN, ... */ |
|
39 |
|
40 #define __STDC_LIMIT_MACROS /* required when including from C++ source code. */ |
|
41 #include <stdint.h> |
|
42 |
|
43 #ifndef UINT64_MAX |
|
44 #define UINT64_MAX (std::numeric_limits< uint64_t >::max()) |
|
45 #endif |
|
46 #ifndef INT64_MAX |
|
47 #define INT64_MAX (std::numeric_limits< int64_t >::max()) |
|
48 #endif |
|
49 #ifndef INT64_MIN |
|
50 #define INT64_MIN (std::numeric_limits< int64_t >::min()) |
|
51 #endif |
|
52 |
|
53 #if (real64_t == float) |
|
54 #define HUGE_VAL64 HUGE_VALF |
|
55 #elif (real64_t == double) |
|
56 #define HUGE_VAL64 HUGE_VAL |
|
57 #elif (real64_t == long_double) |
|
58 #define HUGE_VAL64 HUGE_VALL |
|
59 #else |
|
60 #error Could not determine which data type is being used for real64_t (defined in absyntax.hh). Aborting! |
|
61 #endif |
|
62 |
|
63 |
|
64 |
|
65 |
37 /* Function used throughout the code --> used to report failed assertions (i.e. internal compiler errors)! */ |
66 /* Function used throughout the code --> used to report failed assertions (i.e. internal compiler errors)! */ |
38 |
67 #include <stddef.h> /* required for NULL */ |
|
68 |
39 #define ERROR error_exit(__FILE__,__LINE__) |
69 #define ERROR error_exit(__FILE__,__LINE__) |
40 #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg) |
70 #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg) |
41 // #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg, __VA_ARGS__) |
71 // #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg, __VA_ARGS__) |
42 |
72 |
43 extern void error_exit(const char *file_name, int line_no, const char *errmsg = NULL, ...); |
73 extern void error_exit(const char *file_name, int line_no, const char *errmsg = NULL, ...); |