This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

PATCH: gcc/intl changes for 20000604 ss for sco v5


Here are some of the changes I made to files in gcc/intl in the gcc-20000604
snapshot to compile under SCO OpenServer 5.0.5 using SCO cc to bootstrap.

SCO cc does not like the 'inline' keyword.
I think it is C++ keyword that gcc accepts as a C extension.

Also, on SCO, localealias.c #define's memcpy() to bcopy(), and bcopy()
is void (instead of 'void *' like mempcy), so assignments of the form
  x = memcpy(a, b);
do not compile.

	* gettextP.h,hash-string.h,l10nflist.c: do not use 'inline'
	unless the compiler is C++ or gcc.
	* localealias.c: do not use the return value of memcpy.

diff -rN -U 8 -X begcs-20000604/gcc/bounds/diffexclude.dat egcs-20000604/gcc/intl/gettextP.h begcs-20000604/gcc/intl/gettextP.h
--- egcs-20000604/gcc/intl/gettextP.h	Sat Sep  4 11:08:49 1999
+++ begcs-20000604/gcc/intl/gettextP.h	Sat Jun 10 17:02:53 2000
@@ -41,17 +41,21 @@
 
 
 #ifdef _LIBC
 # include <byteswap.h>
 # define SWAP(i) bswap_32 (i)
 #else
 static nls_uint32 SWAP PARAMS ((nls_uint32 i));
 
-static inline nls_uint32
+static
+#if defined __cplusplus || defined __GNUC__
+inline
+#endif
+nls_uint32
 SWAP (i)
      nls_uint32 i;
 {
   return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
 }
 #endif
 
 
diff -rN -U 8 -X begcs-20000604/gcc/bounds/diffexclude.dat egcs-20000604/gcc/intl/hash-string.h begcs-20000604/gcc/intl/hash-string.h
--- egcs-20000604/gcc/intl/hash-string.h	Sat Sep  4 11:08:49 1999
+++ begcs-20000604/gcc/intl/hash-string.h	Sat Jun 10 17:02:53 2000
@@ -30,17 +30,21 @@
 #define HASHWORDBITS 32
 
 
 /* Defines the so called `hashpjw' function by P.J. Weinberger
    [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
    1986, 1987 Bell Telephone Laboratories, Inc.]  */
 static unsigned long hash_string PARAMS ((const char *__str_param));
 
-static inline unsigned long
+static
+#if defined __cplusplus || defined __GNUC__
+inline
+#endif
+unsigned long
 hash_string (str_param)
      const char *str_param;
 {
   unsigned long int hval, g;
   const char *str = str_param;
 
   /* Compute the hash value for the given string.  */
   hval = 0;
diff -rN -U 8 -X begcs-20000604/gcc/bounds/diffexclude.dat egcs-20000604/gcc/intl/l10nflist.c begcs-20000604/gcc/intl/l10nflist.c
--- egcs-20000604/gcc/intl/l10nflist.c	Sat Sep  4 11:08:49 1999
+++ begcs-20000604/gcc/intl/l10nflist.c	Sat Jun 10 17:02:53 2000
@@ -149,17 +149,21 @@
 # undef __argz_next
 # define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
 #endif	/* !_LIBC && !HAVE___ARGZ_NEXT */
 
 
 /* Return number of bits set in X.  */
 static int pop PARAMS ((int x));
 
-static inline int
+static
+#if defined __cplusplus || defined __GNUC__
+inline
+#endif
+int
 pop (x)
      int x;
 {
   /* We assume that no more than 16 bits are used.  */
   x = ((x & ~0x5555) >> 1) + (x & 0x5555);
   x = ((x & ~0x3333) >> 2) + (x & 0x3333);
   x = ((x >> 4) + x) & 0x0f0f;
   x = ((x >> 8) + x) & 0xff;
diff -rN -U 8 -X begcs-20000604/gcc/bounds/diffexclude.dat egcs-20000604/gcc/intl/localealias.c begcs-20000604/gcc/intl/localealias.c
--- egcs-20000604/gcc/intl/localealias.c	Sat Sep  4 11:08:49 1999
+++ begcs-20000604/gcc/intl/localealias.c	Sat Jun 10 17:10:15 2000
@@ -328,21 +328,23 @@
 		    {
 		      FREE_BLOCKS (block_list);
 		      return added;
 		    }
 		  string_space = new_pool;
 		  string_space_max = new_size;
 		}
 
-	      map[nmap].alias = memcpy (&string_space[string_space_act],
+	      map[nmap].alias = &string_space[string_space_act];
+	      memcpy (&string_space[string_space_act],
 					alias, alias_len);
 	      string_space_act += alias_len;
 
-	      map[nmap].value = memcpy (&string_space[string_space_act],
+	      map[nmap].value = &string_space[string_space_act];
+	      memcpy (&string_space[string_space_act],
 					value, value_len);
 	      string_space_act += value_len;
 
 	      ++nmap;
 	      ++added;
 	    }
 	}
     }


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