summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1994-05-04 23:00:00 +0000
committerLarry Wall <lwall@netlabs.com>1994-05-04 23:00:00 +0000
commit85e6fe838fb25b257a1b363debf8691c0992ef71 (patch)
treefd5340cd6c3bbabfc21d3b0cac48e7ab3a481ebf /handy.h
parent2304df62caa7d9be70e8b8bcdb454e139c9c103d (diff)
downloadperl-85e6fe838fb25b257a1b363debf8691c0992ef71.tar.gz
perl 5.0 alpha 9perl-5a9
[editor's note: the sparc executables have not been included, and emacs backup files have been removed]
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/handy.h b/handy.h
index 102b840dea..a450b4c7b3 100644
--- a/handy.h
+++ b/handy.h
@@ -26,6 +26,7 @@
*
*/
+#if !defined(__STDC__)
#ifdef NULL
#undef NULL
#endif
@@ -34,6 +35,8 @@
#else
# define NULL 0L
#endif
+#endif
+
#define Null(type) ((type)NULL)
#define Nullch Null(char*)
#define Nullfp Null(FILE*)
@@ -54,6 +57,16 @@
#define TRUE (1)
#define FALSE (0)
+#ifdef UNICOS
+#define I8 char
+#define U8 unsigned char
+#define I16 short
+#define U16 unsigned short
+#define I32 int
+#define U32 unsigned int
+
+#else
+
typedef char I8;
typedef unsigned char U8;
@@ -61,13 +74,15 @@ typedef short I16;
typedef unsigned short U16;
#if INTSIZE == 4
-typedef int I32;
-typedef unsigned int U32;
+ typedef int I32;
+ typedef unsigned int U32;
#else
-typedef long I32;
-typedef unsigned long U32;
+ typedef long I32;
+ typedef unsigned long U32;
#endif
+#endif /* UNICOS */
+
#define Ctl(ch) (ch & 037)
#define strNE(s1,s2) (strcmp(s1,s2))
@@ -86,13 +101,13 @@ typedef unsigned long U32;
#endif
#if defined(CTYPE256) || (!defined(isascii) && !defined(HAS_ISASCII))
-#define isALNUM(c) (isalpha(c) || isdigit(c) || c == '_')
-#define isIDFIRST(c) (isalpha(c) || (c) == '_')
-#define isALPHA(c) isalpha(c)
-#define isSPACE(c) isspace(c)
-#define isDIGIT(c) isdigit(c)
-#define isUPPER(c) isupper(c)
-#define isLOWER(c) islower(c)
+#define isALNUM(c) (isalpha((unsigned char)(c)) || isdigit((unsigned char)(c)) || c == '_')
+#define isIDFIRST(c) (isalpha((unsigned char)(c)) || (c) == '_')
+#define isALPHA(c) isalpha((unsigned char)(c))
+#define isSPACE(c) isspace((unsigned char)(c))
+#define isDIGIT(c) isdigit((unsigned char)(c))
+#define isUPPER(c) isupper((unsigned char)(c))
+#define isLOWER(c) islower((unsigned char)(c))
#else
#define isALNUM(c) (isascii(c) && (isalpha(c) || isdigit(c) || c == '_'))
#define isIDFIRST(c) (isascii(c) && (isalpha(c) || (c) == '_'))