summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-07 22:30:10 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-07 22:30:10 -0700
commit2c903943d95b6af00a4819ac03ec5f010ba91076 (patch)
treed92ac4d464fe4a4d9a179bfba8f0dced5cebc6a5 /lib.h
parentaf996f5191f3385769e2eb58153cc9039d0fcc28 (diff)
downloadtxr-2c903943d95b6af00a4819ac03ec5f010ba91076.tar.gz
txr-2c903943d95b6af00a4819ac03ec5f010ba91076.tar.bz2
txr-2c903943d95b6af00a4819ac03ec5f010ba91076.zip
C++ static forward issue.
* lib.h (static_forward, static_def): New macros for dealing with C++ static forward declaration problem. * syslog.c (syslog_strm_ops): Use static forward macros.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index fd05954f..85f0b6e2 100644
--- a/lib.h
+++ b/lib.h
@@ -954,3 +954,11 @@ loc list_collect_append(loc pptail, val obj);
#define negone num_fast(-1)
#define maxint num_fast(NUM_MAX)
#define minint num_fast(NUM_MIN)
+
+#ifdef __cplusplus
+#define static_forward(decl) namespace { extern decl; }
+#define static_def(def) namespace { def; }
+#else
+#define static_forward(decl) static decl;
+#define static_def(def) static def;
+#endif