OSDN Git Service

Avoid #include_next misbehaviour; cf. MinGW-Bug [#2330]
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 26 Jan 2017 16:14:43 +0000 (16:14 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 26 Jan 2017 16:14:43 +0000 (16:14 +0000)
mingwrt/ChangeLog
mingwrt/include/ctype.h
mingwrt/include/string.h

index aed25b8..b90c04e 100644 (file)
@@ -1,3 +1,14 @@
+2017-01-26  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Avoid #include_next misbehaviour; cf. MinGW-Bug [#2330]
+
+       * include/ctype.h (wctype.h): Use "..." form of #include, rather than
+       the <...> form; we must include our own corresponding mingwrt version
+       of this subsidiary header, and avoid any bogus alternative which may
+       have been insinuated earlier in the system header path.
+
+       * include/string.h (wchar.h): Likewise.
+
 2017-01-25  Jason Hood  <jadoxa@yahoo.com.au>
 
        Correct quoted backslash handling, per bug [#2328].
index 5c4ef43..7ff41a0 100644 (file)
@@ -6,7 +6,7 @@
  * $Id$
  *
  * Written by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
- * Copyright (C) 1997-2008, 2016, MinGW.org Project
+ * Copyright (C) 1997-2008, 2016, 2017, MinGW.org Project
  *
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * properly declared here, this file should also declare elements of the
  * wide classification API, which is properly declared in <wctype.h>
  *
- * To avoid the burden of maintaining duplicate declarations, in two
+ * To avoid the burden of maintaining duplicate declarations in two
  * locations, we keep the wide character declarations where ISO-C and
  * POSIX say they belong, in <wctype.h>, while accommodating Microsoft
  * compatibility by providing for selective inclusion of the relevant
  * elements of it here.  (Note that we must do this early, because to
  * avoid duplication, we delegate the definition of common character
  * classification macros, with the exception of _LEADBYTE, which is
- * not required in both headers, to <wctype.h>).
+ * not required in both headers, to <wctype.h>; we use the quoted
+ * form of inclusion here, to ensure that we get our own "wctype.h",
+ * and not any predecessor which may have been insinuated into the
+ * system include path, and which may interfere with our mechanism
+ * for partial inclusion of shared header content).
  */
 #define __CTYPE_H_SOURCED__
-#include <wctype.h>
+#include "wctype.h"
 
 /* This is the one character classification macro, for which definition
  * is NOT delegated to <wctype.h>
index 720c85a..6cc4f88 100644 (file)
@@ -6,7 +6,7 @@
  * $Id$
  *
  * Written by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
- * Copyright (C) 1997-2000, 2002-2004, 2007, 2009, 2015, 2016,
+ * Copyright (C) 1997-2000, 2002-2004, 2007, 2009, 2015-2017,
  *  MinGW.org Project.
  *
  *
@@ -160,9 +160,13 @@ _CRTIMP __cdecl __MINGW_NOTHROW  void swab (const char *, char *, size_t);
  * scope, will selectively expose the required function prototypes;
  * however, strictly ISO-C conforming applications should include
  * <wchar.h> directly; they should not rely on this MSVC specific
- * anomalous behaviour.
+ * anomalous behaviour.  (We use the quoted form of inclusion here,
+ * to ensure that we get our own "wchar.h", and not any predecessor
+ * which may have been insinuated into the system include path, and
+ * so could interfere with our mechanism for partial inclusion of
+ * shared header content).
  */
-#include <wchar.h>
+#include "wchar.h"
 
 #endif /* ! __STRICT_ANSI__ */