This is the mail archive of the libc-alpha@sourceware.org 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]

GCC 4.x fixes for Hurd #0


(this is a new version of a old patch)

?: can't be used this way since GCC 4.x is silly, so we do it
differenly.

i686-pc-gnu0.3-gcc ../sysdeps/mach/hurd/mig-reply.c -c -std=gnu99 -O2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g -Wno-parentheses -mpreferred-stack-boundary=2     -I../include -I. -I/home/update/ams/slask/libc/obj/mach -I.. -I../libio -I../hurd -I/home/update/ams/slask/libc/obj/hurd/ -I../mach -I/home/update/ams/slask/libc/obj/mach/ -I/home/update/ams/slask/libc/obj -I../sysdeps/i386/elf -I../sysdeps/mach/hurd/i386 -I../sysdeps/mach/hurd -I../sysdeps/gnu -I../sysdeps/unix/bsd/bsd4.4 -I../sysdeps/unix/mman -I../sysdeps/mach/i386 -I../sysdeps/mach -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/unix/bsd -I../sysdeps/unix/common -I../sysdeps/unix/inet -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic  -D_LIBC_REENTRANT -include ..
 /include/libc-symbols.h       -o /home/update/ams/slask/libc/obj/mach/mig-reply.o -MD -MP -MF /home/update/ams/slask/libc/obj/mach/mig-reply.o.dt -MT /home/update/ams/slask/libc/obj/mach/mig-reply.o
../sysdeps/mach/hurd/mig-reply.c: In function '__mig_get_reply_port':
../sysdeps/mach/hurd/mig-reply.c:39: error: invalid lvalue in assignment
../sysdeps/mach/hurd/mig-reply.c: In function '__mig_dealloc_reply_port':
../sysdeps/mach/hurd/mig-reply.c:54: error: invalid lvalue in assignment

2005-08-05  Alfred M. Szmidt  <ams@gnu.org>

	* sysdeps/mach/hurd/mig-reply.c (_reply_port): New function.
	(reply_port): Use it.
	(__mig_get_reply_port, __mig_dealloc_reply_port): Likewise.

--- sysdeps/mach/hurd/mig-reply.c
+++ sysdeps/mach/hurd/mig-reply.c
@@ -22,11 +22,17 @@
 #define GETPORT \
   mach_port_t *portloc = \
     (mach_port_t *) __hurd_threadvar_location (_HURD_THREADVAR_MIG_REPLY)
-#define reply_port (use_threadvar ? *portloc : global_reply_port)
 
 static int use_threadvar;
 static mach_port_t global_reply_port;
 
+static mach_port_t *
+_reply_port (mach_port_t *portloc)
+{
+  return (use_threadvar ? portloc : &global_reply_port);
+}
+#define reply_port() *_reply_port (portloc)
+
 /* These functions are called by MiG-generated code.  */
 
 /* Called by MiG to get a reply port.  */
@@ -34,11 +40,12 @@
 __mig_get_reply_port (void)
 {
   GETPORT;
+  mach_port_t rp = reply_port ();
 
-  if (reply_port == MACH_PORT_NULL)
-    reply_port = __mach_reply_port ();
+  if (rp == MACH_PORT_NULL)
+    rp = __mach_reply_port ();
 
-  return reply_port;
+  return rp;
 }
 weak_alias (__mig_get_reply_port, mig_get_reply_port)
 
@@ -47,11 +54,11 @@
 __mig_dealloc_reply_port (mach_port_t arg)
 {
   mach_port_t port;
-
   GETPORT;
+  mach_port_t rp = reply_port ();
 
-  port = reply_port;
-  reply_port = MACH_PORT_NULL;	/* So the mod_refs RPC won't use it.  */
+  port = rp;
+  rp = MACH_PORT_NULL;	/* So the mod_refs RPC won't use it.  */
 
   if (MACH_PORT_VALID (port))
     __mach_port_mod_refs (__mach_task_self (), port,



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