GCC 4.x fixes for Hurdy bits (4/5)
Alfred M. Szmidt
ams@gnu.org
Fri Jun 10 06:40:00 GMT 2005
We can't use ?: this way since GCC 4.x is silly, so we do it
differenly,
2005-06-10 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,
More information about the Libc-alpha
mailing list