From: Keith M. <no...@so...> - 2015-10-23 21:20:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Repository: mingw-org-wsl". The branch, legacy has been updated via 987711554626e4710ad73ce7e44aece511672020 (commit) via 5f6d250bda1c9ccc1f4c95dbd282ab2fe5db39a5 (commit) via 40850b53c41c38792bb6da061d4b6340cbbf6a98 (commit) via e7de835629ae02d5f1b50aa1770e7fe54baa04f2 (commit) from 0a93cd4072e7fff4b857ad7d9910fa1fe55ea791 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sf.net/p/mingw/mingw-org-wsl/ci/987711554626e4710ad73ce7e44aece511672020/ commit 987711554626e4710ad73ce7e44aece511672020 Author: Keith Marshall <kei...@us...> Date: Fri Oct 23 22:18:52 2015 +0100 Make atof() and strtod() conform to ISO-C; fix MinGW-Bug [#2273] diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 043873e..09e6c59 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,28 @@ +2015-10-23 Keith Marshall <kei...@us...> + + Make atof() and strtod() conform to ISO-C; fix MinGW-Bug [#2273] + + * include/_mingw.h (_ISOC99_SOURCE): Ensure this feature test macro is + defined, when implied by any STDC or POSIX version selection, viz. ... + [__STDC_VERSION__ >= 199901L || _POSIX_C_SOURCE >= 200112L]: ...this. + + * include/stdlib.h: Assert copyright; tidy layout. + (_STDLIB_H_): Multiple inclusion guard macro renamed... + (_STDLIB_H): ...to this, preferring no trailing underscore. + [!defined __NO_ISOCEXT]: Delete double negative references; use... + [defined _ISOC99_SOURCE]: ...this feature test instead, when... + (lldiv_t): ...defining this C99 specific aggregate data type, and... + (lldiv, llabs, atoll, strtoll, strtoull, strtof, strtold, wcstof) + (wcstold, _Exit): ...declaring these C99 function prototypes. + (wtoll, lltoa, ulltoa, lltow, ulltow): Mark as deprecated, pending + future removal; not in MSVCRT.DLL, these conform to no known standard. + [__USE_MINGW_ANSI_STDIO] (atof, strtod): Implement inline, using... + (__strtod): ...this libmingwex.a provided function; it handles string + representations of hexadecimal-floats, infinities and NaNs, whereas... + (strtod): ...this MSVCRT.DLL implementation does not. + (__MSVCRT_VERSION__): Prefer symbolic comparison... + [>= __MSVCR80_DLL]: ...for this requirement. + 2015-10-22 Keith Marshall <kei...@us...> Rationalize definition of struct timespec. diff --git a/mingwrt/include/_mingw.h b/mingwrt/include/_mingw.h index 7d3d74e..bd07d92 100644 --- a/mingwrt/include/_mingw.h +++ b/mingwrt/include/_mingw.h @@ -387,15 +387,13 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */ #endif #ifndef _POSIX_C_SOURCE - /* - * Users may define this, either directly or indirectly, to explicitly + /* Users may define this, either directly or indirectly, to explicitly * enable a particular level of visibility for the subset of those POSIX * features which are supported by MinGW; (notice that this offers no * guarantee that any particular POSIX feature will be supported). */ # if defined _XOPEN_SOURCE - /* - * Specifying this is the preferred method for setting _POSIX_C_SOURCE; + /* Specifying this is the preferred method for setting _POSIX_C_SOURCE; * (POSIX defines an explicit relationship to _XOPEN_SOURCE). Note that * any such explicit setting will augment the set of features which are * available to any compilation unit, even if it seeks to be strictly @@ -424,8 +422,7 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */ # define _POSIX_C_SOURCE 200809L # elif defined _POSIX_SOURCE - /* - * Now formally deprecated by POSIX, some old code may specify this; + /* Now formally deprecated by POSIX, some old code may specify this; * it will enable a minimal level of POSIX support, in addition to the * limited feature set enabled for strict ANSI-C conformity. */ @@ -433,6 +430,17 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */ # endif #endif +#ifndef _ISOC99_SOURCE + /* libmingwex.a provides free-standing implementations for many of the + * functions which were introduced in C99; MinGW headers do not expose + * prototypes for these, unless this feature test macro is defined, by + * the user, or implied by other standards... + */ +# if __STDC_VERSION__ >= 199901L || _POSIX_C_SOURCE >= 200112L +# define _ISOC99_SOURCE 1 +# endif +#endif + #if ! defined _MINGW32_EXTENDED_SOURCE && ! defined __STRICT_ANSI__ /* * Enable mingw32 extensions by default, except when __STRICT_ANSI__ diff --git a/mingwrt/include/stdlib.h b/mingwrt/include/stdlib.h index cc705b5..e37f346 100644 --- a/mingwrt/include/stdlib.h +++ b/mingwrt/include/stdlib.h @@ -1,15 +1,37 @@ /* * stdlib.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. * - * Definitions for common types, variables, and functions. + * ANSI/POSIX + Microsoft compatible standard library function prototypes, + * associated macros, and manifest constant definitions. + * + * $Id$ + * + * Written by Rob Savoye <ro...@cy...> + * Copyright (C) 1997-2009, 2011, 2014, 2015, MinGW.org Project. + * + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice, this permission notice, and the following + * disclaimer shall be included in all copies or substantial portions of + * the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER + * DEALINGS IN THE SOFTWARE. * */ - -#ifndef _STDLIB_H_ -#define _STDLIB_H_ +#ifndef _STDLIB_H +#define _STDLIB_H /* All the headers include this file. */ #include <_mingw.h> @@ -22,20 +44,17 @@ #include <stddef.h> #endif /* RC_INVOKED */ -/* - * RAND_MAX is the maximum value that may be returned by rand. +/* RAND_MAX is the maximum value that may be returned by rand. * The minimum is zero. */ #define RAND_MAX 0x7FFF -/* - * These values may be used as exit status codes. +/* These values may be used as exit status codes. */ #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 -/* - * Definitions for path name functions. +/* Definitions for path name functions. * NOTE: All of these values have simply been chosen to be conservatively high. * Remember that with long file names we can no longer depend on * extensions being short. @@ -52,17 +71,14 @@ #define _MAX_FNAME 256 #define _MAX_EXT 256 -#endif /* Not __STRICT_ANSI__ */ - +#endif /* ! __STRICT_ANSI__ */ #ifndef RC_INVOKED _BEGIN_C_DECLS #if !defined (__STRICT_ANSI__) - -/* - * This seems like a convenient place to declare these variables, which +/* This seems like a convenient place to declare these variables, which * give programs using WinMain (or main for that matter) access to main-ish * argc and argv. environ is a pointer to a table of environment variables. * NOTE: Strings in _argv and environ are ANSI strings. @@ -70,7 +86,8 @@ _BEGIN_C_DECLS extern int _argc; extern char** _argv; -/* imports from runtime dll of the above variables */ +/* Imports from the runtime DLL, for the above variables. + */ #ifdef __MSVCRT__ extern int* __cdecl __MINGW_NOTHROW __p___argc(void); @@ -81,7 +98,7 @@ extern wchar_t*** __cdecl __MINGW_NOTHROW __p___wargv(void); #define __argv (*__p___argv()) #define __wargv (*__p___wargv()) -#else /* !MSVCRT */ +#else /* ! __MSVCRT__ */ #ifndef __DECLSPEC_SUPPORTED @@ -90,74 +107,71 @@ extern char*** _imp____argv_dll; #define __argc (*_imp____argc_dll) #define __argv (*_imp____argv_dll) -#else /* __DECLSPEC_SUPPORTED */ +#else /* __DECLSPEC_SUPPORTED */ __MINGW_IMPORT int __argc_dll; __MINGW_IMPORT char** __argv_dll; #define __argc __argc_dll #define __argv __argv_dll -#endif /* __DECLSPEC_SUPPORTED */ +#endif /* __DECLSPEC_SUPPORTED */ + +#endif /* __MSVCRT__ */ +#endif /* __STRICT_ANSI__ */ -#endif /* __MSVCRT */ -#endif /* __STRICT_ANSI__ */ -/* - * Also defined in ctype.h. - */ #ifndef MB_CUR_MAX +/* FIXME: also defined in <ctype.h>; should be factored out. + */ #ifdef __DECLSPEC_SUPPORTED # ifdef __MSVCRT__ # define MB_CUR_MAX __mb_cur_max __MINGW_IMPORT int __mb_cur_max; -# else /* not __MSVCRT */ +# else /* ! __MSVCRT__ */ # define MB_CUR_MAX __mb_cur_max_dll __MINGW_IMPORT int __mb_cur_max_dll; -# endif /* not __MSVCRT */ +# endif /* ! __MSVCRT__ */ -#else /* ! __DECLSPEC_SUPPORTED */ +#else /* ! __DECLSPEC_SUPPORTED */ # ifdef __MSVCRT__ extern int* _imp____mb_cur_max; # define MB_CUR_MAX (*_imp____mb_cur_max) -# else /* not __MSVCRT */ +# else /* ! __MSVCRT__ */ extern int* _imp____mb_cur_max_dll; # define MB_CUR_MAX (*_imp____mb_cur_max_dll) -# endif /* not __MSVCRT */ -#endif /* __DECLSPEC_SUPPORTED */ +# endif /* ! __MSVCRT__ */ +#endif /* __DECLSPEC_SUPPORTED */ #endif /* MB_CUR_MAX */ -/* - * MS likes to declare errno in stdlib.h as well. +/* FIXME: Nominally in <errno.h>, Microsoft likes to declare errno + * in <stdlib.h> as well; we should factor this out. */ - #ifdef _UWIN -#undef errno -extern int errno; +# undef errno + extern int errno; #else - _CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void); -#define errno (*_errno()) + _CRTIMP int __cdecl __MINGW_NOTHROW *_errno(void); +# define errno (*_errno()) #endif - _CRTIMP int* __cdecl __MINGW_NOTHROW __doserrno(void); -#define _doserrno (*__doserrno()) +_CRTIMP int __cdecl __MINGW_NOTHROW *__doserrno(void); +#define _doserrno (*__doserrno()) #if !defined (__STRICT_ANSI__) -/* - * Use environ from the DLL, not as a global. +/* Use environ from the DLL, not as a global. */ - #ifdef __MSVCRT__ extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void); extern _CRTIMP wchar_t *** __cdecl __MINGW_NOTHROW __p__wenviron(void); # define _environ (*__p__environ()) # define _wenviron (*__p__wenviron()) -#else /* ! __MSVCRT__ */ +#else /* ! __MSVCRT__ */ # ifndef __DECLSPEC_SUPPORTED extern char *** _imp___environ_dll; # define _environ (*_imp___environ_dll) -# else /* __DECLSPEC_SUPPORTED */ +# else /* __DECLSPEC_SUPPORTED */ __MINGW_IMPORT char ** _environ_dll; # define _environ _environ_dll -# endif /* __DECLSPEC_SUPPORTED */ -#endif /* ! __MSVCRT__ */ +# endif /* __DECLSPEC_SUPPORTED */ +#endif /* ! __MSVCRT__ */ #define environ _environ @@ -171,32 +185,32 @@ extern int errno; __MINGW_IMPORT int _sys_nerr; # ifndef _UWIN # define sys_nerr _sys_nerr -# endif /* _UWIN */ -#endif /* __DECLSPEC_SUPPORTED */ +# endif /* _UWIN */ +#endif /* __DECLSPEC_SUPPORTED */ -#else /* ! __MSVCRT__ */ +#else /* ! __MSVCRT__ */ /* CRTDLL run time library */ #ifndef __DECLSPEC_SUPPORTED extern int* _imp___sys_nerr_dll; # define sys_nerr (*_imp___sys_nerr_dll) -#else /* __DECLSPEC_SUPPORTED */ +#else /* __DECLSPEC_SUPPORTED */ __MINGW_IMPORT int _sys_nerr_dll; # define sys_nerr _sys_nerr_dll -#endif /* __DECLSPEC_SUPPORTED */ +#endif /* __DECLSPEC_SUPPORTED */ -#endif /* ! __MSVCRT__ */ +#endif /* ! __MSVCRT__ */ #ifndef __DECLSPEC_SUPPORTED extern char*** _imp__sys_errlist; #define sys_errlist (*_imp___sys_errlist) -#else /* __DECLSPEC_SUPPORTED */ +#else /* __DECLSPEC_SUPPORTED */ __MINGW_IMPORT char* _sys_errlist[]; #ifndef _UWIN #define sys_errlist _sys_errlist -#endif /* _UWIN */ -#endif /* __DECLSPEC_SUPPORTED */ +#endif /* _UWIN */ +#endif /* __DECLSPEC_SUPPORTED */ /* * OS version and such constants. @@ -220,10 +234,9 @@ __MINGW_IMPORT unsigned int _osver; __MINGW_IMPORT unsigned int _winver; __MINGW_IMPORT unsigned int _winmajor; __MINGW_IMPORT unsigned int _winminor; -#endif /* __DECLSPEC_SUPPORTED */ +#endif /* __DECLSPEC_SUPPORTED */ -#else -/* Not msvcrtxx.dll, thus crtdll.dll */ +#else /* ! __MSVCRT__; thus CRTDLL */ #ifndef __DECLSPEC_SUPPORTED @@ -237,7 +250,7 @@ extern unsigned int* _imp___winminor_dll; #define _winmajor (*_imp___winmajor_dll) #define _winminor (*_imp___winminor_dll) -#else /* __DECLSPEC_SUPPORTED */ +#else /* __DECLSPEC_SUPPORTED */ __MINGW_IMPORT unsigned int _osver_dll; __MINGW_IMPORT unsigned int _winver_dll; @@ -249,30 +262,32 @@ __MINGW_IMPORT unsigned int _winminor_dll; #define _winmajor _winmajor_dll #define _winminor _winminor_dll -#endif /* __DECLSPEC_SUPPORTED */ - -#endif +#endif /* __DECLSPEC_SUPPORTED */ +#endif /* CRTDLL */ #if defined __MSVCRT__ -/* although the _pgmptr is exported as DATA, - * be safe and use the access function __p__pgmptr() to get it. */ +/* Although _pgmptr is exported as DATA, be safe and use the access + * function __p__pgmptr() to get it. + */ _CRTIMP char** __cdecl __MINGW_NOTHROW __p__pgmptr(void); #define _pgmptr (*__p__pgmptr()) _CRTIMP wchar_t** __cdecl __MINGW_NOTHROW __p__wpgmptr(void); #define _wpgmptr (*__p__wpgmptr()) -#else /* ! __MSVCRT__ */ + +#else /* ! __MSVCRT__; thus CRTDLL */ + # ifndef __DECLSPEC_SUPPORTED extern char** __imp__pgmptr_dll; # define _pgmptr (*_imp___pgmptr_dll) -# else /* __DECLSPEC_SUPPORTED */ + +# else /* __DECLSPEC_SUPPORTED */ __MINGW_IMPORT char* _pgmptr_dll; # define _pgmptr _pgmptr_dll -# endif /* __DECLSPEC_SUPPORTED */ +# endif /* __DECLSPEC_SUPPORTED */ /* no wide version in CRTDLL */ -#endif /* __MSVCRT__ */ +#endif /* CRTDLL */ -/* - * This variable determines the default file mode. +/* This variable determines the default file mode. * TODO: Which flags work? */ #if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME) @@ -286,92 +301,140 @@ extern int* _imp___fmode_dll; #define _fmode (*_imp___fmode_dll) #endif -#else /* __DECLSPEC_SUPPORTED */ +#else /* __DECLSPEC_SUPPORTED */ #ifdef __MSVCRT__ __MINGW_IMPORT int _fmode; -#else /* ! __MSVCRT__ */ +#else /* ! __MSVCRT__ */ __MINGW_IMPORT int _fmode_dll; #define _fmode _fmode_dll -#endif /* ! __MSVCRT__ */ +#endif /* ! __MSVCRT__ */ + +#endif /* __DECLSPEC_SUPPORTED */ -#endif /* __DECLSPEC_SUPPORTED */ +#endif /* ! __STRICT_ANSI__ */ -#endif /* Not __STRICT_ANSI__ */ +_CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char *); +_CRTIMP long __cdecl __MINGW_NOTHROW atol (const char *); + +_CRTIMP double __cdecl __MINGW_NOTHROW strtod (const char *, char **); +_CRTIMP double __cdecl __MINGW_NOTHROW atof (const char *); -_CRTIMP double __cdecl __MINGW_NOTHROW atof (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*); -_CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*); #if !defined (__STRICT_ANSI__) -_CRTIMP double __cdecl __MINGW_NOTHROW _wtof (const wchar_t *); -_CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *); +_CRTIMP double __cdecl __MINGW_NOTHROW _wtof (const wchar_t *); +_CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *); _CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *); #endif -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -double __cdecl __MINGW_NOTHROW __strtod (const char*, char**); + +#if __USE_MINGW_ANSI_STDIO +/* Microsoft's strtod() and atof() implementations, (in MSVCRT.DLL), + * mishandle infinities and NaNs; on the basis that this conditional + * exposes a more ISO-C conforming printf() I/O family implementaion, + * we substitute a similarly more conforming implementation for each + * of this pair of (somewhat related) functions. + * + * Note that we provide neither __JMPSTUB__ nor __LIBIMPL__ external + * equivalents for either of these two inline functions, because they + * would conflict with the runtime DLL implementations; users needing + * an address reference for either must provide an equivalent of the + * inline implementation, as non-inlined within their own code. + */ extern double __cdecl __MINGW_NOTHROW -strtod (const char* __restrict__ __nptr, char** __restrict__ __endptr); -float __cdecl __MINGW_NOTHROW strtof (const char * __restrict__, char ** __restrict__); -long double __cdecl __MINGW_NOTHROW strtold (const char * __restrict__, char ** __restrict__); -#else -_CRTIMP double __cdecl __MINGW_NOTHROW strtod (const char*, char**); -#endif /* __NO_ISOCEXT */ +__strtod (const char *__restrict__, char **__restrict__); + +__CRT_ALIAS double __cdecl __MINGW_NOTHROW +strtod (const char *__restrict__ __nptr, char **__restrict__ __endptr) +{ return __strtod( __nptr, __endptr ); } + +__CRT_ALIAS double __cdecl __MINGW_NOTHROW +atof (const char *__nptr) { return __strtod( __nptr, NULL ); } + +#endif /* __USE_MINGW_ANSI_STDIO */ -_CRTIMP long __cdecl __MINGW_NOTHROW strtol (const char*, char**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int); +#ifdef _ISOC99_SOURCE +/* Irrespective of requested standards conformity, where MSVCRT.DLL + * falls short, ISO-C99 offers this pair of alternative return type + * specific variants of strtod(), which MSVCRT.DLL does not, but we + * do, in libmingwex.a: + */ +float __cdecl __MINGW_NOTHROW strtof +(const char *__restrict__, char **__restrict__); + +long double __cdecl __MINGW_NOTHROW +strtold (const char *__restrict__, char **__restrict__); + +#endif /* _ISOC99_SOURCE */ + +_CRTIMP long __cdecl __MINGW_NOTHROW strtol (const char *, char **, int); +_CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char *, char **, int); #ifndef _WSTDLIB_DEFINED -/* also declared in wchar.h */ -_CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int); -_CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**); -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -float __cdecl __MINGW_NOTHROW wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__); -long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); -#endif /* __NO_ISOCEXT */ +/* FIXME: also declared in <wchar.h>; should be factored out. + */ +_CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t *, wchar_t **, int); +_CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t *, wchar_t **, int); +_CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t *, wchar_t **); + +#ifdef _ISOC99_SOURCE +/* Variants on wcstod(), specified by ISO-C99; once again, MSVCRT.DLL + * doesn't have them, but we offer them in libmingwex.a + */ +float __cdecl __MINGW_NOTHROW wcstof( const wchar_t *__restrict__, wchar_t **__restrict__); +long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t *__restrict__, wchar_t **__restrict__); +#endif /* _ISOC99_SOURCE */ + #ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t); -#endif +_CRTIMP wchar_t __cdecl __MINGW_NOTHROW *_wgetenv (const wchar_t *); +_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv (const wchar_t *); +_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv (const wchar_t *, const wchar_t *, wchar_t *); +_CRTIMP int __cdecl __MINGW_NOTHROW _wsystem (const wchar_t *); + +_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath +(wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *); + +_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath +(const wchar_t *, wchar_t *, wchar_t *, wchar_t *, wchar_t *); + +_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t *, const wchar_t *, size_t); + +#endif /* __MSVCRT__ */ + #define _WSTDLIB_DEFINED -#endif +#endif /* ! _WSTDLIB_DEFINED */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcstombs (char*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wctomb (char*, wchar_t); +_CRTIMP size_t __cdecl __MINGW_NOTHROW wcstombs (char*, const wchar_t*, size_t); +_CRTIMP int __cdecl __MINGW_NOTHROW wctomb (char*, wchar_t); -_CRTIMP int __cdecl __MINGW_NOTHROW mblen (const char*, size_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW mbstowcs (wchar_t*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW mbtowc (wchar_t*, const char*, size_t); +_CRTIMP int __cdecl __MINGW_NOTHROW mblen (const char*, size_t); +_CRTIMP size_t __cdecl __MINGW_NOTHROW mbstowcs (wchar_t*, const char*, size_t); +_CRTIMP int __cdecl __MINGW_NOTHROW mbtowc (wchar_t*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW rand (void); -_CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int); +_CRTIMP int __cdecl __MINGW_NOTHROW rand (void); +_CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int); -_CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC; -_CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC; -_CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t); -_CRTIMP void __cdecl __MINGW_NOTHROW free (void*); -_CRTIMP void __cdecl __MINGW_NOTHROW abort (void) __MINGW_ATTRIB_NORETURN; -_CRTIMP void __cdecl __MINGW_NOTHROW exit (int) __MINGW_ATTRIB_NORETURN; +_CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC; +_CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC; +_CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t); +_CRTIMP void __cdecl __MINGW_NOTHROW free (void*); +_CRTIMP void __cdecl __MINGW_NOTHROW abort (void) __MINGW_ATTRIB_NORETURN; +_CRTIMP void __cdecl __MINGW_NOTHROW exit (int) __MINGW_ATTRIB_NORETURN; -/* Note: This is in startup code, not imported directly from dll */ -int __cdecl __MINGW_NOTHROW atexit (void (*)(void)); +/* Note: this is in startup code, not imported directly from the runtime DLL + */ +int __cdecl __MINGW_NOTHROW atexit (void (*)(void)); -_CRTIMP int __cdecl __MINGW_NOTHROW system (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*); +_CRTIMP int __cdecl __MINGW_NOTHROW system (const char*); +_CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*); -/* bsearch and qsort are also in non-ANSI header search.h */ -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, - int (*)(const void*, const void*)); -_CRTIMP void __cdecl qsort(void*, size_t, size_t, - int (*)(const void*, const void*)); +/* bsearch() and qsort() are also declared in non-ANSI header <search.h> + */ +_CRTIMP void* __cdecl +bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); + +_CRTIMP void __cdecl qsort(void*, size_t, size_t, int (*)(const void*, const void*)); -_CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST; -_CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST; +_CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST; +_CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST; /* * div_t and ldiv_t are structures used to return the results of div and @@ -384,52 +447,50 @@ _CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST; typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; -_CRTIMP div_t __cdecl __MINGW_NOTHROW div (int, int) __MINGW_ATTRIB_CONST; -_CRTIMP ldiv_t __cdecl __MINGW_NOTHROW ldiv (long, long) __MINGW_ATTRIB_CONST; +_CRTIMP div_t __cdecl __MINGW_NOTHROW div (int, int) __MINGW_ATTRIB_CONST; +_CRTIMP ldiv_t __cdecl __MINGW_NOTHROW ldiv (long, long) __MINGW_ATTRIB_CONST; #if !defined (__STRICT_ANSI__) - -/* - * NOTE: Officially the three following functions are obsolete. The Win32 API +/* NOTE: Officially the three following functions are obsolete. The Win32 API * functions SetErrorMode, Beep and Sleep are their replacements. */ -_CRTIMP void __cdecl __MINGW_NOTHROW _beep (unsigned int, unsigned int) __MINGW_ATTRIB_DEPRECATED; +_CRTIMP void __cdecl __MINGW_NOTHROW _beep (unsigned int, unsigned int) __MINGW_ATTRIB_DEPRECATED; /* Not to be confused with _set_error_mode (int). */ -_CRTIMP void __cdecl __MINGW_NOTHROW _seterrormode (int) __MINGW_ATTRIB_DEPRECATED; -_CRTIMP void __cdecl __MINGW_NOTHROW _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED; +_CRTIMP void __cdecl __MINGW_NOTHROW _seterrormode (int) __MINGW_ATTRIB_DEPRECATED; +_CRTIMP void __cdecl __MINGW_NOTHROW _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED; -_CRTIMP void __cdecl __MINGW_NOTHROW _exit (int) __MINGW_ATTRIB_NORETURN; +_CRTIMP void __cdecl __MINGW_NOTHROW _exit (int) __MINGW_ATTRIB_NORETURN; /* _onexit is MS extension. Use atexit for portability. */ /* Note: This is in startup code, not imported directly from dll */ typedef int (* _onexit_t)(void); _onexit_t __cdecl __MINGW_NOTHROW _onexit( _onexit_t ); -_CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*); +_CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*); +_CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*); +_CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*); +_CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*); +_CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _makepath (char*, const char*, const char*, const char*, const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _splitpath (const char*, char*, char*, char*, char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t); +_CRTIMP void __cdecl __MINGW_NOTHROW _makepath (char*, const char*, const char*, const char*, const char*); +_CRTIMP void __cdecl __MINGW_NOTHROW _splitpath (const char*, char*, char*, char*, char*); +_CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW _itoa (int, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ltoa (long, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ultoa(unsigned long, char*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _itow (int, wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int); +_CRTIMP char* __cdecl __MINGW_NOTHROW _itoa (int, char*, int); +_CRTIMP char* __cdecl __MINGW_NOTHROW _ltoa (long, char*, int); +_CRTIMP char* __cdecl __MINGW_NOTHROW _ultoa(unsigned long, char*, int); +_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _itow (int, wchar_t*, int); +_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int); +_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int); #ifdef __MSVCRT__ -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *); -_CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int); +_CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64 (const char *); +_CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa (__int64, char *, int); +_CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa (unsigned __int64, char *, int); +_CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64 (const wchar_t *); +_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow (__int64, wchar_t *, int); +_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow (unsigned __int64, wchar_t *, int); _CRTIMP unsigned int __cdecl __MINGW_NOTHROW (_rotl)(unsigned int, int) __MINGW_ATTRIB_CONST; _CRTIMP unsigned int __cdecl __MINGW_NOTHROW (_rotr)(unsigned int, int) __MINGW_ATTRIB_CONST; @@ -443,7 +504,7 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int); # define _OUT_TO_MSGBOX 2 # define _REPORT_ERRMODE 3 -# if __MSVCRT_VERSION__ >= 0x800 +# if __MSVCRT_VERSION__ >= __MSVCR80_DLL # ifndef _UINTPTR_T_DEFINED # define _UINTPTR_T_DEFINED # ifdef _WIN64 @@ -455,7 +516,8 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int); _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int); -/* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */ +/* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). + */ # define _WRITE_ABORT_MSG 1 # define _CALL_REPORTFAULT 2 @@ -468,8 +530,8 @@ typedef void uintptr_t); _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler); -# endif /* __MSVCRT_VERSION__ >= 0x800 */ -#endif /* __MSVCRT__ */ +# endif /* __MSVCRT_VERSION__ >= __MSVCR80_DLL */ +#endif /* __MSVCRT__ */ #ifndef _NO_OLDNAMES @@ -483,27 +545,30 @@ _CRTIMP char* __cdecl __MINGW_NOTHROW ltoa (long, char*, int); _CRTIMP char* __cdecl __MINGW_NOTHROW ecvt (double, int, int*, int*); _CRTIMP char* __cdecl __MINGW_NOTHROW fcvt (double, int, int*, int*); _CRTIMP char* __cdecl __MINGW_NOTHROW gcvt (double, int, char*); -#endif /* _UWIN */ -#endif /* Not _NO_OLDNAMES */ -#endif /* Not __STRICT_ANSI__ */ +#endif /* ! _UWIN */ +#endif /* ! _NO_OLDNAMES */ +#endif /* ! __STRICT_ANSI__ */ -/* C99 names */ - -#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ - -/* C99 name for _exit */ +#ifdef _ISOC99_SOURCE +/* Further APIs required to support ISO-C99, but missing from MSVCRT.DLL; + * we provide them in libmingwex.a + * + * + * ISO-C99 name for _exit() + */ void __cdecl __MINGW_NOTHROW _Exit(int) __MINGW_ATTRIB_NORETURN; -#if !defined __NO_INLINE__ && !defined __STRICT_ANSI__ + +#ifndef __NO_INLINE__ __CRT_INLINE __JMPSTUB__(( FUNCTION = _Exit, REMAPPED = _exit )) void __cdecl __MINGW_NOTHROW _Exit( int __status ){ _exit (__status); } #endif typedef struct { long long quot, rem; } lldiv_t; +lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST; -lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST; +long long __cdecl __MINGW_NOTHROW llabs (long long); -long long __cdecl __MINGW_NOTHROW llabs(long long); #ifndef __NO_INLINE__ __CRT_INLINE /* No JMPSTUB or LIBIMPL reference here -- we provide a free-standing @@ -513,48 +578,68 @@ long long __cdecl __MINGW_NOTHROW llabs( long long __j ) { return __j >= 0 ? __j : -__j; } #endif -long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int); -unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int); +long long __cdecl __MINGW_NOTHROW +strtoll (const char *__restrict__, char **__restrict, int); -#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ -long long __cdecl __MINGW_NOTHROW atoll (const char *); +unsigned long long __cdecl __MINGW_NOTHROW +strtoull (const char *__restrict__, char **__restrict__, int); -#if !defined (__STRICT_ANSI__) -long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t *); -char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int); -char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int); -wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int); -wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int); - -#ifndef __NO_INLINE__ /* inline support for non-ansi functions */ +#ifdef __MSVCRT__ +/* MSVCRT.DLL does not provide ISO-C99's atoll() function, but it does + * provide an analogue, in _atoi64(); map it accordingly. + */ +long long __cdecl __MINGW_NOTHROW atoll (const char *); +#ifndef __NO_INLINE__ __CRT_INLINE __JMPSTUB__(( FUNCTION = atoll, REMAPPED = _atoi64 )) long long __cdecl __MINGW_NOTHROW atoll (const char * _c){ return _atoi64 (_c); } +#endif + +#endif /* __MSVCRT__ */ +#endif /* _ISOC99_SOURCE */ +#if defined __MSVCRT__ && ! defined __STRICT_ANSI__ +/* Type long long analogues for MSVCRT.DLL specific type long functions; + * none are actually provided by any version of MSVCRT.DLL, with names as + * specified here, but rather as called by the inline functions used to + * implement them, (i.e. the REMAPPED name specified in each__JMPSTUB__ + * function reference respectively). + * + * FIXME: Not one of these is specified by ISO-C99, nor by POSIX, either; + * is there really any justification for us to specify them at all? For + * the time being, declare as deprecated; perhaps remove later? + */ +long long __cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED wtoll (const wchar_t *); +char* __cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED lltoa (long long, char *, int); +char* __cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED ulltoa (unsigned long long , char *, int); +wchar_t* __cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED lltow (long long, wchar_t *, int); +wchar_t* __cdecl __MINGW_NOTHROW __MINGW_ATTRIB_DEPRECATED ulltow (unsigned long long, wchar_t *, int); + +#ifndef __NO_INLINE__ +/* None of these functions would exist at all, without either these inline + * implementations, or their respective __JMPSTUB__ equivalents. + */ __CRT_INLINE __JMPSTUB__(( FUNCTION = lltoa, REMAPPED = _i64toa )) -char* __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i) -{ return _i64toa (_n, _c, _i); } +char* __cdecl __MINGW_NOTHROW lltoa (long long __n, char * __c, int __i) +{ return _i64toa (__n, __c, __i); } __CRT_INLINE __JMPSTUB__(( FUNCTION = ulltoa, REMAPPED = _ui64toa )) -char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i) -{ return _ui64toa (_n, _c, _i); } +char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long __n, char * __c, int __i) +{ return _ui64toa (__n, __c, __i); } __CRT_INLINE __JMPSTUB__(( FUNCTION = wtoll, REMAPPED = _wtoi64 )) -long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w){ return _wtoi64 (_w); } +long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * __w){ return _wtoi64 (__w); } __CRT_INLINE __JMPSTUB__(( FUNCTION = lltow, REMAPPED = _i64tow )) -wchar_t* __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i) -{ return _i64tow (_n, _w, _i); } +wchar_t* __cdecl __MINGW_NOTHROW lltow (long long __n, wchar_t * __w, int __i) +{ return _i64tow (__n, __w, __i); } __CRT_INLINE __JMPSTUB__(( FUNCTION = ulltow, REMAPPED = _ui64tow )) -wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i) -{ return _ui64tow (_n, _w, _i); } - -#endif /* (__NO_INLINE__) */ -#endif /* (__STRICT_ANSI__) */ +wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long __n, wchar_t * __w, int __i) +{ return _ui64tow (__n, __w, __i); } -#endif /* __MSVCRT__ */ -#endif /* !__NO_ISOCEXT */ +#endif /* ! __NO_INLINE__ */ +#endif /* __MSVCRT__ && ! __STRICT_ANSI__ */ /* POSIX/BSD extensions in libmingwex.a; these should be exposed only on * the basis of appropriate POSIX or BSD specific feature tests... @@ -594,9 +679,9 @@ int __cdecl __MINGW_NOTHROW __mingw_mkstemp( int, char * ); * to achieve a similar effect to that of the above POSIX idiom; the * following macros are a MinGW specific extension, to facilite such * use of _O_TEMPORARY, (in addition to the POSIX required attributes), - * when creating the temporary file. Note that they require fcntl.h, - * which stdlib.h should NOT automatically include; we leave the onus - * on the user to explicitly include it, if using _MKSTEMP_SETMODE. + * when creating the temporary file. Note that they require <fcntl.h>, + * which <stdlib.h> should NOT automatically include; we leave it to + * the user to explicitly include it, if using _MKSTEMP_SETMODE. */ #define _MKSTEMP_INVOKE 0 #define _MKSTEMP_DEFAULT _O_CREAT | _O_EXCL | _O_RDWR @@ -610,7 +695,7 @@ __CRT_ALIAS __LIBIMPL__(( FUNCTION = mkstemp )) int __cdecl __MINGW_NOTHROW mkstemp( char *__filename_template ) { return __mingw_mkstemp( _MKSTEMP_INVOKE, __filename_template ); } -#endif /* _POSIX_C_SOURCE >= 200112L (for mkstemp()) */ +#endif /* _POSIX_C_SOURCE >= 200112L (for mkstemp()) */ /* mkdtemp(3) function support: added as adjunct to feature request #2003. * POSIX wants _XOPEN_SOURCE >= 700, (implying _POSIX_C_SOURCE >= 200809L). @@ -624,9 +709,9 @@ __CRT_ALIAS __JMPSTUB__(( FUNCTION = mkdtemp )) char * __cdecl __MINGW_NOTHROW mkdtemp( char *__dirname_template ) { return __mingw_mkdtemp( __dirname_template ); } -#endif /* _POSIX_C_SOURCE >= 200809L (for mkdtemp()) */ +#endif /* _POSIX_C_SOURCE >= 200809L (for mkdtemp()) */ _END_C_DECLS -#endif /* Not RC_INVOKED */ -#endif /* Not _STDLIB_H_ */ +#endif /* ! RC_INVOKED */ +#endif /* ! _STDLIB_H: $RCSfile$: end of file */ https://sf.net/p/mingw/mingw-org-wsl/ci/5f6d250bda1c9ccc1f4c95dbd282ab2fe5db39a5/ commit 5f6d250bda1c9ccc1f4c95dbd282ab2fe5db39a5 Author: Keith Marshall <kei...@us...> Date: Thu Oct 22 22:29:48 2015 +0100 Rationalize definition of struct timespec. diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index e7f5b63..043873e 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,23 @@ +2015-10-22 Keith Marshall <kei...@us...> + + Rationalize definition of struct timespec. + + * include/parts/time.h (struct timespec): Redefine; use __time64_t for + tv_sec field, in place of anonymous union, thus avoiding missing brace + warnings when initializing; leave a copy of the previous definition... + (struct __mingw32_expanded_timespec): ...named thus. + + * include/unistd.h (nanosleep): Adjust inline implementation, to match + altered specification of tv_sec field in struct timespec. + + * include/_mingw.h (_MINGW32_EXTENDED_SOURCE): New feature test macro. + [! defined __STRICT_ANSI__]: Define it, making it a default feature. + + * include/time.h [_MINGW32_EXTENDED_SOURCE] (mingw_timespec): New + convenience function; defined as inline, with __LIBIMPL__ equivalent, + it facilitates interpretation of an instance of struct timespec as if + it were defined as struct __mingw32_expanded_timespec. + 2015-09-14 Keith Marshall <kei...@us...> Make strings.h mostly POSIX.1-2008 compliant. diff --git a/mingwrt/include/_mingw.h b/mingwrt/include/_mingw.h index 154e858..7d3d74e 100644 --- a/mingwrt/include/_mingw.h +++ b/mingwrt/include/_mingw.h @@ -433,4 +433,12 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */ # endif #endif +#if ! defined _MINGW32_EXTENDED_SOURCE && ! defined __STRICT_ANSI__ +/* + * Enable mingw32 extensions by default, except when __STRICT_ANSI__ + * conformity mode has been enabled. + */ +# define _MINGW32_EXTENDED_SOURCE 1 +#endif + #endif /* __MINGW_H: $RCSfile$: end of file */ diff --git a/mingwrt/include/parts/time.h b/mingwrt/include/parts/time.h index 5b94732..7965140 100644 --- a/mingwrt/include/parts/time.h +++ b/mingwrt/include/parts/time.h @@ -104,20 +104,37 @@ */ struct timespec { - /* Period is sum of tv_sec + tv_nsec; use explicitly sized types - * to avoid 32-bit vs. 64-bit time_t ambiguity... + /* Period is sum of tv_sec + tv_nsec; while 32-bits is sufficient + * to accommodate tv_nsec, we use 64-bit __time64_t for tv_sec, to + * ensure that we have a sufficiently large field to accommodate + * Microsoft's ambiguous __time32_t vs. __time64_t representation + * of time_t; we may resolve this ambiguity locally, by casting a + * pointer to a struct timespec to point to an identically sized + * struct __mingw32_timespec, which is defined below. + */ + __time64_t tv_sec; /* seconds; accept 32 or 64 bits */ + __int32 tv_nsec; /* nanoseconds */ +}; + +struct __mingw32_expanded_timespec +{ + /* Equivalent of struct timespec, with disambiguation for the + * 32-bit vs. 64-bit tv_sec field declaration. Period is the + * sum of tv_sec + tv_nsec; we use explicitly sized types to + * avoid 32-bit vs. 64-bit time_t ambiguity... */ union { /* ...within this anonymous union, allowing tv_sec to accommodate * seconds expressed in either of Microsoft's (ambiguously sized) * time_t representations. */ - time_t tv_sec; /* ambiguously 32 or 64 bits */ - __time32_t __tv32_sec; /* unambiguously 32 bits */ __time64_t __tv64_sec; /* unambiguously 64 bits */ + __time32_t __tv32_sec; /* unambiguously 32 bits */ + time_t tv_sec; /* ambiguously 32 or 64 bits */ }; __int32 tv_nsec; /* nanoseconds */ }; + # define __struct_timespec_defined 1 #endif diff --git a/mingwrt/include/time.h b/mingwrt/include/time.h index 6309b1a..bf582ea 100644 --- a/mingwrt/include/time.h +++ b/mingwrt/include/time.h @@ -258,6 +258,20 @@ _CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_ #define _WTIME_DEFINED #endif /* _WTIME_DEFINED */ +#ifdef _MINGW32_EXTENDED_SOURCE +__CRT_ALIAS __LIBIMPL__(( FUNCTION = mingw_timespec )) +/* + * This non-ANSI convenience function facilitates access to entities + * defined as struct timespec, while exposing the broken down form of + * the tv_sec field, as declared within struct __mingw32_timespec. It + * is exposed only when _MINGW32_EXTENDED_SOURCE is defined, which is + * normally implicitly the case, except when in __STRICT_ANSI__ mode + * unless the user defines it explicitly. + */ +struct __mingw32_expanded_timespec *mingw_timespec( struct timespec *__tv ) +{ return (struct __mingw32_expanded_timespec *)(__tv); } +#endif + _END_C_DECLS #endif /* ! RC_INVOKED */ diff --git a/mingwrt/include/unistd.h b/mingwrt/include/unistd.h index 5e8309d..93cca4d 100644 --- a/mingwrt/include/unistd.h +++ b/mingwrt/include/unistd.h @@ -110,8 +110,8 @@ __CRT_INLINE __LIBIMPL__(( FUNCTION = nanosleep )) int nanosleep( const struct timespec *period, struct timespec *residual ) { if( residual != (void *)(0) ) - residual->__tv64_sec = (__time64_t)(residual->tv_nsec = 0); - return __mingw_sleep((unsigned)(period->__tv64_sec), (period->__tv64_sec < 0LL) + residual->tv_sec = (__time64_t)(residual->tv_nsec = 0); + return __mingw_sleep((unsigned)(period->tv_sec), (period->tv_sec < 0LL) ? (unsigned)(-1) : (unsigned)(period->tv_nsec)); } #endif https://sf.net/p/mingw/mingw-org-wsl/ci/40850b53c41c38792bb6da061d4b6340cbbf6a98/ commit 40850b53c41c38792bb6da061d4b6340cbbf6a98 Author: Keith Marshall <kei...@us...> Date: Thu Oct 22 15:17:33 2015 +0100 Windows application module version information API updates. diff --git a/w32api/ChangeLog b/w32api/ChangeLog index 4a8c5e7..8c66d1b 100644 --- a/w32api/ChangeLog +++ b/w32api/ChangeLog @@ -1,5 +1,22 @@ 2015-10-22 Keith Marshall <kei...@us...> + Windows application module version information API updates. + + * include/winver.h: Assert copyright; tidy layout. + (_BEGIN_C_DECLS, _END_C_DECLS): Use these, as appropriate. + (__AW_SUFFIXED__): Use throughout, to identify generic functions + having both ANSI and UTF-16LE specific alternative implementations. + [NTDDI_VERSION >= NTDDI_VISTA] (GetFileVersionInfoEx): New function. + [NTDDI_VERSION >= NTDDI_VISTA] (GetFileVersionInfoSizeEx): Likewise; + note that both are generic, with ANSI and UTF-16LE implementations, + but the ANSI implementations are missing from MSVCRT.DLL when... + [NTDDI_VERSION < NTDDI_WIN8]: ...this. + + * lib/version.def (GetFileVersionInfoExA, GetFileVersionInfoExW) + (GetFileVersionInfoSizeExA, GetFileVersionInfoSizeExW): Add symbols. + +2015-10-22 Keith Marshall <kei...@us...> + Revert a failed experimental macro construct. * include/w32api.h (__W32API_DEPRECATED_ALIAS): Delete this; it bloats diff --git a/w32api/include/winver.h b/w32api/include/winver.h index 9f8c9b7..de446ed 100644 --- a/w32api/include/winver.h +++ b/w32api/include/winver.h @@ -1,133 +1,202 @@ +/* + * winver.h + * + * Declarations supporting the API for retrieval of version informatation + * from a PE-COFF file's associated version resources. + * + * $Id$ + * + * Written by Anders Norlander <ano...@he...> + * Copyright (C) 1998, 1999, 2002, 2006, 2009, 2015, MinGW.org Project + * + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ #ifndef _WINVER_H #define _WINVER_H -#if __GNUC__ >=3 #pragma GCC system_header -#endif -#ifdef __cplusplus -extern "C" { -#endif -#define VS_FILE_INFO RT_VERSION -#define VS_VERSION_INFO 1 -#define VS_USER_DEFINED 100 -#define VS_FFI_SIGNATURE 0xFEEF04BD -#define VS_FFI_STRUCVERSION 0x10000 -#define VS_FFI_FILEFLAGSMASK 0x3F -#define VS_FF_DEBUG 1 -#define VS_FF_PRERELEASE 2 -#define VS_FF_PATCHED 4 -#define VS_FF_PRIVATEBUILD 8 -#define VS_FF_INFOINFERRED 16 -#define VS_FF_SPECIALBUILD 32 -#define VOS_UNKNOWN 0 -#define VOS_DOS 0x10000 -#define VOS_OS216 0x20000 -#define VOS_OS232 0x30000 -#define VOS_NT 0x40000 -#define VOS__BASE 0 -#define VOS__WINDOWS16 1 -#define VOS__PM16 2 -#define VOS__PM32 3 -#define VOS__WINDOWS32 4 -#define VOS_DOS_WINDOWS16 0x10001 -#define VOS_DOS_WINDOWS32 0x10004 -#define VOS_OS216_PM16 0x20002 -#define VOS_OS232_PM32 0x30003 -#define VOS_NT_WINDOWS32 0x40004 -#define VFT_UNKNOWN 0 -#define VFT_APP 1 -#define VFT_DLL 2 -#define VFT_DRV 3 -#define VFT_FONT 4 -#define VFT_VXD 5 -#define VFT_STATIC_LIB 7 -#define VFT2_UNKNOWN 0 -#define VFT2_DRV_PRINTER 1 -#define VFT2_DRV_KEYBOARD 2 -#define VFT2_DRV_LANGUAGE 3 -#define VFT2_DRV_DISPLAY 4 -#define VFT2_DRV_MOUSE 5 -#define VFT2_DRV_NETWORK 6 -#define VFT2_DRV_SYSTEM 7 -#define VFT2_DRV_INSTALLABLE 8 -#define VFT2_DRV_SOUND 9 -#define VFT2_DRV_COMM 10 -#define VFT2_DRV_INPUTMETHOD 11 -#define VFT2_FONT_RASTER 1 -#define VFT2_FONT_VECTOR 2 -#define VFT2_FONT_TRUETYPE 3 -#define VFFF_ISSHAREDFILE 1 -#define VFF_CURNEDEST 1 -#define VFF_FILEINUSE 2 -#define VFF_BUFFTOOSMALL 4 -#define VIFF_FORCEINSTALL 1 -#define VIFF_DONTDELETEOLD 2 -#define VIF_TEMPFILE 1 -#define VIF_MISMATCH 2 -#define VIF_SRCOLD 4 -#define VIF_DIFFLANG 8 -#define VIF_DIFFCODEPG 16 -#define VIF_DIFFTYPE 32 -#define VIF_WRITEPROT 64 -#define VIF_FILEINUSE 128 -#define VIF_OUTOFSPACE 256 -#define VIF_ACCESSVIOLATION 512 -#define VIF_SHARINGVIOLATION 1024 -#define VIF_CANNOTCREATE 2048 -#define VIF_CANNOTDELETE 4096 -#define VIF_CANNOTRENAME 8192 -#define VIF_CANNOTDELETECUR 16384 -#define VIF_OUTOFMEMORY 32768 -#define VIF_CANNOTREADSRC 65536 -#define VIF_CANNOTREADDST 0x20000 -#define VIF_BUFFTOOSMALL 0x40000 +#define VS_FILE_INFO RT_VERSION +#define VS_VERSION_INFO 1 +#define VS_USER_DEFINED 100 +#define VS_FFI_SIGNATURE 0xFEEF04BD +#define VS_FFI_STRUCVERSION 0x10000 +#define VS_FFI_FILEFLAGSMASK 0x3F +#define VS_FF_DEBUG 1 +#define VS_FF_PRERELEASE 2 +#define VS_FF_PATCHED 4 +#define VS_FF_PRIVATEBUILD 8 +#define VS_FF_INFOINFERRED 16 +#define VS_FF_SPECIALBUILD 32 +#define VOS_UNKNOWN 0 +#define VOS_DOS 0x10000 +#define VOS_OS216 0x20000 +#define VOS_OS232 0x30000 +#define VOS_NT 0x40000 +#define VOS__BASE 0 +#define VOS__WINDOWS16 1 +#define VOS__PM16 2 +#define VOS__PM32 3 +#define VOS__WINDOWS32 4 +#define VOS_DOS_WINDOWS16 0x10001 +#define VOS_DOS_WINDOWS32 0x10004 +#define VOS_OS216_PM16 0x20002 +#define VOS_OS232_PM32 0x30003 +#define VOS_NT_WINDOWS32 0x40004 +#define VFT_UNKNOWN 0 +#define VFT_APP 1 +#define VFT_DLL 2 +#define VFT_DRV 3 +#define VFT_FONT 4 +#define VFT_VXD 5 +#define VFT_STATIC_LIB 7 +#define VFT2_UNKNOWN 0 +#define VFT2_DRV_PRINTER 1 +#define VFT2_DRV_KEYBOARD 2 +#define VFT2_DRV_LANGUAGE 3 +#define VFT2_DRV_DISPLAY 4 +#define VFT2_DRV_MOUSE 5 +#define VFT2_DRV_NETWORK 6 +#define VFT2_DRV_SYSTEM 7 +#define VFT2_DRV_INSTALLABLE 8 +#define VFT2_DRV_SOUND 9 +#define VFT2_DRV_COMM 10 +#define VFT2_DRV_INPUTMETHOD 11 +#define VFT2_FONT_RASTER 1 +#define VFT2_FONT_VECTOR 2 +#define VFT2_FONT_TRUETYPE 3 +#define VFFF_ISSHAREDFILE 1 +#define VFF_CURNEDEST 1 +#define VFF_FILEINUSE 2 +#define VFF_BUFFTOOSMALL 4 +#define VIFF_FORCEINSTALL 1 +#define VIFF_DONTDELETEOLD 2 +#define VIF_TEMPFILE 1 +#define VIF_MISMATCH 2 +#define VIF_SRCOLD 4 +#define VIF_DIFFLANG 8 +#define VIF_DIFFCODEPG 16 +#define VIF_DIFFTYPE 32 +#define VIF_WRITEPROT 64 +#define VIF_FILEINUSE 128 +#define VIF_OUTOFSPACE 256 +#define VIF_ACCESSVIOLATION 512 +#define VIF_SHARINGVIOLATION 1024 +#define VIF_CANNOTCREATE 2048 +#define VIF_CANNOTDELETE 4096 +#define VIF_CANNOTRENAME 8192 +#define VIF_CANNOTDELETECUR 16384 +#define VIF_OUTOFMEMORY 32768 +#define VIF_CANNOTREADSRC 65536 +#define VIF_CANNOTREADDST 0x20000 +#define VIF_BUFFTOOSMALL 0x40000 + #ifndef RC_INVOKED -typedef struct tagVS_FIXEDFILEINFO { - DWORD dwSignature; - DWORD dwStrucVersion; - DWORD dwFileVersionMS; - DWORD dwFileVersionLS; - DWORD dwProductVersionMS; - DWORD dwProductVersionLS; - DWORD dwFileFlagsMask; - DWORD dwFileFlags; - DWORD dwFileOS; - DWORD dwFileType; - DWORD dwFileSubtype; - DWORD dwFileDateMS; - DWORD dwFileDateLS; + +_BEGIN_C_DECLS + +typedef +struct tagVS_FIXEDFILEINFO { + DWORD dwSignature; + DWORD dwStrucVersion; + DWORD dwFileVersionMS; + DWORD dwFileVersionLS; + DWORD dwProductVersionMS; + DWORD dwProductVersionLS; + DWORD dwFileFlagsMask; + DWORD dwFileFlags; + DWORD dwFileOS; + DWORD dwFileType; + DWORD dwFileSubtype; + DWORD dwFileDateMS; + DWORD dwFileDateLS; } VS_FIXEDFILEINFO; -DWORD WINAPI VerFindFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,PUINT,LPSTR,PUINT); -DWORD WINAPI VerFindFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT); -DWORD WINAPI VerInstallFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,PUINT); -DWORD WINAPI VerInstallFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT); -DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR,PDWORD); -DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR,PDWORD); -BOOL WINAPI GetFileVersionInfoA(LPCSTR,DWORD,DWORD,PVOID); -BOOL WINAPI GetFileVersionInfoW(LPCWSTR,DWORD,DWORD,PVOID); -DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD); -DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD); -BOOL WINAPI VerQueryValueA(const LPVOID,LPCSTR,LPVOID*,PUINT); -BOOL WINAPI VerQueryValueW(const LPVOID,LPCWSTR,LPVOID*,PUINT); -#ifdef UNICODE -#define VerFindFile VerFindFileW -#define VerQueryValue VerQueryValueW -#define VerInstallFile VerInstallFileW -#define GetFileVersionInfoSize GetFileVersionInfoSizeW -#define GetFileVersionInfo GetFileVersionInfoW -#define VerLanguageName VerLanguageNameW -#define VerQueryValue VerQueryValueW -#else -#define VerQueryValue VerQueryValueA -#define VerFindFile VerFindFileA -#define VerInstallFile VerInstallFileA -#define GetFileVersionInfoSize GetFileVersionInfoSizeA -#define GetFileVersionInfo GetFileVersionInfoA -#define VerLanguageName VerLanguageNameA -#define VerQueryValue VerQueryValueA -#endif -#endif -#ifdef __cplusplus -} + +/* The following functions are each provided with prototype variants + * supporting strings in ANSI or UTF-16LE encodings, distinguised by + * the "A" suffix in the ANSI case, or the "W" suffix for UTF-16LE. + * Each pair is associated with a single generic function name, which + * is mapped to the appropriate prototype by the __AW_SUFFIXED__ macro, + * according to the defined state of the UNICODE macro; representation + * of the generic name becomes the ANSI prototype when UNICODE is NOT + * defined, or the UTF-16LE prototype when UNICODE is defined. + */ +#define VerFindFile __AW_SUFFIXED__( VerFindFile ) +DWORD WINAPI VerFindFileA( DWORD, LPSTR, LPSTR, LPSTR, LPSTR, PUINT, LPSTR, PUINT ); +DWORD WINAPI VerFindFileW( DWORD, LPWSTR, LPWSTR, LPWSTR, LPWSTR, PUINT, LPWSTR, PUINT ); + +#define VerInstallFile __AW_SUFFIXED__( VerInstallFile ) +DWORD WINAPI VerInstallFileA( DWORD, LPSTR, LPSTR, LPSTR, LPSTR, LPSTR, LPSTR, PUINT ); +DWORD WINAPI VerInstallFileW( DWORD, LPWSTR, LPWSTR, LPWSTR, LPWSTR, LPWSTR, LPWSTR, PUINT ); + +#define GetFileVersionInfoSize __AW_SUFFIXED__( GetFileVersionInfoSize ) +DWORD WINAPI GetFileVersionInfoSizeA( LPCSTR, PDWORD ); +DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR, PDWORD ); + +#define GetFileVersionInfo __AW_SUFFIXED__( GetFileVersionInfo ) +BOOL WINAPI GetFileVersionInfoA( LPCSTR, DWORD, DWORD, PVOID ); +BOOL WINAPI GetFileVersionInfoW( LPCWSTR, DWORD, DWORD, PVOID ); + +#if NTDDI_VERSION >= NTDDI_VISTA +/* Windows-Vista added extended variants of the preceding two functions, + * each taking one additional DWORD flags argument, (in first position). + * + * WARNING: Although documented as supported by Windows-Vista and later, + * the ANSI variants of these two functions appear to be unsupported in + * VERSION.DLL, prior to Windows-8. If using these functions, you are + * advised to use a LoadLibrary/GetProcAddress (or dlopen/dlsym) probe, + * to confirm availability of the API entry points within VERSION.DLL + * on the run-time host. + */ +#define GetFileVersionInfoEx __AW_SUFFIXED__( GetFileVersionInfoEx ) +#define GetFileVersionInfoSizeEx __AW_SUFFIXED__( GetFileVersionInfoSizeEx ) +#if NTDDI_VERSION >= NTDDI_WIN8 +DWORD WINAPI GetFileVersionInfoSizeExA( DWORD, LPCSTR, PDWORD ); +BOOL WINAPI GetFileVersionInfoExA( DWORD, LPCSTR, DWORD, DWORD, PVOID ); #endif +DWORD WINAPI GetFileVersionInfoSizeExW( DWORD, LPCWSTR, PDWORD ); +BOOL WINAPI GetFileVersionInfoExW( DWORD, LPCWSTR, DWORD, DWORD, PVOID ); + +/* Values permitted for the flags in each of these functions; these may be + * combined by logically adding them together (using the OR operator). + */ +#define FILE_VER_GET_LOCALISED 0x01 +#define FILE_VER_GET_NEUTRAL 0x02 +/* + * ...and an additional one, for the GetFileVersionInfoEx() function + * only; (must be combined with the value derived from the preceding + * pair, as used in a prior call to GetFileVersionInfoSizeEx()). + */ +#define FILE_VER_GET_PREFETCHED 0x04 #endif + +#define VerLanguageName __AW_SUFFIXED__( VerLanguageName ) +DWORD WINAPI VerLanguageNameA( DWORD, LPSTR, DWORD ); +DWORD WINAPI VerLanguageNameW( DWORD, LPWSTR, DWORD ); + +#define VerQueryValue __AW_SUFFIXED__( VerQueryValue ) +BOOL WINAPI VerQueryValueA( const LPVOID, LPCSTR, LPVOID *, PUINT ); +BOOL WINAPI VerQueryValueW( const LPVOID, LPCWSTR, LPVOID *, PUINT ); + +_END_C_DECLS + +#endif /* ! defined RC_INVOKED */ +#endif /* ! defined _WINVER_H: $RCSfile$: end of file */ diff --git a/w32api/lib/version.def b/w32api/lib/version.def index 01f1324..9406051 100644 --- a/w32api/lib/version.def +++ b/w32api/lib/version.def @@ -1,7 +1,11 @@ LIBRARY "VERSION.dll" EXPORTS GetFileVersionInfoA@16 +GetFileVersionInfoExA@20 +GetFileVersionInfoExW@20 GetFileVersionInfoSizeA@8 +GetFileVersionInfoSizeExA@12 +GetFileVersionInfoSizeExW@12 GetFileVersionInfoSizeW@8 GetFileVersionInfoW@16 VerFindFileA@32 https://sf.net/p/mingw/mingw-org-wsl/ci/e7de835629ae02d5f1b50aa1770e7fe54baa04f2/ commit e7de835629ae02d5f1b50aa1770e7fe54baa04f2 Author: Keith Marshall <kei...@us...> Date: Thu Oct 22 11:13:29 2015 +0100 Revert a failed experimental macro construct. diff --git a/w32api/ChangeLog b/w32api/ChangeLog index 00d2342..4a8c5e7 100644 --- a/w32api/ChangeLog +++ b/w32api/ChangeLog @@ -1,3 +1,15 @@ +2015-10-22 Keith Marshall <kei...@us...> + + Revert a failed experimental macro construct. + + * include/w32api.h (__W32API_DEPRECATED_ALIAS): Delete this; it bloats + code, and doesn't work in the C preprocessor conditional context where + its associated constant definitions are most likely to be required. + (Windows95, Windows98, WindowsME, WindowsNT4, Windows2000, WindowsXP) + (Windows2003, WindowsVista, IE3, IE301, IE302, IE4, IE401, IE5, IE5a) + (IE5b, IE501, IE55, IE56, IE6, IE601, IE602, IE7): Redefine as macros, + now in terms of their preferred equivalents from <sdkddkver.h> + 2015-09-29 Keith Marshall <kei...@us...> Code clean-up; fix MinGW-Bug [#2263]. diff --git a/w32api/include/w32api.h b/w32api/include/w32api.h index 52220da..b9d9564 100644 --- a/w32api/include/w32api.h +++ b/w32api/include/w32api.h @@ -60,56 +60,55 @@ * of required operating system and Internet Explorer version support, when * assigning WINVER, _WIN32_WINDOWS, _WIN32_WINNT, and _WIN32_IE values. * - * Formerly defined as macros, these are now considered deprecated in favour - * of manifest definitions from <sdkddkver.h>; hence, reimplement in terms of - * static long integer constants, and flag as deprecated. - */ -#define __WIN32_DEPRECATED_ALIAS( __type__, __name__, __value__ )\ - static const __type__ __name__ __attribute__((__deprecated__)) = __value__; - -/* _WIN32_WINDOWS and/or WINVER may be set to any of the following manifest + * Each of the following "old name" macros is now considered deprecated in + * favour of manifest "preferred name" macro definitions from <sdkddkver.h>. + * Hence, redefine each in terms of the appropriate "preferred name" macro; + * new code should avoid the old names, and use the preferred name instead. + * + * + * _WIN32_WINDOWS and/or WINVER may be set to any of the following manifest * values, to specify a minimum Win9x support level requirement: * - * Old Name Preferred Name - * ------------- ----------------- + * Old Name Preferred Name + * ------------- ------------------ */ -__WIN32_DEPRECATED_ALIAS( long, Windows95, _WIN32_WINDOWS_95 ) -__WIN32_DEPRECATED_ALIAS( long, Windows98, _WIN32_WINDOWS_98 ) -__WIN32_DEPRECATED_ALIAS( long, WindowsME, _WIN32_WINDOWS_ME ) +#define Windows95 _WIN32_WINDOWS_95 +#define Windows98 _WIN32_WINDOWS_98 +#define WindowsME _WIN32_WINDOWS_ME /* _WIN32_WINNT and/or WINVER may be set to any of the following manifest * values, to specify a minimum WinNT support level requirement: * - * Old Name Preferred Name - * ------------- ----------------- + * Old Name Preferred Name + * ------------- ------------------ */ -__WIN32_DEPRECATED_ALIAS( long, WindowsNT4, _WIN32_WINNT_NT4 ) -__WIN32_DEPRECATED_ALIAS( long, Windows2000, _WIN32_WINNT_WIN... [truncated message content] |