Re: [Mingw-w64-public] [PATCH 2/2] corecrt_wstdlib.h: Add new file and move some relevant declaration to it.
W dniu 02.03.2019 o 20:12, Martin Storsjö pisze: > On Sat, 2 Mar 2019, Mateusz wrote: > >> W dniu 28.02.2019 o 18:31, Jacek Caban pisze: >>> diff --git a/mingw-w64-headers/crt/sec_api/wchar_s.h >>> b/mingw-w64-headers/crt/sec_api/wchar_s.h >>> index ef53aaf4..42cee7b9 100644 >>> --- a/mingw-w64-headers/crt/sec_api/wchar_s.h >>> +++ b/mingw-w64-headers/crt/sec_api/wchar_s.h >>> @@ -266,41 +266,7 @@ extern "C" { >>> __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(errno_t,_wtmpnam_s,wchar_t,_DstBuf) >>> #endif /* _WSTDIO_S_DEFINED */ >>> >>> -#ifndef _WSTDLIB_S_DEFINED >>> -#define _WSTDLIB_S_DEFINED >>> - _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t >>> _SizeInWords,int _Radix); >>> - >>> __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_itow_s,int,_Val,wchar_t,_DstBuf,int,_Radix) >>> - >>> - _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t >>> _SizeInWords,int _Radix); >>> - >>> __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ltow_s,long,_Val,wchar_t,_DstBuf,int,_Radix) >>> - >>> - _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t >>> *_DstBuf,size_t _SizeInWords,int _Radix); >>> - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ultow_s,unsigned >>> long,_Val,wchar_t,_DstBuf,int,_Radix) >>> - >>> - _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t >>> *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); >>> - >>> __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_wgetenv_s,size_t*,_ReturnSize,wchar_t,_DstBuf,const >>> wchar_t*,_VarName) >>> - >>> - _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t >>> *_BufferSizeInWords,const wchar_t *_VarName); >>> - _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t >>> _SizeInWords,int _Radix); >>> - _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t >>> *_DstBuf,size_t _SizeInWords,int _Radix); >>> -#endif >>> - >>> #ifndef _POSIX_ >>> -#ifndef _WSTDLIBP_S_DEFINED >>> -#define _WSTDLIBP_S_DEFINED >>> - _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t >>> _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t >>> *_Filename,const wchar_t *_Ext); >>> - >>> __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4(errno_t,_wmakepath_s,wchar_t,_PathResult,const >>> wchar_t*,_Drive,const wchar_t*,_Dir,const wchar_t*,_Filename,const >>> wchar_t*,_Ext) >>> - >>> - _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t >>> *_Value); >>> - >>> - _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const >>> wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); >>> - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0(errno_t,_wsearchenv_s,const >>> wchar_t*,_Filename,const wchar_t*,_EnvVar,wchar_t,_ResultPath) >>> - >>> - _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t >>> *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t >>> _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t >>> *_Ext,size_t _ExtSizeInWords); >>> - >>> __DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(errno_t,_wsplitpath_s,wchar_t,_Dest) >>> - >>> -#endif >>> -#endif >> >> Now it is deleted one too much '#endif' and then Martin deleted '#ifndef >> _POSIX_' in [55cc16]. >> >> Is this change intentional (delete '#ifndef _POSIX_'/'#endif')? > > Well, the intentional change removed all the content of the ifdef, so there's > little point in keeping an empty #ifndef _POSIX_/#endif. Yes, now I see this. Thanks for clarification. Regards, Mateusz ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH 2/2] corecrt_wstdlib.h: Add new file and move some relevant declaration to it.
On Sat, 2 Mar 2019, Mateusz wrote: W dniu 28.02.2019 o 18:31, Jacek Caban pisze: diff --git a/mingw-w64-headers/crt/sec_api/wchar_s.h b/mingw-w64-headers/crt/sec_api/wchar_s.h index ef53aaf4..42cee7b9 100644 --- a/mingw-w64-headers/crt/sec_api/wchar_s.h +++ b/mingw-w64-headers/crt/sec_api/wchar_s.h @@ -266,41 +266,7 @@ extern "C" { __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(errno_t,_wtmpnam_s,wchar_t,_DstBuf) #endif /* _WSTDIO_S_DEFINED */ -#ifndef _WSTDLIB_S_DEFINED -#define _WSTDLIB_S_DEFINED - _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_itow_s,int,_Val,wchar_t,_DstBuf,int,_Radix) - - _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ltow_s,long,_Val,wchar_t,_DstBuf,int,_Radix) - - _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ultow_s,unsigned long,_Val,wchar_t,_DstBuf,int,_Radix) - - _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_wgetenv_s,size_t*,_ReturnSize,wchar_t,_DstBuf,const wchar_t*,_VarName) - - _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); - _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); -#endif - #ifndef _POSIX_ -#ifndef _WSTDLIBP_S_DEFINED -#define _WSTDLIBP_S_DEFINED - _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4(errno_t,_wmakepath_s,wchar_t,_PathResult,const wchar_t*,_Drive,const wchar_t*,_Dir,const wchar_t*,_Filename,const wchar_t*,_Ext) - - _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); - - _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0(errno_t,_wsearchenv_s,const wchar_t*,_Filename,const wchar_t*,_EnvVar,wchar_t,_ResultPath) - - _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(errno_t,_wsplitpath_s,wchar_t,_Dest) - -#endif -#endif Now it is deleted one too much '#endif' and then Martin deleted '#ifndef _POSIX_' in [55cc16]. Is this change intentional (delete '#ifndef _POSIX_'/'#endif')? Well, the intentional change removed all the content of the ifdef, so there's little point in keeping an empty #ifndef _POSIX_/#endif. // Martin ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH 2/2] corecrt_wstdlib.h: Add new file and move some relevant declaration to it.
Hi Mateusz, On 02/03/2019 09:32, Mateusz wrote: W dniu 28.02.2019 o 18:31, Jacek Caban pisze: diff --git a/mingw-w64-headers/crt/sec_api/wchar_s.h b/mingw-w64-headers/crt/sec_api/wchar_s.h index ef53aaf4..42cee7b9 100644 --- a/mingw-w64-headers/crt/sec_api/wchar_s.h +++ b/mingw-w64-headers/crt/sec_api/wchar_s.h @@ -266,41 +266,7 @@ extern "C" { __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(errno_t,_wtmpnam_s,wchar_t,_DstBuf) #endif /* _WSTDIO_S_DEFINED */ -#ifndef _WSTDLIB_S_DEFINED -#define _WSTDLIB_S_DEFINED - _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_itow_s,int,_Val,wchar_t,_DstBuf,int,_Radix) - - _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ltow_s,long,_Val,wchar_t,_DstBuf,int,_Radix) - - _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ultow_s,unsigned long,_Val,wchar_t,_DstBuf,int,_Radix) - - _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_wgetenv_s,size_t*,_ReturnSize,wchar_t,_DstBuf,const wchar_t*,_VarName) - - _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); - _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); - _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); -#endif - #ifndef _POSIX_ -#ifndef _WSTDLIBP_S_DEFINED -#define _WSTDLIBP_S_DEFINED - _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4(errno_t,_wmakepath_s,wchar_t,_PathResult,const wchar_t*,_Drive,const wchar_t*,_Dir,const wchar_t*,_Filename,const wchar_t*,_Ext) - - _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); - - _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0(errno_t,_wsearchenv_s,const wchar_t*,_Filename,const wchar_t*,_EnvVar,wchar_t,_ResultPath) - - _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(errno_t,_wsplitpath_s,wchar_t,_Dest) - -#endif -#endif Now it is deleted one too much '#endif' and then Martin deleted '#ifndef _POSIX_' in [55cc16]. Yeah, I messed it up even more, Martin fixed it already in Git. I'm not sure how I didn't catch it, I probably ran tests against wrong tree. Sorry everyone for the mess and thanks Martin for fixing it. Is this change intentional (delete '#ifndef _POSIX_'/'#endif')? Yes, it doesn't make much sense for _s functions. Those are always Window-specific and have no name collisions with POSIX. Jacek ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH 2/2] corecrt_wstdlib.h: Add new file and move some relevant declaration to it.
W dniu 28.02.2019 o 18:31, Jacek Caban pisze: > diff --git a/mingw-w64-headers/crt/sec_api/wchar_s.h > b/mingw-w64-headers/crt/sec_api/wchar_s.h > index ef53aaf4..42cee7b9 100644 > --- a/mingw-w64-headers/crt/sec_api/wchar_s.h > +++ b/mingw-w64-headers/crt/sec_api/wchar_s.h > @@ -266,41 +266,7 @@ extern "C" { >__DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(errno_t,_wtmpnam_s,wchar_t,_DstBuf) > #endif /* _WSTDIO_S_DEFINED */ > > -#ifndef _WSTDLIB_S_DEFINED > -#define _WSTDLIB_S_DEFINED > - _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t > _SizeInWords,int _Radix); > - > __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_itow_s,int,_Val,wchar_t,_DstBuf,int,_Radix) > - > - _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t > _SizeInWords,int _Radix); > - > __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ltow_s,long,_Val,wchar_t,_DstBuf,int,_Radix) > - > - _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t > *_DstBuf,size_t _SizeInWords,int _Radix); > - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_ultow_s,unsigned > long,_Val,wchar_t,_DstBuf,int,_Radix) > - > - _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t > *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); > - > __DEFINE_CPP_OVERLOAD_SECURE_FUNC_1_1(errno_t,_wgetenv_s,size_t*,_ReturnSize,wchar_t,_DstBuf,const > wchar_t*,_VarName) > - > - _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t > *_BufferSizeInWords,const wchar_t *_VarName); > - _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t > _SizeInWords,int _Radix); > - _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t > *_DstBuf,size_t _SizeInWords,int _Radix); > -#endif > - > #ifndef _POSIX_ > -#ifndef _WSTDLIBP_S_DEFINED > -#define _WSTDLIBP_S_DEFINED > - _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t > _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t > *_Filename,const wchar_t *_Ext); > - > __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_4(errno_t,_wmakepath_s,wchar_t,_PathResult,const > wchar_t*,_Drive,const wchar_t*,_Dir,const wchar_t*,_Filename,const > wchar_t*,_Ext) > - > - _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t > *_Value); > - > - _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const > wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); > - __DEFINE_CPP_OVERLOAD_SECURE_FUNC_2_0(errno_t,_wsearchenv_s,const > wchar_t*,_Filename,const wchar_t*,_EnvVar,wchar_t,_ResultPath) > - > - _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t > *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t > *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); > - > __DEFINE_CPP_OVERLOAD_SECURE_FUNC_SPLITPATH(errno_t,_wsplitpath_s,wchar_t,_Dest) > - > -#endif > -#endif Now it is deleted one too much '#endif' and then Martin deleted '#ifndef _POSIX_' in [55cc16]. Is this change intentional (delete '#ifndef _POSIX_'/'#endif')? Regards, Mateusz ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH 2/2] corecrt_wstdlib.h: Add new file and move some relevant declaration to it.
On Thu, 28 Feb 2019, Jacek Caban wrote: Signed-off-by: Jacek Caban --- mingw-w64-headers/crt/corecrt_wstdlib.h | 39 mingw-w64-headers/crt/sec_api/stdlib_s.h | 22 - mingw-w64-headers/crt/sec_api/wchar_s.h | 34 - mingw-w64-headers/crt/stdlib.h | 3 +- mingw-w64-headers/crt/wchar.h| 3 +- 5 files changed, 43 insertions(+), 58 deletions(-) create mode 100644 mingw-w64-headers/crt/corecrt_wstdlib.h Both patches sound sensible to me. // Martin ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public