* include/ctype.h (_BLANK): Expand comment.

(isblank): Add prototype and inline definition.
	(iswblank): Add prototype and inline definition.
	* include/wctype.h (iswblank): Add prototype and inline definition.
	* mingwex/isblank.c: New file.
	* mingwex/iswblank.c: New file.
	* mingwex/Makefile.in: Add isblank, iswblank to libmingwex.a
This commit is contained in:
Danny Smith 2006-08-03 07:44:30 +00:00
parent 9e4051d4b7
commit bb1a7afa67
6 changed files with 64 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2006-08-03 Danny Smith <dannysmith@users.sourceforge.net>
* include/ctype.h (_BLANK): Expand comment.
(isblank): Add prototype and inline definition.
(iswblank): Add prototype and inline definition.
* include/wctype.h (iswblank): Add prototype and inline definition.
* mingwex/isblank.c: New file.
* mingwex/iswblank.c: New file.
* mingwex/Makefile.in: Add isblank, iswblank to libmingwex.a
2006-07-06 Danny Smith <dannysmith@users.sourceforge.net>
* include/math.h (__INFF,__INFL): Remove '#'.
@ -30,7 +40,6 @@
* mingwex/feupdateenv.c: Likewise.
* mingwex/fegetround.c: Add comment.
2006-06-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* Include/_mingw.h: Increment version to 3.10.

View File

@ -31,7 +31,9 @@
#define _SPACE 0x0008 /* HT LF VT FF CR SP */
#define _PUNCT 0x0010
#define _CONTROL 0x0020
#define _BLANK 0x0040 /* this is SP only, not SP and HT as in C99 */
/* _BLANK is set for SP and non-ASCII horizontal space chars (eg,
"no-break space", 0xA0, in CP1250) but not for HT. */
#define _BLANK 0x0040
#define _HEX 0x0080
#define _LEADBYTE 0x8000
@ -55,6 +57,11 @@ _CRTIMP int __cdecl isspace(int);
_CRTIMP int __cdecl isupper(int);
_CRTIMP int __cdecl isxdigit(int);
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__
int __cdecl isblank (int);
#endif
#ifndef __STRICT_ANSI__
_CRTIMP int __cdecl _isctype (int, int);
#endif
@ -135,9 +142,9 @@ extern unsigned short** _imp___ctype;
* optimise away the constant condition.
*/
#if ! (defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES) \
|| defined (__STRICT_ANSI__ ))
|| defined (__STRICT_ANSI__))
)
/* use simple lookup if SB locale, else _isctype() */
#define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask))
__CRT_INLINE int __cdecl isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));}
@ -152,6 +159,12 @@ __CRT_INLINE int __cdecl isspace(int c) {return __ISCTYPE(c, _SPACE);}
__CRT_INLINE int __cdecl isupper(int c) {return __ISCTYPE(c, _UPPER);}
__CRT_INLINE int __cdecl isxdigit(int c) {return __ISCTYPE(c, _HEX);}
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__
__CRT_INLINE int __cdecl isblank (int c)
{return (__ISCTYPE(c, _BLANK) || c == '\t');}
#endif
/* these reproduce behaviour of lib underscored versions */
__CRT_INLINE int __cdecl _tolower(int c) {return ( c -'A'+'a');}
__CRT_INLINE int __cdecl _toupper(int c) {return ( c -'a'+'A');}
@ -187,6 +200,12 @@ _CRTIMP int __cdecl iswspace(wint_t);
_CRTIMP int __cdecl iswupper(wint_t);
_CRTIMP int __cdecl iswxdigit(wint_t);
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__
int __cdecl iswblank (wint_t);
#endif
/* Older MS docs uses wchar_t for arg and return type, while newer
online MS docs say arg is wint_t and return is int.
ISO C uses wint_t for both. */
@ -212,6 +231,12 @@ __CRT_INLINE int __cdecl iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
__CRT_INLINE int __cdecl iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
__CRT_INLINE int __cdecl iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
__CRT_INLINE int __cdecl isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__
__CRT_INLINE int __cdecl iswblank (wint_t wc)
{return (iswctype(wc,_BLANK) || wc == L'\t');}
#endif
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
#ifndef __STRICT_ANSI__

View File

@ -79,6 +79,11 @@ _CRTIMP int __cdecl iswspace(wint_t);
_CRTIMP int __cdecl iswupper(wint_t);
_CRTIMP int __cdecl iswxdigit(wint_t);
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__
int __cdecl iswblank (wint_t);
#endif
/* Older MS docs uses wchar_t for arg and return type, while newer
online MS docs say arg is wint_t and return is int.
ISO C uses wint_t for both. */
@ -127,8 +132,14 @@ __CRT_INLINE int __cdecl iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
__CRT_INLINE int __cdecl iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
__CRT_INLINE int __cdecl iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
__CRT_INLINE int __cdecl isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__
__CRT_INLINE int __cdecl iswblank (wint_t wc)
{return (iswctype(wc, _BLANK) || wc == L'\t');}
#endif
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
typedef wchar_t wctrans_t;

View File

@ -36,7 +36,7 @@ DISTFILES = Makefile.in configure configure.in \
wcstoimax.c wcstold.c wcstoumax.c wctrans.c wctype.c \
wdirent.c wmemchr.c wmemcmp.c wmemcpy.c wmemmove.c wmemset.c wtoll.c \
wcrtomb.c wctob.c mbrtowc.c btowc.c mb_wc_common.h \
gettimeofday.c
gettimeofday.c isblank.c iswblank.c
MATH_DISTFILES = \
acosf.c acosl.c asinf.c asinl.c atan2f.c atan2l.c \
atanf.c atanl.c cbrt.c cbrtf.c cbrtl.c ceilf.S ceill.S \
@ -118,6 +118,8 @@ Q8_OBJS = \
strtoimax.o strtoumax.o wcstoimax.o wcstoumax.o \
wmemchr.o wmemcmp.o wmemcpy.o wmemmove.o wmemset.o \
wctrans.o wctype.o wcrtomb.o wctob.o mbrtowc.o btowc.o
CTYPE_OBJS = \
isblank.o iswblank.o
STDLIB_OBJS = \
strtold.o wcstold.o
STDLIB_STUB_OBJS = \
@ -178,7 +180,7 @@ COMPLEX_OBJS = \
csinl.o csinh.o csinhf.o csinhl.o csqrt.o csqrtf.o csqrtl.o \
ctan.o ctanf.o ctanl.o ctanh.o ctanhf.o ctanhl.o
LIB_OBJS = $(Q8_OBJS) $(STDLIB_OBJS) $(STDLIB_STUB_OBJS) \
LIB_OBJS = $(Q8_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDLIB_STUB_OBJS) \
$(STDIO_OBJS) $(MATH_OBJS) $(FENV_OBJS) \
$(POSIX_OBJS) $(REPLACE_OBJS) $(COMPLEX_OBJS)

5
winsup/mingw/mingwex/isblank.c Executable file
View File

@ -0,0 +1,5 @@
#define __NO_CTYPE_LINES
#include <ctype.h>
int _cdecl isblank (int c)
{return (_isctype(c, _BLANK) || c == '\t');}

View File

@ -0,0 +1,5 @@
#define __NO_CTYPE_LINES
#include <wctype.h>
int __cdecl iswblank (wint_t wc)
{return (iswctype(wc, _BLANK) || wc == L'\t');}