src/main.h

changeset 87
8f65914e7046
parent 86
43fe4be38a58
equal deleted inserted replaced
86:43fe4be38a58 87:8f65914e7046
58 #define FILE_CASEINSENSITIVE 58 #define FILE_CASEINSENSITIVE
59 #endif 59 #endif
60 60
61 #define elif else if 61 #define elif else if
62 62
63 #define CHECK_FILE(pointer,path,action) \
64 if (!pointer) { \
65 error ("couldn't open %s for %s!\n", path.chars(), action); \
66 exit (1); \
67 }
68
69 #define types public 63 #define types public
70 #define countof(A) ((int) (sizeof A / sizeof *A)) 64 #define countof(A) ((int) (sizeof A / sizeof *A))
71 #define autocast(A) (decltype(A))
72 #define assign_autocast(A,B) a = autocast(A) b
73 65
74 // Shortcut for zeroing something 66 // Shortcut for zeroing something
75 #define ZERO(obj) memset (&obj, 0, sizeof (obj)); 67 #define ZERO(obj) memset (&obj, 0, sizeof (obj));
76 68
77 enum form_length_e { e_long_form, e_short_form }; 69 enum form_length_e { e_long_form, e_short_form };
78 70
79 string ObjectFileName (string s); 71 string make_object_file_name (string s);
80 bool fexists (string path); 72 bool fexists (string path);
81 type_e GetTypeByName (string token); 73 type_e get_type_by_name (string token);
82 string GetTypeName (type_e type); 74 string get_type_name (type_e type);
83 string get_version_string (form_length_e len); 75 string get_version_string (form_length_e len);
84 string make_version_string (int major, int minor, int patch); 76 string make_version_string (int major, int minor, int patch);
85 77
86 #ifndef __GNUC__ 78 #ifndef __GNUC__
87 #define __attribute__(X) 79 #define __attribute__(X)

mercurial