From 867d8d514f7343c07016dd5711f67023f397e0a4 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Wed, 16 Oct 2019 09:42:57 +0100 Subject: [PATCH] Address MinGW-Issue #39677; declare _findclose() only once. --- mingwrt/ChangeLog | 8 ++++++++ mingwrt/include/io.h | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index e397085..2dcced4 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,11 @@ +2019-10-16 Keith Marshall + + Address MinGW-Issue #39677; declare _findclose() only once. + + * include/io.h (_findclose): Relocate declaration within conditional + block, to prevent second exposure when is included in full, + following partial inclusion by + 2019-07-06 Keith Marshall Prepare and publish MinGW.org WSL-5.2.2 release. diff --git a/mingwrt/include/io.h b/mingwrt/include/io.h index 63a265f..9ada662 100644 --- a/mingwrt/include/io.h +++ b/mingwrt/include/io.h @@ -6,7 +6,8 @@ * $Id$ * * Written by Colin Peters - * Copyright (C) 1997-2004, 2007, 2009, 2010, 2014-2016, MinGW.org Project. + * Copyright (C) 1997-2004, 2007, 2009, 2010, 2014-2016, 2019, + * MinGW.org Project. * * * Permission is hereby granted, free of charge, to any person obtaining a @@ -468,21 +469,21 @@ int _wfindnexti64 (intptr_t __handle, struct _wfinddatai64_t *__search) #endif /* __MSVCRT_VERSION__ >= MSVCR80.DLL */ #endif /* >= _WIN2K || >= MSVCR61.DLL */ -#undef __fd_name_t -#endif /* ! (_IO_H && _WCHAR_H) */ - -/* We have no further use for the __struct_finddata_t macro; delete it! - */ -#undef __struct_finddata_t - /* MSDN documents that must be included to get a prototype for * _findclose(), which kind of negates the usefulness of declaring the * wchar_t variants of the file name search API in ; mitigate * this anomaly, by declaring _findclose() such that either or - * will provide it. + * (but only the first to be included) will provide it. */ _CRTIMP __cdecl __MINGW_NOTHROW int _findclose (intptr_t); +#undef __fd_name_t +#endif /* ! (_IO_H && _WCHAR_H) */ + +/* We have no further use for the __struct_finddata_t macro; delete it! + */ +#undef __struct_finddata_t + #ifdef _IO_H /* The following declarations are to be exposed only when is * included directly. -- 2.11.0