Random fixes

This commit is contained in:
Alexander S. Aganichev
2002-10-05 21:13:23 +00:00
parent 2b647df906
commit 293685cd8e
6 changed files with 29 additions and 21 deletions

View File

@@ -45,7 +45,6 @@
#include <sys/nls.h>
#define tolower(c) _nls_tolower((unsigned char)(c))
#define toupper(c) _nls_toupper((unsigned char)(c))
#endif
#elif defined(__WIN32__)
#ifdef __cplusplus
extern "C" {
@@ -55,19 +54,20 @@ __inline__ int toupper(int c) { return tu[c]; }
}
#else
extern char tl[256], tu[256];
#define tolower(c) tl[(int)(unsigned char)c]
#define toupper(c) tu[(int)(unsigned char)c]
#define tolower(c) tl[(int)(unsigned char)(c)]
#define toupper(c) tu[(int)(unsigned char)(c)]
#endif
#endif
// ------------------------------------------------------------------
// NLS chars detected by converting to lower or upper case and in case they don't match they treated as characters
#ifdef __cplusplus
extern "C" {
#endif
// NLS chars detected by converting to lower or upper case and in case they don't match they treated as characters
__inline__ int isxalnum(char c) { return isascii(c) ? isalnum(c) : (c != tolower(c)) || (c != toupper(c)); }
extern __inline__ int isxalnum(char c) { return isascii(c) ? isalnum(c) : (c != tolower(c)) || (c != toupper(c)); }
#ifdef __cplusplus
}
#endif