about summary refs log tree commit diff stats
path: root/010vm.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-28 18:12:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-28 18:37:57 -0700
commit5f05e954ee1f1daf953b3ff20af81775f226d5bf (patch)
tree21a691619f0e260e18df4140d4d8381682ecd979 /010vm.cc
parentc7fde8d4e4175b436bc8db92bedd231261827e2c (diff)
downloadmu-5f05e954ee1f1daf953b3ff20af81775f226d5bf.tar.gz
3273
Undo 3272. The trouble with creating a new section for constants is that
there's no good place to order it since constants can be initialized
using globals as well as vice versa. And I don't want to add constraints
disallowing either side.

Instead, a new plan: always declare constants in the Globals section
using 'extern const' rather than just 'const', since otherwise constants
implicitly have internal linkage (http://stackoverflow.com/questions/14894698/why-does-extern-const-int-n-not-work-as-expected)
Diffstat (limited to '010vm.cc')
-rw-r--r--010vm.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/010vm.cc b/010vm.cc
index 1302f198..6728a0a3 100644
--- a/010vm.cc
+++ b/010vm.cc
@@ -412,8 +412,8 @@ string_tree* property(const reagent& r, const string& name) {
   return NULL;
 }
 
-:(before "End Constants")
-const string Ignore(",");  // commas are ignored in mu except within [] strings
+:(before "End Globals")
+extern const string Ignore(",");  // commas are ignored in mu except within [] strings
 :(code)
 void skip_whitespace_but_not_newline(istream& in) {
   while (true) {
h=hlt&id=f39c01128dfc6e46828cbab992d4b9e0ba1cb1e5'>^
1bbbf14f ^


a6517ed8 ^












f75c7021 ^
a6517ed8 ^
87d5bdb9 ^
a6517ed8 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56