From 2c903943d95b6af00a4819ac03ec5f010ba91076 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 7 Aug 2015 22:30:10 -0700 Subject: 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. --- lib.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib.h') 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 -- cgit v1.2.3