This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

intl patches (29)



Some portability tweaks relating to alloca and AIX 3:
  - Since dcigettext.c has fallback code for systems without alloca(),
    there is no need to test for C_ALLOCA. libintl is standalone.
  - AIX preprocessor gives an error on empty macro arguments.
  - plural.y needs an AIX specific #pragma.

No effect inside glibc.


2001-03-21  Bruno Haible  <bruno@clisp.org>

	* intl/dcigettext.c (_nl_state_lock): Mark as #ifdef _LIBC. AIX 3 xlc
	chokes on empty macro arguments.
	* intl/plural.y: Add #pragma for alloca on AIX 3. 

--- 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
@@ -30,11 +30,11 @@
 
 #include <sys/types.h>
 
-#if defined __GNUC__ && !defined C_ALLOCA
+#ifdef __GNUC__
 # define alloca __builtin_alloca
 # define HAVE_ALLOCA 1
 #else
-# if (defined HAVE_ALLOCA_H || defined _LIBC) && !defined C_ALLOCA
+# if defined HAVE_ALLOCA_H || defined _LIBC
 #  include <alloca.h>
 # else
 #  ifdef _AIX
@@ -355,7 +322,9 @@
 #endif
 
 /* Lock variable to protect the global data in the gettext implementation.  */
+#ifdef _LIBC
 __libc_rwlock_define_initialized (, _nl_state_lock)
+#endif
 
 /* Checking whether the binaries runs SUID must be done and glibc provides
    easier methods therefore we make a difference here.  */
--- glibc-20011110/intl/plural.y.bak	Wed Nov 21 12:35:53 2001
+++ glibc-20011110/intl/plural.y	Tue Nov 20 01:00:00 2001
@@ -19,6 +19,13 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/* The bison generated parser uses alloca.  AIX 3 forces us to put this
+   declaration at the beginning of the file.  The declaration in bison's
+   skeleton file comes too late.  This must come before <config.h>
+   because <config.h> may include arbitrary system headers.  */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]