aboutsummaryrefslogtreecommitdiff
path: root/libXdmcp/Alloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-24 16:26:20 +0000
committermarha <marha@users.sourceforge.net>2009-09-24 16:26:20 +0000
commit82967ab5e087a2fdfcb984f990ba117da68a5b60 (patch)
tree52ca72e09a0d1d0ecacfb51a8b0b5d1c8193449c /libXdmcp/Alloc.c
parentf02db4f3b9d748e1fd06e3ae2985b9cf1547cc7e (diff)
parent67b353c9ce039b254ba2e92cd6f842c505a8bd21 (diff)
downloadvcxsrv-82967ab5e087a2fdfcb984f990ba117da68a5b60.tar.gz
vcxsrv-82967ab5e087a2fdfcb984f990ba117da68a5b60.tar.bz2
vcxsrv-82967ab5e087a2fdfcb984f990ba117da68a5b60.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released
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)