summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--x2p/EXTERN.h6
-rw-r--r--x2p/INTERN.h6
-rw-r--r--x2p/hash.h4
3 files changed, 14 insertions, 2 deletions
diff --git a/x2p/EXTERN.h b/x2p/EXTERN.h
index c82736e5fc..dcc1b24395 100644
--- a/x2p/EXTERN.h
+++ b/x2p/EXTERN.h
@@ -9,6 +9,12 @@
#undef EXT
#define EXT extern
+#ifdef __cplusplus
+# define EXTERN_C extern "C"
+#else
+# define EXTERN_C extern
+#endif
+
#undef INIT
#define INIT(x)
diff --git a/x2p/INTERN.h b/x2p/INTERN.h
index 539e915069..471093fd6e 100644
--- a/x2p/INTERN.h
+++ b/x2p/INTERN.h
@@ -9,6 +9,12 @@
#undef EXT
#define EXT
+#ifdef __cplusplus
+# define EXTERN_C extern "C"
+#else
+# define EXTERN_C
+#endif
+
#undef INIT
#define INIT(x) = x
diff --git a/x2p/hash.h b/x2p/hash.h
index 9f9c6d5ff9..ee5be5bab1 100644
--- a/x2p/hash.h
+++ b/x2p/hash.h
@@ -10,7 +10,7 @@
#define FILLPCT 60 /* don't make greater than 99 */
#ifdef DOINIT
-char const coeff[] = {
+EXTERN_C char const coeff[] = {
61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
@@ -20,7 +20,7 @@ char const coeff[] = {
61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1};
#else
-extern const char coeff[];
+EXTERN_C const char coeff[];
#endif
typedef struct hentry HENT;