bug-gnu-utils
[Top][All Lists]
Advanced

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

patch for gettextP.h, hppa2.0w-hp-hpux11.00, SWAP


From: Michael Elizabeth Chastain
Subject: patch for gettextP.h, hppa2.0w-hp-hpux11.00, SWAP
Date: Mon, 15 Dec 2003 17:22:28 -0500 (EST)

Hello,

This patch fixes a build failure with gdb 6.0 on native
hppa2.0w-hp-hpux11.00 with the hp ansi c compiler /opt/ansic/bin/cc.
The build failure is documented at:

  http://sources.redhat.com/gdb/bugs/1458

I googled on "gettextP.h SWAP" and found that several other people
have had similar problems with hpux11.* .

My fix is simple: I abstain from 'inline' when using a non-gcc
compiler.  This will cost nothing with gcc and a small amount of
space and time with non-gcc compilers.

Testing: a user, Travis Heppe, tested this patch with
hppa2.0w-hp-hpux11.00.

What do you think?

Michael C

2003-12-15  Michael Chastain  <address@hidden>

        * gettextP.h (SWAP): Abstain from 'inline' for non-gcc
        compilers.

Index: gettextP.h
===================================================================
RCS file: /cvs/gcc/gcc/intl/gettextP.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 gettextP.h
*** gettextP.h  4 Jul 2003 18:18:54 -0000       1.1
--- gettextP.h  15 Dec 2003 21:55:43 -0000
***************
*** 67,78 ****
--- 67,92 ----
  # include <byteswap.h>
  # define SWAP(i) bswap_32 (i)
  #else
+ 
+ /* On hppa2.0w-hp-hpux11.00, the ansi c compiler /opt/ansic/bin/cc has a
+    problem with  'static inline nls_uint32', although it accepts 'static
+    inline unsigned int'.  The problem does not happen with
+    hppa2.0w-hp-hpux11.11 and the ansi c compiler.
+ 
+    A simple reliable solution is to abstain from 'inline'
+    for non-gcc compilers.  */
+ 
+ #if defined(__GNUC__)
  static inline nls_uint32
+ #else
+ static nls_uint32
+ #endif
  SWAP (i)
       nls_uint32 i;
  {
    return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
  }
+ 
  #endif
  
  




reply via email to

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