[libcxx] r252274 - Cleanup foo.h headers and __config to work in C
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 5 22:30:12 PST 2015
Author: ericwf
Date: Fri Nov 6 00:30:12 2015
New Revision: 252274
URL: http://llvm.org/viewvc/llvm-project?rev=252274&view=rev
Log:
Cleanup foo.h headers and __config to work in C
Modified:
libcxx/trunk/include/__config
libcxx/trunk/include/errno.h
libcxx/trunk/include/float.h
libcxx/trunk/include/inttypes.h
libcxx/trunk/include/setjmp.h
libcxx/trunk/include/stdlib.h
Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=252274&r1=252273&r2=252274&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Nov 6 00:30:12 2015
@@ -11,10 +11,16 @@
#ifndef _LIBCPP_CONFIG
#define _LIBCPP_CONFIG
-#if !defined(_MSC_VER) || defined(__clang__)
+#if defined(_MSC_VER) && !defined(__clang__)
+#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#endif
+
+#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#pragma GCC system_header
#endif
+#ifdef __cplusplus
+
#ifdef __GNUC__
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
#else
@@ -526,7 +532,6 @@ using namespace _LIBCPP_NAMESPACE __attr
#elif defined(_LIBCPP_MSVC)
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#define _LIBCPP_HAS_NO_CONSTEXPR
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
@@ -811,4 +816,6 @@ extern "C" void __sanitizer_annotate_con
#define _LIBCPP_HAS_NO_ATOMIC_HEADER
#endif
+#endif // __cplusplus
+
#endif // _LIBCPP_CONFIG
Modified: libcxx/trunk/include/errno.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/errno.h?rev=252274&r1=252273&r2=252274&view=diff
==============================================================================
--- libcxx/trunk/include/errno.h (original)
+++ libcxx/trunk/include/errno.h Fri Nov 6 00:30:12 2015
@@ -31,6 +31,8 @@ Macros:
#include_next <errno.h>
+#ifdef __cplusplus
+
#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
#ifdef ELAST
@@ -391,4 +393,6 @@ static const int __elast2 = 105;
#define EMLINK 9979
#endif
+#endif // __cplusplus
+
#endif // _LIBCPP_ERRNO_H
Modified: libcxx/trunk/include/float.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/float.h?rev=252274&r1=252273&r2=252274&view=diff
==============================================================================
--- libcxx/trunk/include/float.h (original)
+++ libcxx/trunk/include/float.h Fri Nov 6 00:30:12 2015
@@ -68,6 +68,8 @@ Macros:
#include_next <float.h>
+#ifdef __cplusplus
+
#ifndef FLT_EVAL_METHOD
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
#endif
@@ -76,4 +78,6 @@ Macros:
#define DECIMAL_DIG __DECIMAL_DIG__
#endif
+#endif // __cplusplus
+
#endif // _LIBCPP_FLOAT_H
Modified: libcxx/trunk/include/inttypes.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/inttypes.h?rev=252274&r1=252273&r2=252274&view=diff
==============================================================================
--- libcxx/trunk/include/inttypes.h (original)
+++ libcxx/trunk/include/inttypes.h Fri Nov 6 00:30:12 2015
@@ -246,6 +246,6 @@ uintmax_t wcstoumax(const wchar_t* restr
#undef imaxabs
#undef imaxdiv
-#endif
+#endif // __cplusplus
#endif // _LIBCPP_INTTYPES_H
Modified: libcxx/trunk/include/setjmp.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/setjmp.h?rev=252274&r1=252273&r2=252274&view=diff
==============================================================================
--- libcxx/trunk/include/setjmp.h (original)
+++ libcxx/trunk/include/setjmp.h Fri Nov 6 00:30:12 2015
@@ -34,8 +34,12 @@ void longjmp(jmp_buf env, int val);
#include_next <setjmp.h>
+#ifdef __cplusplus
+
#ifndef setjmp
#define setjmp(env) setjmp(env)
#endif
+#endif // __cplusplus
+
#endif // _LIBCPP_SETJMP_H
Modified: libcxx/trunk/include/stdlib.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/stdlib.h?rev=252274&r1=252273&r2=252274&view=diff
==============================================================================
--- libcxx/trunk/include/stdlib.h (original)
+++ libcxx/trunk/include/stdlib.h Fri Nov 6 00:30:12 2015
@@ -94,6 +94,7 @@ void *aligned_alloc(size_t alignment, si
#include_next <stdlib.h>
#ifdef __cplusplus
+
extern "C++" {
#ifdef _LIBCPP_MSVCRT
@@ -123,6 +124,7 @@ inline _LIBCPP_INLINE_VISIBILITY lldiv_t
#endif // _LIBCPP_MSVCRT / __sun__ / _AIX
} // extern "C++"
+
#endif // __cplusplus
#endif // _LIBCPP_STDLIB_H
More information about the cfe-commits
mailing list