diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2018-01-26 01:19:23 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-01-26 01:19:23 +0000 |
| commit | 0aa71a4f86b933e728b9bc02c409e4b21f671502 (patch) | |
| tree | 095a29239281dcc6636cffa08ea4adefd8b7b03c /libcxx/include | |
| parent | c0e9bee781e8eb150f954a36c8cd3c77abb26509 (diff) | |
| download | bcm5719-llvm-0aa71a4f86b933e728b9bc02c409e4b21f671502.tar.gz bcm5719-llvm-0aa71a4f86b933e728b9bc02c409e4b21f671502.zip | |
libcxx: Move #include_next <math.h> out of header guard in wrapper header.
Code on Windows expects to be able to do:
#define _USE_MATH_DEFINES
#include <math.h>
and receive the definitions of mathematical constants, even if <math.h>
has previously been included. To support this scenario, re-include
<math.h> every time the wrapper header is included.
Differential Revision: https://reviews.llvm.org/D42403
llvm-svn: 323490
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/math.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libcxx/include/math.h b/libcxx/include/math.h index 8c30ba85d22..1476772351c 100644 --- a/libcxx/include/math.h +++ b/libcxx/include/math.h @@ -8,6 +8,16 @@ // //===----------------------------------------------------------------------===// +// This include lives outside the header guard in order to support an MSVC +// extension which allows users to do: +// +// #define _USE_MATH_DEFINES +// #include <math.h> +// +// and receive the definitions of mathematical constants, even if <math.h> +// has previously been included. +#include_next <math.h> + #ifndef _LIBCPP_MATH_H #define _LIBCPP_MATH_H @@ -298,8 +308,6 @@ long double truncl(long double x); #pragma GCC system_header #endif -#include_next <math.h> - #ifdef __cplusplus // We support including .h headers inside 'extern "C"' contexts, so switch |

