summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorJay Krell <jaykrell@microsoft.com>2018-02-17 21:23:34 -0800
committerIvan Maidanski <ivmai@mail.ru>2018-02-26 08:43:39 +0300
commit514eb96b306964a09b334466c64855b4b5ed618c (patch)
tree649ee653e995ecab7d71265d2bfc48a867e0cad7 /extra
parent72a2ada7f32d4485a7b39f4e22f1aa43ca045584 (diff)
downloadbdwgc-514eb96b306964a09b334466c64855b4b5ed618c.tar.gz
Fiddle with linkage to make extra/gc.c valid C++ code
Issue #206 (bdwgc). Specifically: int i; int i = 0; is not valid, but: extern int i; int i = 0; is valid. Adding static would also be desirable here but requires a larger change. * extra/gc.c (GC_INNER, GC_EXTERN): Do not define if __cplusplus; add comment and TODO item.
Diffstat (limited to 'extra')
-rw-r--r--extra/gc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/extra/gc.c b/extra/gc.c
index ea3648e6..6cfc7d47 100644
--- a/extra/gc.c
+++ b/extra/gc.c
@@ -27,10 +27,13 @@
/* for GC and the client otherwise GC_thread_exit_proc() is not */
/* guaranteed to be invoked (see the comments in pthread_start.c). */
-
-#define GC_INNER STATIC
-#define GC_EXTERN GC_INNER
+#ifndef __cplusplus
+ /* static is desirable here for more efficient linkage. */
+ /* TODO: Enable this in case of the compilation as C++ code. */
+# define GC_INNER STATIC
+# define GC_EXTERN GC_INNER
/* STATIC is defined in gcconfig.h. */
+#endif
/* Small files go first... */
#include "../backgraph.c"