Forráskód Böngészése

PR25118: move system_header pragma before uses of include_next to avoid extension warnings for people finding libc++ headers via -I paths.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@249788 91177308-0d34-0410-b5e6-96231b3b80d8
Richard Smith 10 éve
szülő
commit
45bae0b7dc
9 módosított fájl, 29 hozzáadás és 14 törlés
  1. 6 4
      include/complex.h
  2. 4 3
      include/cstddef
  3. 2 1
      include/ctype.h
  4. 2 1
      include/errno.h
  5. 2 1
      include/float.h
  6. 2 1
      include/inttypes.h
  7. 2 1
      include/math.h
  8. 2 1
      include/setjmp.h
  9. 7 1
      include/stddef.h

+ 6 - 4
include/complex.h

@@ -18,6 +18,12 @@
 
 */
 
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
 #ifdef __cplusplus
 
 #include <ccomplex>
@@ -28,8 +34,4 @@
 
 #endif  // __cplusplus
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
-#endif
-
 #endif  // _LIBCPP_COMPLEX_H

+ 4 - 3
include/cstddef

@@ -34,14 +34,15 @@ Types:
 */
 
 #include <__config>
-// Don't include our own <stddef.h>; we don't want to declare ::nullptr_t.
-#include_next <stddef.h>
-#include <__nullptr>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+// Don't include our own <stddef.h>; we don't want to declare ::nullptr_t.
+#include_next <stddef.h>
+#include <__nullptr>
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 using ::ptrdiff_t;

+ 2 - 1
include/ctype.h

@@ -31,12 +31,13 @@ int toupper(int c);
 */
 
 #include <__config>
-#include_next <ctype.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+#include_next <ctype.h>
+
 #ifdef __cplusplus
 
 #if defined(_LIBCPP_MSVCRT)

+ 2 - 1
include/errno.h

@@ -24,12 +24,13 @@ Macros:
 */
 
 #include <__config>
-#include_next <errno.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+#include_next <errno.h>
+
 #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
 
 #ifdef ELAST

+ 2 - 1
include/float.h

@@ -61,12 +61,13 @@ Macros:
 */
 
 #include <__config>
-#include_next <float.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+#include_next <float.h>
+
 #ifndef FLT_EVAL_METHOD
 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
 #endif

+ 2 - 1
include/inttypes.h

@@ -232,12 +232,13 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
 */
 
 #include <__config>
-#include_next <inttypes.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+#include_next <inttypes.h>
+
 #ifdef __cplusplus
 
 #include <stdint.h>

+ 2 - 1
include/math.h

@@ -293,12 +293,13 @@ long double    truncl(long double x);
 */
 
 #include <__config>
-#include_next <math.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+#include_next <math.h>
+
 #ifdef __cplusplus
 
 // We support including .h headers inside 'extern "C"' contexts, so switch

+ 2 - 1
include/setjmp.h

@@ -27,12 +27,13 @@ void longjmp(jmp_buf env, int val);
 */
 
 #include <__config>
-#include_next <setjmp.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+#include_next <setjmp.h>
+
 #ifndef setjmp
 #define setjmp(env) setjmp(env)
 #endif

+ 7 - 1
include/stddef.h

@@ -10,6 +10,11 @@
 
 #if defined(__need_ptrdiff_t) || defined(__need_size_t) || \
     defined(__need_wchar_t) || defined(__need_NULL) || defined(__need_wint_t)
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
 #include_next <stddef.h>
 
 #elif !defined(_LIBCPP_STDDEF_H)
@@ -33,12 +38,13 @@ Types:
 */
 
 #include <__config>
-#include_next <stddef.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
+#include_next <stddef.h>
+
 #ifdef __cplusplus
 
 extern "C++" {