findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] [PATCH] Assume C89 (or C99) C headers. Assume workin


From: James Youngman
Subject: [Findutils-patches] [PATCH] Assume C89 (or C99) C headers. Assume working <ctype.h>.
Date: Thu, 1 Apr 2010 09:16:21 +0100

* xargs/xargs.c: Unconditionally include <ctype.h>.  Assume
isblank(c) is defined.  Assume memcpy() has a prototype in
<string.h>.
* import-gnulib.config (modules): Import gnulib's ctype module.

Signed-off-by: James Youngman <address@hidden>
---
 ChangeLog            |    6 ++++++
 import-gnulib.config |    1 +
 xargs/xargs.c        |   34 ++++------------------------------
 3 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 279eda4..f80fb78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-04-01  James Youngman  <address@hidden>
 
+       Assume C89 (or C99) C headers.  Assume working <ctype.h>.
+       * xargs/xargs.c: Unconditionally include <ctype.h>.  Assume
+       isblank(c) is defined.  Assume memcpy() has a prototype in
+       <string.h>.
+       * import-gnulib.config (modules): Import gnulib's ctype module.
+
        Updated copyright years to add 2010.
        * find/find.c: Add 2010.
        * find/fstype.c: Add 2010.
diff --git a/import-gnulib.config b/import-gnulib.config
index b8288f1..11475e1 100644
--- a/import-gnulib.config
+++ b/import-gnulib.config
@@ -31,6 +31,7 @@ canonicalize
 cloexec
 closein
 closeout
+ctype
 dirname
 error
 fchdir
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 61849e1..d8ea2ec 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -34,23 +34,6 @@
 # endif
 
 #include <ctype.h>
-
-#if !defined(isascii) || defined(STDC_HEADERS)
-#ifdef isascii
-#undef isascii
-#endif
-#define isascii(c) 1
-#endif
-
-#ifdef isblank
-#define ISBLANK(c) (isascii (c) && isblank (c))
-#else
-#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
-#endif
-
-#define ISSPACE(c) (ISBLANK (c) || (c) == '\n' || (c) == '\r' \
-                   || (c) == '\f' || (c) == '\v')
-
 #include <stdio.h>
 #include <errno.h>
 #include <limits.h>
@@ -60,27 +43,18 @@
 #include <sys/types.h>
 #include <getopt.h>
 #include <fcntl.h>
-
-#if defined STDC_HEADERS
 #include <assert.h>
-#endif
-
-#if defined HAVE_STRING_H || defined STDC_HEADERS
 #include <string.h>
-#if !defined STDC_HEADERS
-#include <memory.h>
-#endif
-#else
-#include <strings.h>
-#define memcpy (dest, source, count) (bcopy ((source), (dest), (count)))
-#endif
-
 #include <sys/param.h>
 
 #ifndef LONG_MAX
 #define LONG_MAX (~(1 << (sizeof (long) * 8 - 1)))
 #endif
 
+#define ISBLANK(c) (isascii (c) && isblank (c))
+#define ISSPACE(c) (ISBLANK (c) || (c) == '\n' || (c) == '\r' \
+                   || (c) == '\f' || (c) == '\v')
+
 /* The presence of unistd.h is assumed by gnulib these days, so we
  * might as well assume it too.
  */
-- 
1.5.6.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]