From xemacs-m  Mon May 12 20:36:19 1997
Received: from ns.jsys.co.jp (ns.jsys.co.jp [202.33.240.82])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id UAA09789
	for <xemacs-beta@xemacs.org>; Mon, 12 May 1997 20:36:17 -0500 (CDT)
Received: from cosmos.jsys.co.jp (cosmos.jsys.co.jp [172.31.80.5])
	by ns.jsys.co.jp (8.8.5/8.8.5) with ESMTP id KAA14594;
	Tue, 13 May 1997 10:36:14 +0900 (JST)
Received: from skywalk.jsys.co.jp (j-04110.jsys.co.jp [172.31.49.72])
	by cosmos.jsys.co.jp (8.8.5/8.8.5/NOTES) with ESMTP id KAA15371;
	Tue, 13 May 1997 10:36:13 +0900 (JST)
Received: (from ienaga@localhost) by skywalk.jsys.co.jp (8.8.5/3.5Wpl2) id KAA11774; Tue, 13 May 1997 10:36:11 +0900 (JST)
To: Martin Buchholz <mrb@Eng.Sun.COM>
Cc: Stig Bjorlykke <stigb@colargol.idb.hist.no>, xemacs-beta@xemacs.org
Subject: Re: 20.2-b6: SUCCESS on intel-unknown-freebsd, but ...
References: <4rn2q2yv0k.fsf@gadid.idb.hist.no> <199705120503.WAA14830@xemacs.eng.sun.com>
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
 boundary="Multipart_Tue_May_13_10:36:02_1997-1"
Content-Transfer-Encoding: 7bit
From: Kazuyuki IENAGA <ienaga@jsys.co.jp>
Date: 13 May 1997 10:36:02 +0900
In-Reply-To: Martin Buchholz's message of Sun, 11 May 1997 22:03:28 -0700
Message-ID: <rysohagywzh.fsf@skywalk.jsys.co.jp>
Lines: 104
X-Mailer: Gnus v5.4.51/XEmacs 20.2(beta5)
X-Face:  czfHfB+cCdftWr4Fwe9^^-!_PKouj^vkcIk4Hg_xxx<~JF.4vv)^7jM;w_w'(UZ#{K&xpz:
 [v3`j%a.u`CP*Tbsm[N0PYlk&+xt3Vd1KZL%'I+v,:*0\(akF?Vf>l_VeOHH]2.Z6^e_O;zDZJW.


--Multipart_Tue_May_13_10:36:02_1997-1
Content-Type: text/plain; charset=US-ASCII

I'm running FreeBSD 2.1.5 and 2.2.1 at my office and 2.1.7 at home.

Martin Buchholz <mrb@Eng.Sun.COM> writes:

> Stig> Is this a XEmacs or a FreeBSD "error"?
> 
> Seems like a FreeBSD error.  Someone familiar with various versions of 
> FreeBSD will have to think about this code in src/s/freebsd.h:
> 
> /* this silences a few compilation warnings */
> #undef BSD
> #if __FreeBSD__ == 1
> #define BSD 199103
> #elif __FreeBSD__ == 2
> #define BSD 199306
> #elif __FreeBSD__ == 3
> #define BSD 199506
> #endif

There's pretty differenes between FreeBSD 2.1.x and 2.2.x.

The freebsd.h need to be:


--Multipart_Tue_May_13_10:36:02_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="freebsd.h.diff"
Content-Transfer-Encoding: 7bit

===================================================================
RCS file: RCS/freebsd.h,v
retrieving revision 1.1
diff -u -r1.1 freebsd.h
--- freebsd.h	1997/05/12 07:25:45	1.1
+++ freebsd.h	1997/05/13 01:06:59
@@ -87,7 +87,11 @@
 #if __FreeBSD__ == 1
 #define BSD 199103
 #elif __FreeBSD__ == 2
-#define BSD 199306
+#if __FreeBSD_version < 199701
+# define BSD 199306
+#else
+# define BSD 199506
+#endif
 #elif __FreeBSD__ == 3
 #define BSD 199506
 #endif

--Multipart_Tue_May_13_10:36:02_1997-1
Content-Type: text/plain; charset=US-ASCII



> In general, OS tests should be replaced by feature tests.  Most of the 
> code using the BSD symbol looks pre-1990 vintage.

In fact, there's no BSD symbol used in XEmacs source tree, but
_FreeBSD_version and _BSDI_VERSION.

% grep BSD */*.[ch] */*/*.[ch] | egrep '(>|<|=)' | grep '#.*if'
src/ecrt0.c:#if defined(_BSDI_VERSION) && (_BSDI_VERSION >= 199501)
src/ecrt0.c:#if defined(_BSDI_VERSION) && (_BSDI_VERSION >= 199501)
src/ecrt0.c:#if __FreeBSD__ == 2
src/ecrt0.c:#if defined(_BSDI_VERSION) && (_BSDI_VERSION >= 199501)
src/input-method-motif.c:# if __FreeBSD_version >= 199701
src/input-method-xfs.c:# if __FreeBSD_version >= 199701 /* waiting FreeBSD supports all locale */
src/input-method-xlib.c:# if __FreeBSD_version >= 199701
src/s/freebsd.h:#if __FreeBSD_version >= 199701
src/s/freebsd.h:#if __FreeBSD__ == 1
src/s/freebsd.h:#elif __FreeBSD__ == 2
src/s/freebsd.h:#if __FreeBSD_version < 199701
src/s/freebsd.h:#elif __FreeBSD__ == 3


X11 header required it in X11/Xpoll.h around line 50.

#ifdef CSRG_BASED
#include <sys/param.h>
# if BSD < 199103
typedef long fd_mask;
# endif
#endif

At least FreeBSD 2.1 or higher, fd_mask is typedef'd to long in
sys/types.h.


And NO BSD symbol found in Motif header.

Plus, PNG header, pngconf.h, uses BSD:
#ifdef BSD
#include <strings.h>
#else
#include <string.h>
#endif

-- 
kazz

--Multipart_Tue_May_13_10:36:02_1997-1--

