Skip to content

Commit 9384e70

Browse files
author
Alex Cole
committed
Create and document defines.
1 parent 2a960df commit 9384e70

12 files changed

Lines changed: 527 additions & 469 deletions

documentation/design-document.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,63 @@ This just declares a variable as being changable by the server, but not by users
119119

120120
This weird declaration is again related to documentation comments. The documentation for an `enum` is always generated, but if the `enum` is never used anywhere in code the comments become unattached and form part of the global documentation, instead of a symbol's documentation. This line just uses the enum in such as way to correctly attach the documentation to the correct symbol in the `.xml`, but not generate any additional output in the AMX.
121121

122-
It does however transpire that `enum`s have some minor issues when used for array indexes. While not all of the enums declared make sense for array indexes (think `KEY`, which is a bit-map), they have all none-the-less been converted to simple `const`s instead (at great cost in documentation complexity).
122+
## Double declarations.
123+
124+
So most symbols are defined in `enum` for several reasons - to keep them grouped together, to collate things in the generated documentation, and for ease of declaration. So why are all the values re-declared a second time using `#define`? This is because different ways of declaring symbols work in different ways. Using `enum` for a set of related values puts them together in the documentation and allows for very efficient declarations - tags can be ommitted and values inferred, leading to much terser and clearer code. The downside to using `enum` is that it messes with arrays, since the slots will inherit the declared tags of each element, so this:
125+
126+
```pawn
127+
new WEAPON:gWeapons[MAX_WEAPON_SLOTS];
128+
```
129+
130+
Will produce unexpected results - the entries have the tag of `_:` not the tag of `WEAPON:`, because that's how the values inside the `WEAPON_SLOT` enum were declared.
131+
132+
Using `const` instead of `enum` solves this problem - there's no weird mixing of index tags and value tags, but the code is way more verbose, and the generated documentation is much more spread out; with unused values not even mentioned.
133+
134+
`#define` is slightly shorter than `const` in declaration length, since you only need tags once instead of twice, but they are not inserted in to the generated documentation at all. There's also one other weird quirk - `#define` is completely ignored by `#emit`, this:
135+
136+
```pawn
137+
#define NUMBER 2
138+
#emit CONST.pri NUMBER
139+
```
140+
141+
Will give an undefined symbol error. But they're not only ignored by `#emit`, but completely invisible to it. Meanwhile, `const` and `enum` can be used by `#emit`, even if a `#define` with the same name would normally overwrite them:
142+
143+
```pawn
144+
const NUMBER = 2;
145+
#define NUMBER 2
146+
#emit CONST.pri NUMBER
147+
```
148+
149+
That code works, and uses the `const` in `#emit`, despite the fact that it should have been hidden by the `#define`. So we have the final solution, covering all use-cases. It is quite verbose, but you can just use the `enum`s to more easily read the code. This will generate compact and complete documentation, it makes reading the code easy if you only use the `enum` part, it works for `#emit` as well as normal code, and it doesn't produce weird side-effects in array declarations:
150+
151+
```pawn
152+
enum WEAPON:MAX_WEAPONS
153+
{
154+
WEAPON_FIST = 0,
155+
WEAPON_BRASSKNUCKLE,
156+
WEAPON_GOLFCLUB,
157+
WEAPON_NITESTICK,
158+
WEAPON_NIGHTSTICK = WEAPON_NITESTICK,
159+
WEAPON_KNIFE,
160+
WEAPON_BAT,
161+
WEAPON_SHOVEL,
162+
WEAPON_POOLSTICK,
163+
WEAPON_KATANA,
164+
// ...
165+
}
166+
167+
#define WEAPON_FIST (WEAPON:0)
168+
#define WEAPON_BRASSKNUCKLE (WEAPON:1)
169+
#define WEAPON_GOLFCLUB (WEAPON:2)
170+
#define WEAPON_NITESTICK (WEAPON:3)
171+
#define WEAPON_NIGHTSTICK (WEAPON:3)
172+
#define WEAPON_KNIFE (WEAPON:4)
173+
#define WEAPON_BAT (WEAPON:5)
174+
#define WEAPON_SHOVEL (WEAPON:6)
175+
#define WEAPON_POOLSTICK (WEAPON:7)
176+
#define WEAPON_KATANA (WEAPON:8)
177+
// ...
178+
```
179+
180+
The enum names can't be used in the `#define`s as that would create an infinite loop in the compiler.
123181

omp_checkpoint.inc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
*/
3232
#define CP_TYPE: __TAG(CP_TYPE):
3333

34-
const CP_TYPE:UNKNOWN_CP_TYPE = CP_TYPE:-1;
35-
const CP_TYPE:CP_TYPE_GROUND_NORMAL = CP_TYPE:0;
36-
const CP_TYPE:CP_TYPE_GROUND_FINISH = CP_TYPE:1;
37-
const CP_TYPE:CP_TYPE_GROUND_EMPTY = CP_TYPE:2;
38-
const CP_TYPE:CP_TYPE_AIR_NORMAL = CP_TYPE:3;
39-
const CP_TYPE:CP_TYPE_AIR_FINISH = CP_TYPE:4;
40-
const CP_TYPE:CP_TYPE_AIR_ROTATING = CP_TYPE:5;
41-
const CP_TYPE:CP_TYPE_AIR_STROBING = CP_TYPE:6;
42-
const CP_TYPE:CP_TYPE_AIR_SWINGING = CP_TYPE:7;
43-
const CP_TYPE:CP_TYPE_AIR_BOBBING = CP_TYPE:8;
34+
#define UNKNOWN_CP_TYPE (CP_TYPE:-1)
35+
#define CP_TYPE_GROUND_NORMAL (CP_TYPE:0)
36+
#define CP_TYPE_GROUND_FINISH (CP_TYPE:1)
37+
#define CP_TYPE_GROUND_EMPTY (CP_TYPE:2)
38+
#define CP_TYPE_AIR_NORMAL (CP_TYPE:3)
39+
#define CP_TYPE_AIR_FINISH (CP_TYPE:4)
40+
#define CP_TYPE_AIR_ROTATING (CP_TYPE:5)
41+
#define CP_TYPE_AIR_STROBING (CP_TYPE:6)
42+
#define CP_TYPE_AIR_SWINGING (CP_TYPE:7)
43+
#define CP_TYPE_AIR_BOBBING (CP_TYPE:8)
4444

4545
/*
4646

omp_core.inc

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -38,68 +38,68 @@ const INVALID_TIMER = 0;
3838
*/
3939
#define WEAPON: __TAG(WEAPON):
4040

41-
const WEAPON:UNKNOWN_WEAPON = WEAPON:-1;
41+
#define UNKNOWN_WEAPON (WEAPON:-1)
4242

4343
// Special `OnPlayerDeath` `reason` values. NOT included in `MAX_WEAPONS`.
44-
const WEAPON:REASON_VEHICLE = WEAPON:49;
45-
const WEAPON:REASON_HELICOPTER_BLADES = WEAPON:50;
46-
const WEAPON:REASON_EXPLOSION = WEAPON:51;
47-
const WEAPON:REASON_DROWN = WEAPON:53;
48-
const WEAPON:REASON_COLLISION = WEAPON:54;
49-
const WEAPON:REASON_SPLAT = WEAPON:54;
50-
const WEAPON:REASON_CONNECT = WEAPON:200;
51-
const WEAPON:REASON_DISCONNECT = WEAPON:201;
52-
const WEAPON:REASON_SUICIDE = WEAPON:255;
44+
#define REASON_VEHICLE (WEAPON:49)
45+
#define REASON_HELICOPTER_BLADES (WEAPON:50)
46+
#define REASON_EXPLOSION (WEAPON:51)
47+
#define REASON_DROWN (WEAPON:53)
48+
#define REASON_COLLISION (WEAPON:54)
49+
#define REASON_SPLAT (WEAPON:54)
50+
#define REASON_CONNECT (WEAPON:200)
51+
#define REASON_DISCONNECT (WEAPON:201)
52+
#define REASON_SUICIDE (WEAPON:255)
5353

5454
// The main weapon types.
55-
const WEAPON:WEAPON_FIST = WEAPON:0;
56-
const WEAPON:WEAPON_BRASSKNUCKLE = WEAPON:1;
57-
const WEAPON:WEAPON_GOLFCLUB = WEAPON:2;
58-
const WEAPON:WEAPON_NITESTICK = WEAPON:3;
59-
const WEAPON:WEAPON_NIGHTSTICK = WEAPON:3;
60-
const WEAPON:WEAPON_KNIFE = WEAPON:4;
61-
const WEAPON:WEAPON_BAT = WEAPON:5;
62-
const WEAPON:WEAPON_SHOVEL = WEAPON:6;
63-
const WEAPON:WEAPON_POOLSTICK = WEAPON:7;
64-
const WEAPON:WEAPON_KATANA = WEAPON:8;
65-
const WEAPON:WEAPON_CHAINSAW = WEAPON:9;
66-
const WEAPON:WEAPON_DILDO = WEAPON:10;
67-
const WEAPON:WEAPON_DILDO2 = WEAPON:11;
68-
const WEAPON:WEAPON_VIBRATOR = WEAPON:12;
69-
const WEAPON:WEAPON_VIBRATOR2 = WEAPON:13;
70-
const WEAPON:WEAPON_FLOWER = WEAPON:14;
71-
const WEAPON:WEAPON_CANE = WEAPON:15;
72-
const WEAPON:WEAPON_GRENADE = WEAPON:16;
73-
const WEAPON:WEAPON_TEARGAS = WEAPON:17;
74-
const WEAPON:WEAPON_MOLTOV = WEAPON:18;
75-
const WEAPON:WEAPON_MOLOTOV = WEAPON:18;
76-
const WEAPON:WEAPON_COLT45 = WEAPON:22;
77-
const WEAPON:WEAPON_SILENCED = WEAPON:23;
78-
const WEAPON:WEAPON_DEAGLE = WEAPON:24;
79-
const WEAPON:WEAPON_SHOTGUN = WEAPON:25;
80-
const WEAPON:WEAPON_SAWEDOFF = WEAPON:26;
81-
const WEAPON:WEAPON_SHOTGSPA = WEAPON:27;
82-
const WEAPON:WEAPON_UZI = WEAPON:28;
83-
const WEAPON:WEAPON_MP5 = WEAPON:29;
84-
const WEAPON:WEAPON_AK47 = WEAPON:30;
85-
const WEAPON:WEAPON_M4 = WEAPON:31;
86-
const WEAPON:WEAPON_TEC9 = WEAPON:32;
87-
const WEAPON:WEAPON_RIFLE = WEAPON:33;
88-
const WEAPON:WEAPON_SNIPER = WEAPON:34;
89-
const WEAPON:WEAPON_ROCKETLAUNCHER = WEAPON:35;
90-
const WEAPON:WEAPON_HEATSEEKER = WEAPON:36;
91-
const WEAPON:WEAPON_FLAMETHROWER = WEAPON:37;
92-
const WEAPON:WEAPON_MINIGUN = WEAPON:38;
93-
const WEAPON:WEAPON_SATCHEL = WEAPON:39;
94-
const WEAPON:WEAPON_BOMB = WEAPON:40;
95-
const WEAPON:WEAPON_SPRAYCAN = WEAPON:41;
96-
const WEAPON:WEAPON_FIREEXTINGUISHER = WEAPON:42;
97-
const WEAPON:WEAPON_CAMERA = WEAPON:43;
98-
const WEAPON:WEAPON_NIGHT_VISION_GOGGLES = WEAPON:44;
99-
const WEAPON:WEAPON_THERMAL_GOGGLES = WEAPON:45;
100-
const WEAPON:WEAPON_PARACHUTE = WEAPON:46;
101-
102-
const WEAPON:MAX_WEAPONS = WEAPON:47;
55+
#define WEAPON_FIST (WEAPON:0)
56+
#define WEAPON_BRASSKNUCKLE (WEAPON:1)
57+
#define WEAPON_GOLFCLUB (WEAPON:2)
58+
#define WEAPON_NITESTICK (WEAPON:3)
59+
#define WEAPON_NIGHTSTICK (WEAPON:3)
60+
#define WEAPON_KNIFE (WEAPON:4)
61+
#define WEAPON_BAT (WEAPON:5)
62+
#define WEAPON_SHOVEL (WEAPON:6)
63+
#define WEAPON_POOLSTICK (WEAPON:7)
64+
#define WEAPON_KATANA (WEAPON:8)
65+
#define WEAPON_CHAINSAW (WEAPON:9)
66+
#define WEAPON_DILDO (WEAPON:10)
67+
#define WEAPON_DILDO2 (WEAPON:11)
68+
#define WEAPON_VIBRATOR (WEAPON:12)
69+
#define WEAPON_VIBRATOR2 (WEAPON:13)
70+
#define WEAPON_FLOWER (WEAPON:14)
71+
#define WEAPON_CANE (WEAPON:15)
72+
#define WEAPON_GRENADE (WEAPON:16)
73+
#define WEAPON_TEARGAS (WEAPON:17)
74+
#define WEAPON_MOLTOV (WEAPON:18)
75+
#define WEAPON_MOLOTOV (WEAPON:18)
76+
#define WEAPON_COLT45 (WEAPON:22)
77+
#define WEAPON_SILENCED (WEAPON:23)
78+
#define WEAPON_DEAGLE (WEAPON:24)
79+
#define WEAPON_SHOTGUN (WEAPON:25)
80+
#define WEAPON_SAWEDOFF (WEAPON:26)
81+
#define WEAPON_SHOTGSPA (WEAPON:27)
82+
#define WEAPON_UZI (WEAPON:28)
83+
#define WEAPON_MP5 (WEAPON:29)
84+
#define WEAPON_AK47 (WEAPON:30)
85+
#define WEAPON_M4 (WEAPON:31)
86+
#define WEAPON_TEC9 (WEAPON:32)
87+
#define WEAPON_RIFLE (WEAPON:33)
88+
#define WEAPON_SNIPER (WEAPON:34)
89+
#define WEAPON_ROCKETLAUNCHER (WEAPON:35)
90+
#define WEAPON_HEATSEEKER (WEAPON:36)
91+
#define WEAPON_FLAMETHROWER (WEAPON:37)
92+
#define WEAPON_MINIGUN (WEAPON:38)
93+
#define WEAPON_SATCHEL (WEAPON:39)
94+
#define WEAPON_BOMB (WEAPON:40)
95+
#define WEAPON_SPRAYCAN (WEAPON:41)
96+
#define WEAPON_FIREEXTINGUISHER (WEAPON:42)
97+
#define WEAPON_CAMERA (WEAPON:43)
98+
#define WEAPON_NIGHT_VISION_GOGGLES (WEAPON:44)
99+
#define WEAPON_THERMAL_GOGGLES (WEAPON:45)
100+
#define WEAPON_PARACHUTE (WEAPON:46)
101+
102+
#define MAX_WEAPONS (WEAPON:47)
103103

104104
#define WEAPON_UNKNOWN UNKNOWN_WEAPON
105105
#define WEAPON_VEHICLE REASON_VEHICLE
@@ -114,22 +114,22 @@ const WEAPON:MAX_WEAPONS = WEAPON:47;
114114
*/
115115
#define WEAPON_SLOT: __TAG(WEAPON_SLOT):
116116

117-
const WEAPON_SLOT:UNKNOWN_WEAPON_SLOT = WEAPON_SLOT:-1;
118-
const WEAPON_SLOT:WEAPON_SLOT_UNARMED = WEAPON_SLOT:0;
119-
const WEAPON_SLOT:WEAPON_SLOT_MELEE = WEAPON_SLOT:1;
120-
const WEAPON_SLOT:WEAPON_SLOT_PISTOL = WEAPON_SLOT:2;
121-
const WEAPON_SLOT:WEAPON_SLOT_SHOTGUN = WEAPON_SLOT:3;
122-
const WEAPON_SLOT:WEAPON_SLOT_MACHINE_GUN = WEAPON_SLOT:4;
123-
const WEAPON_SLOT:WEAPON_SLOT_ASSAULT_RIFLE = WEAPON_SLOT:5;
124-
const WEAPON_SLOT:WEAPON_SLOT_LONG_RIFLE = WEAPON_SLOT:6;
125-
const WEAPON_SLOT:WEAPON_SLOT_ARTILLERY = WEAPON_SLOT:7;
126-
const WEAPON_SLOT:WEAPON_SLOT_EXPLOSIVES = WEAPON_SLOT:8;
127-
const WEAPON_SLOT:WEAPON_SLOT_EQUIPMENT = WEAPON_SLOT:9;
128-
const WEAPON_SLOT:WEAPON_SLOT_GIFT = WEAPON_SLOT:10;
129-
const WEAPON_SLOT:WEAPON_SLOT_GADGET = WEAPON_SLOT:11;
130-
const WEAPON_SLOT:WEAPON_SLOT_DETONATOR = WEAPON_SLOT:12;
131-
132-
const WEAPON_SLOT:MAX_WEAPON_SLOTS = WEAPON_SLOT:13;
117+
#define UNKNOWN_WEAPON_SLOT (WEAPON_SLOT:-1)
118+
#define WEAPON_SLOT_UNARMED (WEAPON_SLOT:0)
119+
#define WEAPON_SLOT_MELEE (WEAPON_SLOT:1)
120+
#define WEAPON_SLOT_PISTOL (WEAPON_SLOT:2)
121+
#define WEAPON_SLOT_SHOTGUN (WEAPON_SLOT:3)
122+
#define WEAPON_SLOT_MACHINE_GUN (WEAPON_SLOT:4)
123+
#define WEAPON_SLOT_ASSAULT_RIFLE (WEAPON_SLOT:5)
124+
#define WEAPON_SLOT_LONG_RIFLE (WEAPON_SLOT:6)
125+
#define WEAPON_SLOT_ARTILLERY (WEAPON_SLOT:7)
126+
#define WEAPON_SLOT_EXPLOSIVES (WEAPON_SLOT:8)
127+
#define WEAPON_SLOT_EQUIPMENT (WEAPON_SLOT:9)
128+
#define WEAPON_SLOT_GIFT (WEAPON_SLOT:10)
129+
#define WEAPON_SLOT_GADGET (WEAPON_SLOT:11)
130+
#define WEAPON_SLOT_DETONATOR (WEAPON_SLOT:12)
131+
132+
#define MAX_WEAPON_SLOTS (WEAPON_SLOT:13)
133133

134134
#define WEAPON_SLOT_UNKNOWN UNKNOWN_WEAPON_SLOT
135135

@@ -140,10 +140,10 @@ const WEAPON_SLOT:MAX_WEAPON_SLOTS = WEAPON_SLOT:13;
140140
*/
141141
#define PLAYER_MARKERS_MODE: __TAG(PLAYER_MARKERS_MODE):
142142

143-
const PLAYER_MARKERS_MODE:UNKNOWN_PLAYER_MARKERS_MODE = PLAYER_MARKERS_MODE:-1;
144-
const PLAYER_MARKERS_MODE:PLAYER_MARKERS_MODE_OFF = PLAYER_MARKERS_MODE:0;
145-
const PLAYER_MARKERS_MODE:PLAYER_MARKERS_MODE_GLOBAL = PLAYER_MARKERS_MODE:1;
146-
const PLAYER_MARKERS_MODE:PLAYER_MARKERS_MODE_STREAMED = PLAYER_MARKERS_MODE:2;
143+
#define UNKNOWN_PLAYER_MARKERS_MODE (PLAYER_MARKERS_MODE:-1)
144+
#define PLAYER_MARKERS_MODE_OFF (PLAYER_MARKERS_MODE:0)
145+
#define PLAYER_MARKERS_MODE_GLOBAL (PLAYER_MARKERS_MODE:1)
146+
#define PLAYER_MARKERS_MODE_STREAMED (PLAYER_MARKERS_MODE:2)
147147

148148
#define PLAYER_MARKERS_MODE_UNKNOWN UNKNOWN_PLAYER_MARKERS_MODE
149149

omp_database.inc

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,29 @@
3030
* <library>omp_database</library>
3131
*/
3232

33-
const SQLITE_OPEN:UNKNOWN_SQLITE_OPEN = SQLITE_OPEN:-1;
34-
const SQLITE_OPEN:SQLITE_OPEN_READONLY = SQLITE_OPEN:0x00000001;
35-
const SQLITE_OPEN:SQLITE_OPEN_READWRITE = SQLITE_OPEN:0x00000002;
36-
const SQLITE_OPEN:SQLITE_OPEN_CREATE = SQLITE_OPEN:0x00000004;
37-
const SQLITE_OPEN:SQLITE_OPEN_DELETEONCLOSE = SQLITE_OPEN:0x00000008; // Requires VFS.
38-
const SQLITE_OPEN:SQLITE_OPEN_EXCLUSIVE = SQLITE_OPEN:0x00000010; // Requires VFS.
39-
const SQLITE_OPEN:SQLITE_OPEN_AUTOPROXY = SQLITE_OPEN:0x00000020; // Requires VFS.
40-
const SQLITE_OPEN:SQLITE_OPEN_URI = SQLITE_OPEN:0x00000040;
41-
const SQLITE_OPEN:SQLITE_OPEN_MEMORY = SQLITE_OPEN:0x00000080;
42-
const SQLITE_OPEN:SQLITE_OPEN_MAIN_DB = SQLITE_OPEN:0x00000100; // Requires VFS.
43-
const SQLITE_OPEN:SQLITE_OPEN_TEMP_DB = SQLITE_OPEN:0x00000200; // Requires VFS.
44-
const SQLITE_OPEN:SQLITE_OPEN_TRANSIENT_DB = SQLITE_OPEN:0x00000400; // Requires VFS.
45-
const SQLITE_OPEN:SQLITE_OPEN_MAIN_JOURNAL = SQLITE_OPEN:0x00000800; // Requires VFS.
46-
const SQLITE_OPEN:SQLITE_OPEN_TEMP_JOURNAL = SQLITE_OPEN:0x00001000; // Requires VFS.
47-
const SQLITE_OPEN:SQLITE_OPEN_SUBJOURNAL = SQLITE_OPEN:0x00002000; // Requires VFS.
48-
const SQLITE_OPEN:SQLITE_OPEN_SUPER_JOURNAL = SQLITE_OPEN:0x00004000; // Requires VFS.
49-
const SQLITE_OPEN:SQLITE_OPEN_NOMUTEX = SQLITE_OPEN:0x00008000;
50-
const SQLITE_OPEN:SQLITE_OPEN_FULLMUTEX = SQLITE_OPEN:0x00010000;
51-
const SQLITE_OPEN:SQLITE_OPEN_SHAREDCACHE = SQLITE_OPEN:0x00020000;
52-
const SQLITE_OPEN:SQLITE_OPEN_PRIVATECACHE = SQLITE_OPEN:0x00040000;
53-
const SQLITE_OPEN:SQLITE_OPEN_WAL = SQLITE_OPEN:0x00080000; // Requires VFS.
54-
const SQLITE_OPEN:SQLITE_OPEN_NOFOLLOW = SQLITE_OPEN:0x01000000;
55-
const SQLITE_OPEN:SQLITE_OPEN_EXRESCODE = SQLITE_OPEN:0x02000000;
33+
#define UNKNOWN_SQLITE_OPEN (SQLITE_OPEN:-1)
34+
#define SQLITE_OPEN_READONLY (SQLITE_OPEN:0x00000001)
35+
#define SQLITE_OPEN_READWRITE (SQLITE_OPEN:0x00000002)
36+
#define SQLITE_OPEN_CREATE (SQLITE_OPEN:0x00000004)
37+
#define SQLITE_OPEN_DELETEONCLOSE (SQLITE_OPEN:0x00000008) // Requires VFS.
38+
#define SQLITE_OPEN_EXCLUSIVE (SQLITE_OPEN:0x00000010) // Requires VFS.
39+
#define SQLITE_OPEN_AUTOPROXY (SQLITE_OPEN:0x00000020) // Requires VFS.
40+
#define SQLITE_OPEN_URI (SQLITE_OPEN:0x00000040)
41+
#define SQLITE_OPEN_MEMORY (SQLITE_OPEN:0x00000080)
42+
#define SQLITE_OPEN_MAIN_DB (SQLITE_OPEN:0x00000100) // Requires VFS.
43+
#define SQLITE_OPEN_TEMP_DB (SQLITE_OPEN:0x00000200) // Requires VFS.
44+
#define SQLITE_OPEN_TRANSIENT_DB (SQLITE_OPEN:0x00000400) // Requires VFS.
45+
#define SQLITE_OPEN_MAIN_JOURNAL (SQLITE_OPEN:0x00000800) // Requires VFS.
46+
#define SQLITE_OPEN_TEMP_JOURNAL (SQLITE_OPEN:0x00001000) // Requires VFS.
47+
#define SQLITE_OPEN_SUBJOURNAL (SQLITE_OPEN:0x00002000) // Requires VFS.
48+
#define SQLITE_OPEN_SUPER_JOURNAL (SQLITE_OPEN:0x00004000) // Requires VFS.
49+
#define SQLITE_OPEN_NOMUTEX (SQLITE_OPEN:0x00008000)
50+
#define SQLITE_OPEN_FULLMUTEX (SQLITE_OPEN:0x00010000)
51+
#define SQLITE_OPEN_SHAREDCACHE (SQLITE_OPEN:0x00020000)
52+
#define SQLITE_OPEN_PRIVATECACHE (SQLITE_OPEN:0x00040000)
53+
#define SQLITE_OPEN_WAL (SQLITE_OPEN:0x00080000) // Requires VFS.
54+
#define SQLITE_OPEN_NOFOLLOW (SQLITE_OPEN:0x01000000)
55+
#define SQLITE_OPEN_EXRESCODE (SQLITE_OPEN:0x02000000)
5656

5757
/*
5858

omp_dialog.inc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ const MAX_DIALOG = 32768;
4545
*/
4646
#define DIALOG_STYLE: __TAG(DIALOG_STYLE):
4747

48-
const DIALOG_STYLE:UNKNOWN_DIALOG_STYLE = DIALOG_STYLE:-1;
49-
const DIALOG_STYLE:DIALOG_STYLE_MSGBOX = DIALOG_STYLE:0;
50-
const DIALOG_STYLE:DIALOG_STYLE_INPUT = DIALOG_STYLE:1;
51-
const DIALOG_STYLE:DIALOG_STYLE_LIST = DIALOG_STYLE:2;
52-
const DIALOG_STYLE:DIALOG_STYLE_PASSWORD = DIALOG_STYLE:3;
53-
const DIALOG_STYLE:DIALOG_STYLE_TABLIST = DIALOG_STYLE:4;
54-
const DIALOG_STYLE:DIALOG_STYLE_TABLIST_HEADERS = DIALOG_STYLE:5;
48+
#define UNKNOWN_DIALOG_STYLE (DIALOG_STYLE:-1)
49+
#define DIALOG_STYLE_MSGBOX (DIALOG_STYLE:0)
50+
#define DIALOG_STYLE_INPUT (DIALOG_STYLE:1)
51+
#define DIALOG_STYLE_LIST (DIALOG_STYLE:2)
52+
#define DIALOG_STYLE_PASSWORD (DIALOG_STYLE:3)
53+
#define DIALOG_STYLE_TABLIST (DIALOG_STYLE:4)
54+
#define DIALOG_STYLE_TABLIST_HEADERS (DIALOG_STYLE:5)
5555

5656
/*
5757

omp_http.inc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
*/
3333
#define HTTP_METHOD: __TAG(HTTP_METHOD):
3434

35-
const HTTP_METHOD:UNKNOWN_HTTP_METHOD = HTTP_METHOD:-1;
36-
const HTTP_METHOD:HTTP_GET = HTTP_METHOD:1;
37-
const HTTP_METHOD:HTTP_POST = HTTP_METHOD:2;
38-
const HTTP_METHOD:HTTP_HEAD = HTTP_METHOD:3;
35+
#define UNKNOWN_HTTP_METHOD (HTTP_METHOD:-1)
36+
#define HTTP_GET (HTTP_METHOD:1)
37+
#define HTTP_POST (HTTP_METHOD:2)
38+
#define HTTP_HEAD (HTTP_METHOD:3)
3939

4040
/// <p/>
4141
/**
@@ -48,13 +48,13 @@ const HTTP_METHOD:HTTP_HEAD = HTTP_METHOD:3;
4848
*/
4949
#define HTTP_ERROR: __TAG(HTTP_ERROR):
5050

51-
const HTTP_ERROR:UNKNOWN_HTTP_ERROR = HTTP_ERROR:-1;
52-
const HTTP_ERROR:HTTP_ERROR_BAD_HOST = HTTP_ERROR:1;
53-
const HTTP_ERROR:HTTP_ERROR_NO_SOCKET = HTTP_ERROR:2;
54-
const HTTP_ERROR:HTTP_ERROR_CANT_CONNECT = HTTP_ERROR:3;
55-
const HTTP_ERROR:HTTP_ERROR_CANT_WRITE = HTTP_ERROR:4;
56-
const HTTP_ERROR:HTTP_ERROR_CONTENT_TOO_BIG = HTTP_ERROR:5;
57-
const HTTP_ERROR:HTTP_ERROR_MALFORMED_RESPONSE = HTTP_ERROR:6;
51+
#define UNKNOWN_HTTP_ERROR (HTTP_ERROR:-1)
52+
#define HTTP_ERROR_BAD_HOST (HTTP_ERROR:1)
53+
#define HTTP_ERROR_NO_SOCKET (HTTP_ERROR:2)
54+
#define HTTP_ERROR_CANT_CONNECT (HTTP_ERROR:3)
55+
#define HTTP_ERROR_CANT_WRITE (HTTP_ERROR:4)
56+
#define HTTP_ERROR_CONTENT_TOO_BIG (HTTP_ERROR:5)
57+
#define HTTP_ERROR_MALFORMED_RESPONSE (HTTP_ERROR:6)
5858

5959
/*
6060

0 commit comments

Comments
 (0)