* include/_mingw.h (__MINGW_ATTRIB_NONNULL): Don't define as

variadic macro.
	* mingwex/mbrtowc.c (__mbrtowc_cp): Use __MINGW_ATTRIB_NONNULL.
	Remove unused MBTOWC_FLAGS define.
This commit is contained in:
Danny Smith 2005-05-02 08:03:34 +00:00
parent 05726ddd86
commit 38efa5f128
3 changed files with 14 additions and 15 deletions

View File

@ -1,3 +1,10 @@
2005-05-02 Danny Smith <dannysmith@users.sourceforge.net>
* include/_mingw.h (__MINGW_ATTRIB_NONNULL): Don't define as
variadic macro.
* mingwex/mbrtowc.c (__mbrtowc_cp): Use __MINGW_ATTRIB_NONNULL.
Remove unused MBTOWC_FLAGS define.
2005-04-23 Danny Smith <dannysmith@users.sourceforge.net> 2005-04-23 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/mbrtowc.c: New file. * mingwex/mbrtowc.c: New file.

View File

@ -136,11 +136,13 @@
#define __MINGW_ATTRIB_PURE #define __MINGW_ATTRIB_PURE
#endif #endif
/* Attribute `nonnull' was valid as of gcc 3.3. */ /* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's
variadiac macro facility, because variadic macros causes syntax
errors with --traditional-cpp. */
#if (__GNUC__ > 3 ||( __GNUC__ == 3 && __GNUC_MINOR >= 3)) #if (__GNUC__ > 3 ||( __GNUC__ == 3 && __GNUC_MINOR >= 3))
#define __MINGW_ATTRIB_NONNULL(args...) __attribute__ ((__nonnull__ (args))) #define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg)))
#else #else
#define __MINGW_ATTRIB_NONNULL(args...) #define __MINGW_ATTRIB_NONNULL(arg)
#endif /* GNUC >= 3.3 */ #endif /* GNUC >= 3.3 */
#ifndef __MSVCRT_VERSION__ #ifndef __MSVCRT_VERSION__

View File

@ -5,17 +5,7 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define MBTOWC_FLAGS (MB_PRECOMPOSED | MB_ERR_INVALID_CHARS) static int __MINGW_ATTRIB_NONNULL(1) __MINGW_ATTRIB_NONNULL(4)
/* Attribute `nonnull' was valid as of gcc 3.3. */
#ifndef ATTRIBUTE_NONNULL
# if (__GNUC__ > 3 ||( __GNUC__ == 3 && __GNUC_MINOR__ >= 3))
# define ATTRIBUTE_NONNULL(m...) __attribute__ ((__nonnull__ (m)))
# else
# define ATTRIBUTE_NONNULL(m...)
# endif /* GNUC >= 3.3 */
#endif /* ATTRIBUTE_NONNULL */
static int ATTRIBUTE_NONNULL(1, 4)
__mbrtowc_cp (wchar_t * __restrict__ pwc, const char * __restrict__ s, __mbrtowc_cp (wchar_t * __restrict__ pwc, const char * __restrict__ s,
size_t n, mbstate_t* __restrict__ ps, size_t n, mbstate_t* __restrict__ ps,
const unsigned int cp, const unsigned int mb_max) const unsigned int cp, const unsigned int mb_max)