From: Florian Weimer Date: Sat, 22 Oct 2016 15:33:26 +0000 (+0200) Subject: math.h: Wrap C++ bits in extern "C++" X-Git-Tag: glibc-2.25~393 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e37208ce86916af9510ffb9ce7b3c187986f07de;p=thirdparty%2Fglibc.git math.h: Wrap C++ bits in extern "C++" It is still common to include system header files in an extern "C" block. This means that exiting 's own extern "C" block is not sufficient to get back to C++ mode. Use an extern "C++" wrapper instead. --- diff --git a/ChangeLog b/ChangeLog index e41c3e73307..2520c443713 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-10-22 Florian Weimer + + * math/math.h [__cplusplus] (iszero): Wrap C++ bits in extern + "C++", to override a potential extern "C" directive around the + header file inclusion. + 2016-10-21 Joseph Myers * benchtests/Makefile (CFLAGS-bench-sqrt.c): New variable. diff --git a/math/math.h b/math/math.h index 0220d08d8a7..7c0c7095239 100644 --- a/math/math.h +++ b/math/math.h @@ -342,7 +342,7 @@ enum # define iszero(x) (((__typeof (x)) (x)) == 0) # endif # else /* __cplusplus */ -__END_DECLS +extern "C++" { template inline bool iszero (__T __val) { @@ -352,7 +352,7 @@ iszero (__T __val) return __val == 0; # endif } -__BEGIN_DECLS +} /* extern C++ */ # endif /* __cplusplus */ #endif /* Use IEC_60559_BFP_EXT. */