aboutsummaryrefslogtreecommitdiff
path: root/libXdmcp/Alloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-24 10:49:08 +0000
committermarha <marha@users.sourceforge.net>2009-09-24 10:49:08 +0000
commit67b353c9ce039b254ba2e92cd6f842c505a8bd21 (patch)
treeedb5f3ff6a9564a50f3b701913ab2b3aafa80a95 /libXdmcp/Alloc.c
parentf3d88db0960f1c23e55f2529764b096ac92d78d9 (diff)
downloadvcxsrv-67b353c9ce039b254ba2e92cd6f842c505a8bd21.tar.gz
vcxsrv-67b353c9ce039b254ba2e92cd6f842c505a8bd21.tar.bz2
vcxsrv-67b353c9ce039b254ba2e92cd6f842c505a8bd21.zip
Update following packages:
- xproto-7.0.16 - libXdmcp-1.0.3 - bdftopcf-1.0.2 - xorg-server-1.6.99.902
Diffstat (limited to 'libXdmcp/Alloc.c')
-rw-r--r--libXdmcp/Alloc.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/libXdmcp/Alloc.c b/libXdmcp/Alloc.c
index 40cbacf0b..1c32270b0 100644
--- a/libXdmcp/Alloc.c
+++ b/libXdmcp/Alloc.c
@@ -40,7 +40,20 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xdmcp.h>
#include <stdlib.h>
-void *
+/* this probably works for Mach-O too, but probably not for PE */
+#if defined(__ELF__) && defined(__GNUC__) && (__GNUC__ >= 3)
+#define weak __attribute__((weak))
+#else
+#define weak
+#endif
+
+#ifdef __SUNPRO_C
+#pragma weak Xalloc
+#pragma weak Xrealloc
+#pragma weak Xfree
+#endif
+
+weak void *
Xalloc (unsigned long amount)
{
if (amount == 0)
@@ -48,7 +61,7 @@ Xalloc (unsigned long amount)
return malloc (amount);
}
-void *
+weak void *
Xrealloc (void *old, unsigned long amount)
{
if (amount == 0)
@@ -58,7 +71,7 @@ Xrealloc (void *old, unsigned long amount)
return realloc ((char *) old, amount);
}
-void
+weak void
Xfree (void *old)
{
if (old)