From 57e36e1a12e5cc6af7942196a3f37c9d280ab767 Mon Sep 17 00:00:00 2001 From: David Goldblatt Date: Mon, 10 Apr 2017 18:25:27 -0700 Subject: [PATCH] Header refactoring: Add CPP_PROLOGUE and CPP_EPILOGUE macros --- include/jemalloc/internal/jemalloc_internal.h.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index 17c77aa3..73c5d3a5 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -2,9 +2,15 @@ #define JEMALLOC_INTERNAL_H #ifdef __cplusplus -extern "C" { +# define CPP_PROLOGUE extern "C" { +# define CPP_EPILOGUE } +#else +# define CPP_PROLOGUE +# define CPP_EPILOGUE #endif +CPP_PROLOGUE + #include "jemalloc_internal_defs.h" #include "jemalloc/internal/jemalloc_internal_decls.h" @@ -1300,8 +1306,6 @@ ixalloc(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t size, size_t extra, #include "jemalloc/internal/prof_inlines_b.h" -#ifdef __cplusplus -} -#endif +CPP_EPILOGUE #endif /* JEMALLOC_INTERNAL_H */