diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-03-31 09:42:58 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-03-31 09:42:58 +0000 |
commit | a33fa76fed558949f2fcf5219b7bee714f36899e (patch) | |
tree | 59f899896746b92a25a389cf133b07bf54182b22 /winsup/cygwin/include | |
parent | 4bc42c05aa0921f57e401985458ef8e584fa8777 (diff) | |
download | cygnal-a33fa76fed558949f2fcf5219b7bee714f36899e.tar.gz cygnal-a33fa76fed558949f2fcf5219b7bee714f36899e.tar.bz2 cygnal-a33fa76fed558949f2fcf5219b7bee714f36899e.zip |
* ctype.cc: Remove implementation of ctype functions in favor of
pointer-based newlib implementation.
(_ctype_b): Declare.
(__ctype_cp): Move to newlib. Declare.
(__ctype_iso): Ditto.
(__set_ctype): Implement changing __ctype_ptr__. Only copy character
class data in applications built under older Cygwin.
* cygwin.din (__ctype_ptr__): Export.
* include/ctype.h: Remove in favor of newlib implementation.
* include/cygwin/config.h (__EXPORT): Define alongside __IMPORT.
* include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE):
Define check for old vs. new ctype implementation.
Bump API minor number.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r-- | winsup/cygwin/include/ctype.h | 73 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/config.h | 4 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 6 |
3 files changed, 8 insertions, 75 deletions
diff --git a/winsup/cygwin/include/ctype.h b/winsup/cygwin/include/ctype.h deleted file mode 100644 index f3341822b..000000000 --- a/winsup/cygwin/include/ctype.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef _CTYPE_H_ -#define _CTYPE_H_ - -#include <_ansi.h> - -#ifdef __cplusplus -extern "C" { -#endif - -int __cdecl isalnum(int); -int __cdecl isalpha(int); -int __cdecl iscntrl(int); -int __cdecl isdigit(int); -int __cdecl isgraph(int); -int __cdecl islower(int); -int __cdecl isprint(int); -int __cdecl ispunct(int); -int __cdecl isspace(int); -int __cdecl isupper(int); -int __cdecl isxdigit(int); -int __cdecl tolower(int); -int __cdecl toupper(int); - -#ifndef __STRICT_ANSI__ -int __cdecl isblank(int); -int __cdecl isascii(int); -int __cdecl toascii(int); -int __cdecl _tolower(int); -int __cdecl _toupper(int); -#endif - -#define _U 01 -#define _L 02 -#define _N 04 -#define _S 010 -#define _P 020 -#define _C 040 -#define _X 0100 -#define _B 0200 - -#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB) -extern const char _ctype_[]; -#ifdef _COMPILING_NEWLIB -extern const char *__ctype_ptr__; -#endif -#else -extern const __declspec(dllimport) char _ctype_[]; -#endif - -#if !defined(__cplusplus) || defined(__INSIDE_CYGWIN__) -#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L)) -#define isblank(c) ((_ctype_+1)[(unsigned)(c)]&_B) -#define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U) -#define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L) -#define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N) -#define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N)) -#define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S) -#define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P) -#define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N)) -#define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) -#define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N)) -#define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C) -#endif /* !__cplusplus */ - -#if !defined(__STRICT_ANSI__) || defined(__INSIDE_CYGWIN__) -#define isascii(c) ((unsigned)(c)<=0177) -#define toascii(c) ((c)&0177) -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _CTYPE_H_ */ diff --git a/winsup/cygwin/include/cygwin/config.h b/winsup/cygwin/include/cygwin/config.h index f887bac15..da82c1dec 100644 --- a/winsup/cygwin/include/cygwin/config.h +++ b/winsup/cygwin/include/cygwin/config.h @@ -4,7 +4,7 @@ sys/config.h before. This way we can manaage our configuration setting without bothering newlib. - Copyright 2003 Red Hat, Inc. + Copyright 2003, 2007, 2008, 2009 Red Hat, Inc. Written by C. Vinschen. This file is part of Cygwin. @@ -56,8 +56,10 @@ extern char *_tlsbase __asm__ ("%fs:4"); #define __USE_INTERNAL_STAT64 1 #endif #if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) +#define __EXPORT __declspec(dllexport) #define __IMPORT #else +#define __EXPORT #define __IMPORT __declspec(dllimport) #endif diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index d2c527c2d..251010c97 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -95,6 +95,9 @@ details. */ #define CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ \ (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 161) +#define CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE \ + (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 209) + /* API_MAJOR 0.0: Initial version. API_MINOR changes: 1: Export cygwin32_ calls as cygwin_ as well. 2: Export j1, jn, y1, yn. @@ -358,12 +361,13 @@ details. */ 207: Export wcsdup. 208: Export log2, log2f. 209: Export wordexp, wordfree. + 210: New ctype layout using variable ctype pointer. Export __ctype_ptr__. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 209 +#define CYGWIN_VERSION_API_MINOR 210 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible |