[kaffe] Kaffe CVS: kaffe dalibor

Patrick Tullmann tullmann at cs.utah.edu
Fri Dec 6 08:43:31 PST 2002

Hi Dalibor,

It seems like just getting configure to test for swab correctly will
solve this problem (unless I'm missing something), without having to
resort to naming platforms in config-mem.h.

On FreeBSD (and other sane systems), where swab() is prototyped in a
header file, config-mem.h should not be providing the prototype.  On
Linux (or wherever else swab is mistakenly unprototyped) config-mem.h
should provide a prototype (though, perhaps it should provide an
implementation, too).

If we're getting duplicate prototypes, the configure test is broken
(its not finding something that a regular compile is finding).

I'm thinking something like this:
	Index: configure.in 
	RCS file: /cvs/kaffe/kaffe/configure.in,v 
	retrieving revision 1.170 
	diff -u -b -u -r1.170 configure.in 
	--- configure.in        27 Nov 2002 18:32:54 -0000      1.170 
	+++ configure.in        6 Dec 2002 16:23:30 -0000 
	@@ -1124,6 +1124,9 @@ 
	 #ifdef HAVE_UNISTD_H 
	 #include <unistd.h> 
	+#ifdef HAVE_STRING_H 
	+#include <string.h> /* FreeBSD puts swab here */ 
	 #ifdef HAVE_STDLIB_H 
	 #include <stdlib.h> 

That seems to fix the problem on FreeBSD, at least.  Let me know if I
should check this in...


Dalibor wrote:
> Hi Pat,
> --- Patrick Tullmann <tullmann at cs.utah.edu> wrote:
> > Why isn't the configure variable HAVE_DECLARED_SWAB
> > being set
> > correctly?  (Is that the g++/gcc distinction Dalibor
> > mentioned??)
> No idea, really. It seems to be a gcc on linux issue,
> according to the comment in the config-mem.h file.
> Should I ask gcc/libc developers ? Any idea whom to
> bother first?
> > Maybe the configure test should be updated to
> > include <string.h> too?
> > (Right not it only seems to check unistd.h and
> > stdlib.h...)
> I'll try it with <string.h>, if that fails with gcc on
> linux, then I guess I'll revert to the old form, and
> #ifdef LINUX it. Is LINUX the right platform define?
> Every platform seems to have its own ideas about swab.
> I remember my last attempt to compile on mingw also
> gave me some swab prototype problems. As the ssize_t
> definition is by the OpenGroup, should I file a bug
> report for FreeBSD somewhere? If so, where?
> cheers,
> dalibor topic
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com

----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                           www.tullmann.org

More information about the kaffe mailing list