[Xlibs] patches for Xt

Jeremy C. Reed reed@reedmedia.net
Fri, 30 Jan 2004 22:55:31 -0800 (PST)


After trying to build gle with my libXt I found that I made some other
problems with Xalloc stuff. This helped ...

Index: Xtos.h
===================================================================
RCS file: /cvs/xlibs/Xt/Xtos.h,v
retrieving revision 3.13
diff -b -u -r3.13 Xtos.h
--- Xtos.h	24 Oct 2003 15:47:35 -0000	3.13
+++ Xtos.h	31 Jan 2004 06:56:27 -0000
@@ -53,9 +53,25 @@
 #ifndef _Xtos_h
 #define _Xtos_h

-#define ALLOCATE_LOCAL_FALLBACK(_size) XtMalloc((unsigned long)(_size))
-#define DEALLOCATE_LOCAL_FALLBACK(_ptr) XtFree((XtPointer)(_ptr))
-#include <X11/Xalloca.h>
+#if HAVE_ALLOCA
+/* AIX requires this to be the first thing in the file.  */
+# if HAVE_ALLOCA_H
+#   include <alloca.h>
+# else
+#  ifdef _AIX
+ #pragma alloca
+#  else
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#   endif
+#  endif
+# endif
+#define ALLOCATE_LOCAL(size) alloca((int)(size))
+#define DEALLOCATE_LOCAL(ptr) /* as nothing */
+#else
+#define ALLOCATE_LOCAL(_size) XtMalloc((unsigned long)(_size))
+#define DEALLOCATE_LOCAL(_ptr) XtFree((XtPointer)(_ptr))
+#endif

 #ifdef CRAY
 #define WORD64

   Jeremy C. Reed
   http://www.reedmedia.net/