aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/include
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/include')
-rw-r--r--nx-X11/include/Xthreads.h14
-rw-r--r--nx-X11/include/extensions/XKBsrv.h20
2 files changed, 22 insertions, 12 deletions
diff --git a/nx-X11/include/Xthreads.h b/nx-X11/include/Xthreads.h
index 41440a2fb..b0ec7df32 100644
--- a/nx-X11/include/Xthreads.h
+++ b/nx-X11/include/Xthreads.h
@@ -33,12 +33,6 @@ in this Software without prior written authorization from The Open Group.
/* Redefine these to XtMalloc/XtFree or whatever you want before including
* this header file.
*/
-#ifndef xmalloc
-#define xmalloc malloc
-#endif
-#ifndef xfree
-#define xfree free
-#endif
#ifdef CTHREADS
#include <cthreads.h>
@@ -282,16 +276,16 @@ static xthread_t _X_no_thread_id;
typedef xcondition_rec *xcondition_t;
typedef xmutex_rec *xmutex_t;
#ifndef xcondition_malloc
-#define xcondition_malloc() (xcondition_t)xmalloc(sizeof(xcondition_rec))
+#define xcondition_malloc() (xcondition_t)malloc(sizeof(xcondition_rec))
#endif
#ifndef xcondition_free
-#define xcondition_free(c) xfree((char *)c)
+#define xcondition_free(c) free((char *)c)
#endif
#ifndef xmutex_malloc
-#define xmutex_malloc() (xmutex_t)xmalloc(sizeof(xmutex_rec))
+#define xmutex_malloc() (xmutex_t)malloc(sizeof(xmutex_rec))
#endif
#ifndef xmutex_free
-#define xmutex_free(m) xfree((char *)m)
+#define xmutex_free(m) free((char *)m)
#endif
#ifndef xthread_have_id
#define xthread_have_id(id) id
diff --git a/nx-X11/include/extensions/XKBsrv.h b/nx-X11/include/extensions/XKBsrv.h
index 3d335bc88..18d90f1e3 100644
--- a/nx-X11/include/extensions/XKBsrv.h
+++ b/nx-X11/include/extensions/XKBsrv.h
@@ -299,16 +299,32 @@ extern void * XkbLastRepeatEvent;
extern CARD32 xkbDebugFlags;
extern CARD32 xkbDebugCtrls;
-#define _XkbAlloc(s) xalloc((s))
+#ifndef XKB_IN_SERVER
+
+#define _XkbAlloc(s) Xalloc((s))
#define _XkbCalloc(n,s) Xcalloc((n)*(s))
#define _XkbRealloc(o,s) Xrealloc((o),(s))
-#define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t)))
+#define _XkbTypedAlloc(t) ((t *)Xalloc(sizeof(t)))
#define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t)))
#define _XkbTypedRealloc(o,n,t) \
((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
#define _XkbFree(p) Xfree(p)
+#else
+
+#define _XkbAlloc(s) malloc((s))
+#define _XkbCalloc(n,s) calloc((n), (s))
+#define _XkbRealloc(o,s) realloc((o),(s))
+#define _XkbTypedAlloc(t) ((t *)malloc(sizeof(t)))
+#define _XkbTypedCalloc(n,t) ((t *)calloc((n), sizeof(t)))
+#define _XkbTypedRealloc(o,n,t) \
+ ((o)?(t *)realloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
+#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
+#define _XkbFree(p) free(p)
+
+#endif /* !XKB_IN_SERVER */
+
#define _XkbLibError(c,l,d) \
{ _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
#define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))