src/Main.h

changeset 108
6409ece8297c
parent 106
9174be9ac686
child 112
def56932f938
equal deleted inserted replaced
107:55c2bcd8ed5c 108:6409ece8297c
27 */ 27 */
28 28
29 #ifndef BOTC_MAIN_H 29 #ifndef BOTC_MAIN_H
30 #define BOTC_MAIN_H 30 #define BOTC_MAIN_H
31 31
32 #if !defined (__cplusplus) || __cplusplus < 201103L
33 # error botc requires a C++11-compliant compiler to be built
34 #endif
35
36 #include <cstdio> 32 #include <cstdio>
37 #include <cstdarg> 33 #include <cstdarg>
38 #include <cstdint> 34 #include <cstdint>
35 #include "Macros.h"
39 #include "Property.h" 36 #include "Property.h"
40 #include "Types.h" 37 #include "Types.h"
41 #include "Containers.h" 38 #include "Containers.h"
42 #include "String.h" 39 #include "String.h"
43 #include "Format.h" 40 #include "Format.h"
44 #include "BotStuff.h" 41 #include "BotStuff.h"
45 #include "Tokens.h" 42 #include "Tokens.h"
46 43
47 // Application name and version
48 #define APPNAME "botc"
49 #define VERSION_MAJOR 1
50 #define VERSION_MINOR 0
51 #define VERSION_PATCH 0
52
53 #define MAKE_VERSION_NUMBER(MAJ, MIN, PAT) ((MAJ * 10000) + (MIN * 100) + PAT)
54 #define VERSION_NUMBER MAKE_VERSION_NUMBER (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
55
56 // On Windows, files are case-insensitive
57 #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__)
58 #define FILE_CASEINSENSITIVE
59 #endif
60
61 #define elif else if
62
63 #define types public
64 #define countof(A) ((int) (sizeof A / sizeof *A))
65
66 // Shortcut for zeroing something
67 #define ZERO(obj) memset (&obj, 0, sizeof (obj));
68
69 enum EFormLength
70 {
71 ELongForm,
72 EShortForm
73 };
74
75 String MakeObjectFileName (String s); 44 String MakeObjectFileName (String s);
76 EType GetTypeByName (String token); 45 DataType GetTypeByName (String token);
77 String GetTypeName (EType type); 46 String GetTypeName (DataType type);
78 String GetVersionString (EFormLength len); 47 String GetVersionString (bool longform);
79 String MakeVersionString (int major, int minor, int patch); 48 String MakeVersionString (int major, int minor, int patch);
80 49
81 template<typename T> 50 template<typename T>
82 inline T max (T a, T b) 51 inline T max (T a, T b)
83 { 52 {
88 inline T min (T a, T b) 57 inline T min (T a, T b)
89 { 58 {
90 return a < b ? a : b; 59 return a < b ? a : b;
91 } 60 }
92 61
93 #ifndef __GNUC__
94 #define __attribute__(X)
95 #endif
96 #define deprecated __attribute__ ((deprecated))
97
98 #endif // BOTC_MAIN_H 62 #endif // BOTC_MAIN_H

mercurial