This revision was automatically updated to reflect the committed changes. Closed by commit rL325760: [libcxx] Do not include the C math.h header before __config (authored by miyuki, committed by ). Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D43579?vs=135264&id=135376#toc Repository: rL LLVM https://reviews.llvm.org/D43579 Files: libcxx/trunk/include/math.h Index: libcxx/trunk/include/math.h =================================================================== --- libcxx/trunk/include/math.h +++ libcxx/trunk/include/math.h @@ -8,16 +8,6 @@ // //===----------------------------------------------------------------------===// -// 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 @@ -308,6 +298,8 @@ #pragma GCC system_header #endif +#include_next <math.h> + #ifdef __cplusplus // We support including .h headers inside 'extern "C"' contexts, so switch @@ -1494,4 +1486,18 @@ #endif // __cplusplus +#else // _LIBCPP_MATH_H + +// 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. +#if defined(_LIBCPP_MSVCRT) && defined(_USE_MATH_DEFINES) +#include_next <math.h> +#endif + #endif // _LIBCPP_MATH_H
Index: libcxx/trunk/include/math.h =================================================================== --- libcxx/trunk/include/math.h +++ libcxx/trunk/include/math.h @@ -8,16 +8,6 @@ // //===----------------------------------------------------------------------===// -// 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 @@ -308,6 +298,8 @@ #pragma GCC system_header #endif +#include_next <math.h> + #ifdef __cplusplus // We support including .h headers inside 'extern "C"' contexts, so switch @@ -1494,4 +1486,18 @@ #endif // __cplusplus +#else // _LIBCPP_MATH_H + +// 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. +#if defined(_LIBCPP_MSVCRT) && defined(_USE_MATH_DEFINES) +#include_next <math.h> +#endif + #endif // _LIBCPP_MATH_H
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits