summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-09-30 17:18:16 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2016-10-01 09:00:15 -0400
commit0879cd66ef3f00918ae26d9bb7ac555d3911c548 (patch)
treede3a215a52ce2b0a0f5032e95f79ed8a0bc8feb3 /perl.h
parentafabfeb3299724b02541bbc9ebf0aeba14e9be17 (diff)
downloadperl-0879cd66ef3f00918ae26d9bb7ac555d3911c548.tar.gz
PL_inf/PL_nan need different export with C++
After the 9ee3aea9, the old way worked with C++ for building the core, but then failed building the POSIX extension. (This change is about building with C++ after the 9ee3aea9, even though that change was about ordering perl.h into a more logical order for vax-netbsd, or for any non-IEEE-754 platform.)
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 628315f833..8444bc047a 100644
--- a/perl.h
+++ b/perl.h
@@ -5719,11 +5719,18 @@ EXTCONST bool PL_valid_types_NV_set[];
/* In C99 we could use designated (named field) union initializers.
* In C89 we need to initialize the member declared first.
+ * In C++ we need extern C initializers.
*
* With the U8_NV version you will want to have inner braces,
* while with the NV_U8 use just the NV. */
+
+#ifdef __cplusplus
+#define INFNAN_U8_NV_DECL EXTERN_C const union { U8 u8[NVSIZE]; NV nv; }
+#define INFNAN_NV_U8_DECL EXTERN_C const union { NV nv; U8 u8[NVSIZE]; }
+#else
#define INFNAN_U8_NV_DECL EXTCONST union { U8 u8[NVSIZE]; NV nv; }
#define INFNAN_NV_U8_DECL EXTCONST union { NV nv; U8 u8[NVSIZE]; }
+#endif
/* if these never got defined, they need defaults */
#ifndef PERL_SET_CONTEXT