From d31f7e40ed2a40daa61f3579403a8676f31f8803 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Sun, 13 Mar 2016 19:30:08 +0000 Subject: [PATCH 1/1] Correct conditional compilation block nesting errors. --- mingwrt/ChangeLog | 7 +++++++ mingwrt/include/stdio.h | 11 ++++++++++- mingwrt/include/time.h | 9 +++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 6ccf81b..c6b1dfc 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,10 @@ +2016-03-13 Keith Marshall + + 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 Feature test _MINGW32_EXTENDED_SOURCE renamed. diff --git a/mingwrt/include/stdio.h b/mingwrt/include/stdio.h index 7f7cb1e..4cdff19 100644 --- a/mingwrt/include/stdio.h +++ b/mingwrt/include/stdio.h @@ -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 *); diff --git a/mingwrt/include/time.h b/mingwrt/include/time.h index 63e7c7e..edefff4 100644 --- a/mingwrt/include/time.h +++ b/mingwrt/include/time.h @@ -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 specific content selectors; clear them. */ #undef __need_time_t -- 2.11.0