aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-10-18 03:41:19 +0000
committerYang Tse <yangsita@gmail.com>2006-10-18 03:41:19 +0000
commit71c6335293e4945262ab25b867d59be17ce12819 (patch)
treef88cdec9265c578de856b0cb296fe1cc2eb9cbde /lib
parent8c38ea4ebcff4960b531a6f6fbac6b412609c986 (diff)
Move definition of IS*() macros to setup_once.h
Diffstat (limited to 'lib')
-rw-r--r--lib/setup.h10
-rw-r--r--lib/setup_once.h23
2 files changed, 23 insertions, 10 deletions
diff --git a/lib/setup.h b/lib/setup.h
index 4f1a3c1cd..a02834ecd 100644
--- a/lib/setup.h
+++ b/lib/setup.h
@@ -348,16 +348,6 @@ int fileno( FILE *stream);
#define DEBUGF(x)
#endif
-#ifndef ISSPACE
-/* typecasting craze to avoid negative number inputs to these macros */
-#define ISSPACE(x) (isspace((int)((unsigned char)x)))
-#define ISDIGIT(x) (isdigit((int)((unsigned char)x)))
-#define ISALNUM(x) (isalnum((int)((unsigned char)x)))
-#define ISXDIGIT(x) (isxdigit((int)((unsigned char)x)))
-#define ISGRAPH(x) (isgraph((int)((unsigned char)x)))
-#define ISALPHA(x) (isalpha((int)((unsigned char)x)))
-#endif
-
/*
* Include macros and defines that should only be processed once.
*/
diff --git a/lib/setup_once.h b/lib/setup_once.h
index d3a4cc0a1..9c00fd637 100644
--- a/lib/setup_once.h
+++ b/lib/setup_once.h
@@ -24,6 +24,16 @@
***************************************************************************/
+/********************************************************************
+ * NOTICE *
+ * ======== *
+ * *
+ * Content of header files lib/setup_once.h and ares/setup_once.h *
+ * must be kept in sync. Modify the other one if you change this. *
+ * *
+ ********************************************************************/
+
+
/*
* If we have the MSG_NOSIGNAL define, make sure we use
* it as the fourth argument of send() and recv()
@@ -112,5 +122,18 @@
#endif /* HAVE_SEND */
+/*
+ * Uppercase macro versions of ANSI/ISO is*() functions/macros which
+ * avoid negative number inputs whith argument byte codes > 127.
+ */
+
+#define ISSPACE(x) (isspace((int) ((unsigned char)x)))
+#define ISDIGIT(x) (isdigit((int) ((unsigned char)x)))
+#define ISALNUM(x) (isalnum((int) ((unsigned char)x)))
+#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
+#define ISGRAPH(x) (isgraph((int) ((unsigned char)x)))
+#define ISALPHA(x) (isalpha((int) ((unsigned char)x)))
+
+
#endif /* __SETUP_ONCE_H */