OSDN Git Service

Correct conditional compilation block nesting errors.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Sun, 13 Mar 2016 19:30:08 +0000 (19:30 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Sun, 13 Mar 2016 19:30:08 +0000 (19:30 +0000)
mingwrt/ChangeLog
mingwrt/include/stdio.h
mingwrt/include/time.h

index 6ccf81b..c6b1dfc 100644 (file)
@@ -1,3 +1,10 @@
+2016-03-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Correct conditional compilation block nesting errors.
+
+       * include/stdio.h include/time.h (_BEGIN_C_DECLS, _END_C_DECLS): Keep
+       them balanced within, and around, conditional compilation blocks.
+
 2016-03-10  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Feature test _MINGW32_EXTENDED_SOURCE renamed.
index 7f7cb1e..4cdff19 100644 (file)
@@ -241,9 +241,18 @@ __MINGW_IMPORT FILE _iob[];        /* An array of FILE imported from DLL. */
 #define stdout (&_iob[STDOUT_FILENO])
 #define stderr (&_iob[STDERR_FILENO])
 
+/* Need to close the current _STDIO_H specific block here...
+ */
+#endif
+/* ...because, we need this regardless of the inclusion mode...
+ */
 _BEGIN_C_DECLS
 
-/* File Operations
+#ifdef _STDIO_H
+/* ...then revert to _STDIO_H specific mode, to declare...
+ *
+ *
+ * File Operations
  */
 _CRTIMP __cdecl __MINGW_NOTHROW  FILE * fopen (const char *, const char *);
 _CRTIMP __cdecl __MINGW_NOTHROW  FILE * freopen (const char *, const char *, FILE *);
index 63e7c7e..edefff4 100644 (file)
@@ -406,6 +406,9 @@ int nanosleep( const struct timespec *period, struct timespec *residual )
 }
 #endif /* !__NO_INLINE__ */
 #endif /* _POSIX_C_SOURCE */
+
+_END_C_DECLS
+
 #endif /* _TIME_H included in its own right */
 
 #if __need_wchar_decls && ! (defined _TIME_H && defined _WCHAR_H)
@@ -416,6 +419,8 @@ int nanosleep( const struct timespec *period, struct timespec *residual )
  * _wctime() function, are visible only on the first time parse, when
  * one of either _TIME_H, or _WCHAR_H, but not both, is defined.
  */
+_BEGIN_C_DECLS
+
 #if defined __MSVCRT__ && ! defined __STRICT_ANSI__
 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wasctime (const struct tm *);
 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wstrdate (wchar_t *);
@@ -472,10 +477,10 @@ __CRT_ALIAS __cdecl __MINGW_NOTHROW  wchar_t *_wctime (const time_t *__v)
 _CRTIMP __cdecl __MINGW_NOTHROW
 size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *);
 
-#endif /* ! (defined _TIME_H && defined _WCHAR_H) */
-
 _END_C_DECLS
 
+#endif /* ! (defined _TIME_H && defined _WCHAR_H) */
+
 /* We're done with all <time.h> specific content selectors; clear them.
  */
 #undef __need_time_t