I needed to make the following changes in order to compile on Solaris 9
with an older version of the Sun C compilers (one without any C99 or
recent gcc-ish extensions).  These changes should be compatible with all
compilers though.


1) Unneccessary use of C99/gcc varargs macros in makedepend.
   The DBG_PRINT macro always uses three arguments, so specifying a variable
   number seems unneccessary.

diff -ur 4.3.0/xc/config/makedepend/main.c solaris/xc/config/makedepend/main.c
--- 4.3.0/xc/config/makedepend/main.c   Fri Jan 17 09:09:49 2003
+++ solaris/xc/config/makedepend/main.c Tue Mar  4 14:58:38 2003
@@ -57,9 +57,9 @@
 
 /* #define DEBUG_DUMP */
 #ifdef DEBUG_DUMP
-#define DBG_PRINT(args...)   fprintf(args)
+#define DBG_PRINT(a,b,c)   fprintf(a,b,c)
 #else
-#define DBG_PRINT(args...)   /* empty */
+#define DBG_PRINT(a,b,c)   /* empty */
 #endif
 
 #define DASH_INC_PRE    "#include \""


2) ICWrap.c derefences function pointers when it shouldn't when trying to
   verify they are not NULL.

diff -ur 4.3.0/xc/lib/X11/ICWrap.c solaris/xc/lib/X11/ICWrap.c
--- 4.3.0/xc/lib/X11/ICWrap.c   Mon Nov 25 06:04:53 2002
+++ solaris/xc/lib/X11/ICWrap.c Tue Mar  4 18:26:35 2003
@@ -395,9 +395,9 @@
     XIC ic;
 {
     if (ic->core.im) {
-       if (*ic->methods->utf8_reset)
+       if (ic->methods->utf8_reset)
            return (*ic->methods->utf8_reset)(ic);
-       else if (*ic->methods->mb_reset)
+       else if (ic->methods->mb_reset)
            return (*ic->methods->mb_reset)(ic);
     }
     return (char *)NULL;
@@ -443,10 +443,10 @@
     Status *status;
 {
     if (ic->core.im) {
-       if (*ic->methods->utf8_lookup_string)
+       if (ic->methods->utf8_lookup_string)
            return (*ic->methods->utf8_lookup_string) (ic, ev, buffer, nbytes,
                                                        keysym, status);
-       else if (*ic->methods->mb_lookup_string)
+       else if (ic->methods->mb_lookup_string)
            return (*ic->methods->mb_lookup_string) (ic, ev, buffer, nbytes,
                                                        keysym, status);
     }


3) The -I. in xedit/lisp/Imakefile caused it to include the string.h in
   that directory for #include <string.h>, resulting in undefined structure
   errors. Removing it allowed the compile to finish sucessfully. (A better
   solution would be to not have headers with the same names as standard
   ANSI/POSIX standard includes.)

diff -ur 4.3.0/xc/programs/xedit/lisp/Imakefile 
solaris/xc/programs/xedit/lisp/Imakefile
--- 4.3.0/xc/programs/xedit/lisp/Imakefile      Fri Dec 13 20:41:13 2002
+++ solaris/xc/programs/xedit/lisp/Imakefile    Tue Mar  4 18:27:36 2003
@@ -112,7 +112,7 @@
         DEFINES = -DLISP $(SHARED_DEFINES) -DLISPDIR='"$(LISPDIR)"' \
                  $(SNPRINTF_DEFS) $(SYS_DEFINES) $(SIGNAL_DEFINES)
         DEPLIBS = mp re
-       INCLUDES = -I. -Imp -Ire -I- $(MISC_INCLUDES)
+       INCLUDES = -Imp -Ire -I- $(MISC_INCLUDES)
 LOCAL_LIBRARIES = -L. -llisp -Lmp -lmp -Lre -lre -lm $(DLLIB)
 
 #ifdef IHaveSubdirs


4) Typo in the #else clause of #ifdef __GNUC__ in RenderLogo.c.  Simply
   appears to have never been tested with anything that's not gcc.  (An
   unrelated fix would be to check for C99 and if so, use __func__.)

diff -ur 4.3.0/xc/programs/xlogo/RenderLogo.c solaris/xc/programs/xlogo/RenderLogo.c
--- 4.3.0/xc/programs/xlogo/RenderLogo.c        Sat Oct 19 12:15:32 2002
+++ solaris/xc/programs/xlogo/RenderLogo.c      Tue Mar  4 18:30:03 2003
@@ -156,7 +156,7 @@
 #ifdef __GNUC__
        fprintf(stderr, "%s: intersection is off by: %f\n", __FUNCTION__, fabs(check - 
intersection->x));
 #else
-       fprintf(stderr, "intersect: intersection is off by %f\n", fabs(check - 
instersection->x));
+       fprintf(stderr, "intersect: intersection is off by %f\n", fabs(check - 
intersection->x));
 #endif
     }
 }

        -Alan Coopersmith-      [EMAIL PROTECTED]
         Sun Microsystems, Inc.   -   Sun Software Group
         Quality, Integration, & Customer Success (QICS)
         Platform Globalization Engin. - X11 Engineering
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to