common.h

changeset 69
29a3e669d648
parent 68
588cc27e84bb
child 70
fc257920ac00
equal deleted inserted replaced
68:588cc27e84bb 69:29a3e669d648
48 #include "str.h" 48 #include "str.h"
49 49
50 // Application name and version 50 // Application name and version
51 #define APPNAME "botc" 51 #define APPNAME "botc"
52 #define VERSION_MAJOR 0 52 #define VERSION_MAJOR 0
53 #define VERSION_MINOR 0 53 #define VERSION_MINOR 999
54 #define VERSION_REVISION 999 54
55 // Use a macro for Write so we can get the function name
56 // This can be pretty crucial in debugging.
57 #ifdef __GNUC__
58 #define Write(STUFF) DoWrite (__PRETTY_FUNCTION__, STUFF)
59 #else
60 #define Write(STUFF) DoWrite (__func__, STUFF)
61 #endif
55 62
56 // On Windows, files are case-insensitive 63 // On Windows, files are case-insensitive
57 #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__) 64 #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__)
58 #define FILE_CASEINSENSITIVE 65 #define FILE_CASEINSENSITIVE
59 #endif 66 #endif
70 enum type_e { 77 enum type_e {
71 TYPE_UNKNOWN = 0, 78 TYPE_UNKNOWN = 0,
72 TYPE_VOID, 79 TYPE_VOID,
73 TYPE_INT, 80 TYPE_INT,
74 TYPE_STRING, 81 TYPE_STRING,
75 TYPE_FLOAT,
76 TYPE_BOOL, 82 TYPE_BOOL,
77
78 }; 83 };
79 84
80 #define CHECK_FILE(pointer,path,action) \ 85 #define CHECK_FILE(pointer,path,action) \
81 if (!pointer) { \ 86 if (!pointer) { \
82 error ("couldn't open %s for %s!\n", (char*)path, action); \ 87 error ("couldn't open %s for %s!\n", (char*)path, action); \

mercurial