[Xlibs] patches for Xt

Jeremy C. Reed reed@reedmedia.net
Fri, 30 Jan 2004 18:12:57 -0800 (PST)


Please review the following patches for Xt.

Errors before patches:

gcc -DHAVE_CONFIG_H -I. -I. -I. -DXTHREADS -DXUSE_MTSAFE_API
-I./include/X11 -g -O2 -MT ActionHook.lo -MD -MP -MF .deps/ActionHook.Tpo
-c ActionHook.c  -fPIC -DPIC -o .libs/ActionHook.o
In file included from IntrinsicI.h:54,
                 from ActionHook.c:69:
Xtos.h:58:25: X11/Xalloca.h: No such file or directory

In file included from include/X11/IntrinsicP.h:203,
                 from IntrinsicI.h:55,
                 from ActionHook.c:69:

Another error is missing Shell.h.

? include/X11/ObjectP.h

On the CVS server itself, can I move that file into place? (This is so I
will preserve all history for it.)

cvs diff: Diffing .
Index: ChangeLog
===================================================================
RCS file: /cvs/xlibs/Xt/ChangeLog,v
retrieving revision 3.4
diff -b -u -r3.4 ChangeLog
--- ChangeLog	17 Jan 2004 04:06:40 -0000	3.4
+++ ChangeLog	31 Jan 2004 02:03:39 -0000
@@ -1,3 +1,21 @@
+2004-01-30  Jeremy C. Reed  <reed@reedmedia.net>
+
+	reviewed by: <delete if not using a buddy>
+
+	* Makefile.am:
+	Include local include/ directory in AM_CFLAGS. Install Shell.h
+	to local include/X11/ directory (after generated).
+
+	* Xtos.h:
+	Fix so doesn't need Xalloca.h. Based on ideas from
+	xserver/include/os.h.
+
+	* include/Makefile.am:
+	Make sure ObjectP.h and Shell.h are used and installed.
+
+	* include/X11/ObjectP.h
+	Moved this file from base directory.
+
 2004-01-17  Daniel Stone  <daniel@fooishbar.org>
 	* Tag release 0.1.4 for first freedesktop.org clientside lib release.

Index: Makefile.am
===================================================================
RCS file: /cvs/xlibs/Xt/Makefile.am,v
retrieving revision 3.4
diff -b -u -r3.4 Makefile.am
--- Makefile.am	17 Jan 2004 04:15:20 -0000	3.4
+++ Makefile.am	31 Jan 2004 02:03:40 -0000
@@ -23,7 +23,8 @@

 SUBDIRS = include util

-AM_CFLAGS = $(RENDER_CFLAGS) $(X_CFLAGS) -I$(top_srcdir)/include/X11
+AM_CFLAGS = $(RENDER_CFLAGS) $(X_CFLAGS) -I$(top_srcdir)/include/X11 \
+		-I$(top_srcdir)/include

 lib_LTLIBRARIES = libXt.la

@@ -121,6 +122,7 @@
 	$(top_builddir)/util/makestrs $(STRINGSABIOPTIONS) < $(STRING_LIST) > StringDefs.c
 	install -d include/X11/
 	install -m644 $(top_builddir)/StringDefs.h include/X11/
+	install -m644 $(top_builddir)/Shell.h include/X11/

 $(top_builddir)/util/makestrs$(EXEEXT): force
 	cd util; $(MAKE)
cvs diff: cannot find ObjectP.h
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 02:03:40 -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) Xalloc((unsigned long)(_size))
+#define DEALLOCATE_LOCAL(_ptr) Xfree((Pointer)(_ptr))
+#endif

 #ifdef CRAY
 #define WORD64
cvs diff: Diffing include
Index: include/Makefile.am
===================================================================
RCS file: /cvs/xlibs/Xt/include/Makefile.am,v
retrieving revision 1.3
diff -b -u -r1.3 Makefile.am
--- include/Makefile.am	17 Jan 2004 04:15:22 -0000	1.3
+++ include/Makefile.am	31 Jan 2004 02:03:40 -0000
@@ -9,8 +9,10 @@
 	X11/Intrinsic.h \
 	X11/IntrinsicP.h \
 	X11/Object.h \
+	X11/ObjectP.h \
 	X11/RectObj.h \
 	X11/RectObjP.h \
+	X11/Shell.h \
 	X11/ShellP.h \
 	X11/Vendor.h \
 	X11/VendorP.h


Can I do these few changes?

Also, Keithp said "If XAlloca.h is installed, we'll want to generate it
with the right content from the configure script." I didn't do that.

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

p.s. I am not sure why I received these messages:

cvs diff: cannot find util/Shell.ht
cvs diff: cannot find util/StrDefs.ct
cvs diff: cannot find util/StrDefs.ht