diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2016-09-30 17:18:16 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2016-10-01 09:00:15 -0400 |
commit | 0879cd66ef3f00918ae26d9bb7ac555d3911c548 (patch) | |
tree | de3a215a52ce2b0a0f5032e95f79ed8a0bc8feb3 /perl.h | |
parent | afabfeb3299724b02541bbc9ebf0aeba14e9be17 (diff) | |
download | perl-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.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |