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/test | |
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/test')
-rw-r--r-- | libcxx/test/libcxx/depr/depr.c.headers/math_h.sh.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libcxx/test/libcxx/depr/depr.c.headers/math_h.sh.cpp b/libcxx/test/libcxx/depr/depr.c.headers/math_h.sh.cpp new file mode 100644 index 00000000000..8048865c34b --- /dev/null +++ b/libcxx/test/libcxx/depr/depr.c.headers/math_h.sh.cpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// RUN: %compile -fsyntax-only + +#ifdef _MSC_VER + +#include <math.h> + +#define _USE_MATH_DEFINES +#include <math.h> + +#ifndef M_PI +#error M_PI not defined +#endif + +#endif |