This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
intl patches (22)
- From: Bruno Haible <haible at ilog dot fr>
- To: libc-alpha at sources dot redhat dot com
- Date: Thu, 22 Nov 2001 15:00:21 +0100 (CET)
- Subject: intl patches (22)
This is the beginning of a new series of patches to keep the glibc intl/
and the gettext intl/ sources in sync.
This patch removes the conditionals for systems lacking <stddef.h>,
<stdlib.h>, <string.h>, <locale.h>, or <limits.h>. gettext-0.10.36,
released more than 6 months ago, already dropped that support, and
noone complained. So it's now safe to assume that <stddef.h>,
<stdlib.h>, <string.h>, <locale.h>, <limits.h> all exist. Likewise
for the use of the strchr function. The only remaining portability
problem is that in order to define NULL, SunOS 4 cc wants <stddef.h> -
<stdlib.h> doesn't define it.
2001-10-20 Bruno Haible <bruno@clisp.org>
Assume strchr() exists. (Without it, intl/explodename.c wouldn't link
anyway.)
* intl/dcigettext.c (strchr): Remove fallback definition; it conflicts
with the variable 'index' in plural_lookup.
* intl/l10nflist.c (strchr): Likewise.
* intl/localealias.c (strchr): Likewise.
Assume <stddef.h>, <stdlib.h>, <string.h>, <locale.h> exist.
* intl/bindtextdom.c: Likewise.
* intl/dcigettext.c: Likewise.
* intl/dgettext.c: Likewise.
* intl/dngettext.c: Likewise.
* intl/explodename.c: Likewise.
* intl/finddomain.c: Likewise.
* intl/gettext.c: Likewise.
* intl/l10nflist.c: Likewise.
* intl/loadmsgcat.c: Likewise.
* intl/localealias.c: Likewise.
* intl/ngettext.c: Likewise.
* intl/textdomain.c: Likewise.
* intl/gettext.h: Assume <limits.h> exists.
--- glibc-20011110/intl/bindtextdom.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/bindtextdom.c Tue Nov 20 01:00:00 2001
@@ -21,24 +21,9 @@
# include <config.h>
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst))
-# endif
-#endif
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
#ifdef _LIBC
# include <libintl.h>
--- glibc-20011110/intl/dcigettext.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/dcigettext.c Tue Nov 20 01:00:00 2001
@@ -55,36 +55,15 @@
# define __set_errno(val) errno = (val)
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stddef.h>
-# include <stdlib.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
#if defined HAVE_UNISTD_H || defined _LIBC
# include <unistd.h>
#endif
-#if defined HAVE_LOCALE_H || defined _LIBC
-# include <locale.h>
-#endif
+#include <locale.h>
#if defined HAVE_SYS_PARAM_H || defined _LIBC
# include <sys/param.h>
--- glibc-20011110/intl/dgettext.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/dgettext.c Tue Nov 20 01:00:00 2001
@@ -21,9 +21,7 @@
# include <config.h>
#endif
-#if defined HAVE_LOCALE_H || defined _LIBC
-# include <locale.h>
-#endif
+#include <locale.h>
#include "gettextP.h"
#ifdef _LIBC
--- glibc-20011110/intl/dngettext.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/dngettext.c Tue Nov 20 01:00:00 2001
@@ -21,9 +21,7 @@
# include <config.h>
#endif
-#if defined HAVE_LOCALE_H || defined _LIBC
-# include <locale.h>
-#endif
+#include <locale.h>
#include "gettextP.h"
#ifdef _LIBC
--- glibc-20011110/intl/explodename.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/explodename.c Tue Nov 20 01:00:00 2001
@@ -21,15 +21,8 @@
# include <config.h>
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include "loadinfo.h"
--- glibc-20011110/intl/finddomain.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/finddomain.c Tue Nov 20 01:00:00 2001
@@ -24,25 +24,8 @@
#include <stdio.h>
#include <sys/types.h>
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst))
-# endif
-#endif
+#include <stdlib.h>
+#include <string.h>
#if defined HAVE_UNISTD_H || defined _LIBC
# include <unistd.h>
--- glibc-20011110/intl/gettext.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/gettext.c Tue Nov 20 01:00:00 2001
@@ -25,15 +25,7 @@
# define __need_NULL
# include <stddef.h>
#else
-# ifdef STDC_HEADERS
-# include <stdlib.h> /* Just for NULL. */
-# else
-# ifdef HAVE_STRING_H
-# include <string.h>
-# else
-# define NULL ((void *) 0)
-# endif
-# endif
+# include <stdlib.h> /* Just for NULL. */
#endif
#include "gettextP.h"
--- glibc-20011110/intl/l10nflist.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/l10nflist.c Tue Nov 20 01:00:00 2001
@@ -28,30 +28,14 @@
# include <config.h>
#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst))
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
+#include <string.h>
#if defined _LIBC || defined HAVE_ARGZ_H
# include <argz.h>
#endif
#include <ctype.h>
#include <sys/types.h>
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
#include "loadinfo.h"
--- glibc-20011110/intl/loadmsgcat.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/loadmsgcat.c Tue Nov 20 01:36:02 2001
@@ -51,15 +51,8 @@
# endif
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
#if defined HAVE_UNISTD_H || defined _LIBC
# include <unistd.h>
--- glibc-20011110/intl/localealias.c.bak Fri Jul 27 18:47:16 2001
+++ glibc-20011110/intl/localealias.c Tue Nov 20 01:00:00 2001
@@ -52,29 +52,8 @@
# endif
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst))
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
+#include <stdlib.h>
+#include <string.h>
#include "gettextP.h"
--- glibc-20011110/intl/ngettext.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/ngettext.c Tue Nov 20 01:00:00 2001
@@ -25,15 +25,7 @@
# define __need_NULL
# include <stddef.h>
#else
-# ifdef STDC_HEADERS
-# include <stdlib.h> /* Just for NULL. */
-# else
-# ifdef HAVE_STRING_H
-# include <string.h>
-# else
-# define NULL ((void *) 0)
-# endif
-# endif
+# include <stdlib.h> /* Just for NULL. */
#endif
#include "gettextP.h"
--- glibc-20011110/intl/textdomain.c.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/textdomain.c Tue Nov 20 01:00:00 2001
@@ -21,18 +21,8 @@
# include <config.h>
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst))
-# endif
-#endif
+#include <stdlib.h>
+#include <string.h>
#ifdef _LIBC
# include <libintl.h>
--- glibc-20011110/intl/gettext.h.bak Tue Jul 10 22:58:51 2001
+++ glibc-20011110/intl/gettext.h Tue Nov 20 01:00:00 2001
@@ -20,9 +20,7 @@
#ifndef _GETTEXT_H
#define _GETTEXT_H 1
-#if HAVE_LIMITS_H || _LIBC
-# include <limits.h>
-#endif
+#include <limits.h>
/* @@ end of prolog @@ */