Portability patches



Hello,

I always apply the attached patches to compile on Tru64 UNIX.  
These patches should increase portability to all platforms.

The first patch (ORBit-0.5.1-hpux.patch) was originally questioned if
it would break compilation on other platforms.  However I did my
homework on this one and verified it causes no problems on AIX, Linux
and Tru64.  I followed the guidelines on the HP Developers pages to
isolate the fix to HP-UX, where it actually applies.

The second patch simply (ORBit-0.5.1-tru64.patch) fixes some code to
be ANSI-compliant.  There was a short discussion on the gnome-devel
list and this was the result.

If there are no issues with the patches, could you please apply them
to the current sources?  I'm trying to get most of my patches in
before Gnome-1.4 so that it will mostly compile cleanly on Tru64
without modification.

Thanks,
Aron

-- 
Aron Griffis                  
Tru64 UNIX Platform & Kernel
Compaq Computer Corporation, ZKO3-3/T30
--- ORBit-0.5.1.old/src/IIOP/connection.c	Fri Feb 18 11:18:00 2000
+++ ORBit-0.5.1/src/IIOP/connection.c	Fri Mar 17 14:02:57 2000
@@ -1,5 +1,5 @@
 #include "config.h"
-#ifndef _XOPEN_SOURCE_EXTENDED
+#if defined (__hpux) && ! defined (_XOPEN_SOURCE_EXTENDED)
 #   define _XOPEN_SOURCE_EXTENDED 1
 #   define WE_DEFINED_XOPEN_SOURCE_EXTENDED 1
 #endif
@@ -17,7 +17,7 @@
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#ifndef _XOPEN_SOURCE_EXTENDED
+#if defined (__hpux) && ! defined (_XOPEN_SOURCE_EXTENDED)
 #   define _XOPEN_SOURCE_EXTENDED 1
 #endif
 #include <arpa/inet.h>
--- ORBit-0.5.1.old/src/orb/allocators.c	Fri Feb 18 11:18:09 2000
+++ ORBit-0.5.1/src/orb/allocators.c	Fri Mar 17 10:29:47 2000
@@ -200,7 +200,7 @@
 		    ORBit_free_via_TypeCode(mem, &subtc, free_strings);
 		    /* the end of the body (subtc) may not be the
 		     * same as the end of the union */
-		    retval = mem + sz;
+		    retval = (char *)mem + sz;
 		}
 		break;
 	case CORBA_tk_wstring:
--- ORBit-0.5.1.old/src/orb/corba_any.c	Sat Nov  6 20:12:30 1999
+++ ORBit-0.5.1/src/orb/corba_any.c	Mon Mar 20 16:40:23 2000
@@ -275,19 +275,28 @@
     case CORBA_tk_ulong:
     case CORBA_tk_long:
     case CORBA_tk_enum:
-	retval = *(CORBA_long *)*val;
-	if(update) *val += sizeof(CORBA_long);
+	{
+	    CORBA_long *p = *val;
+	    retval = *p++;
+	    if (update) *val = p;
+	}
 	break;
     case CORBA_tk_ushort:
     case CORBA_tk_short:
-	retval = *(CORBA_short *)*val;
-	if(update) *val += sizeof(CORBA_short);
+	{
+	    CORBA_short *p = *val;
+	    retval = *p++;
+	    if (update) *val = p;
+	}
 	break;
     case CORBA_tk_char:
     case CORBA_tk_boolean:
     case CORBA_tk_octet:
-	retval = *(CORBA_octet *)*val;
-	if(update) *val += sizeof(CORBA_char);
+	{
+	    CORBA_octet *p = *val;
+	    retval = *p++;
+	    if (update) *val = p;
+	}
 	break;
     case CORBA_tk_alias:
 	return ORBit_get_union_switch(tc->subtypes[0], val, update);


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