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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
23
test/libcxx/depr/depr.c.headers/math_h.sh.cpp
Normal file
23
test/libcxx/depr/depr.c.headers/math_h.sh.cpp
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user