about summary refs log tree commit diff stats
path: root/050scenario.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 /050scenario.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 '050scenario.cc')
-rw-r--r--050scenario.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/050scenario.cc b/050scenario.cc
index deb09e93..8d5f5f62 100644
--- a/050scenario.cc
+++ b/050scenario.cc
@@ -159,6 +159,7 @@ for (int i = 0; i < SIZE(Scenarios); ++i) {
 }
 
 :(before "End Globals")
+// this isn't a constant, just a global of type const*
 const scenario* Current_scenario = NULL;
 :(code)
 void run_mu_scenario(const scenario& s) {