This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
g++/x2p (better version)
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 21 Aug 2006 14:48:26 +0000 (17:48 +0300)
committerSteve Peters <steve@fisharerojo.org>
Tue, 22 Aug 2006 01:03:05 +0000 (01:03 +0000)
Message-Id: <200608211148.k7LBmQGL161830@kosh.hut.fi>

p4raw-id: //depot/perl@28742

x2p/EXTERN.h
x2p/INTERN.h
x2p/hash.h

index c82736e..dcc1b24 100644 (file)
@@ -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)
 
index 539e915..471093f 100644 (file)
@@ -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
 
index 9f9c6d5..ee5be5b 100644 (file)
@@ -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;