tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fix to darwin xcompile by including unistd.h in nbcompat getmode.c compile



On Mon, 09 Jun 2008, Simon Burge wrote:
> > The issue is that darwin uses tricks to version the setmode symbol
> > (appending $UNIX2003), while netbsd's compat_defs.h renames that same
> > token to __nbcompat_setmode.
> 
> I think these "tricks" are also the cause of the getopt lossage in
> 
>   http://mail-index.netbsd.org/tech-toolchain/2008/02/04/msg000025.html
> 
> ?  I never figured out the right fix for this problem.

I think it's a bug for tools/compat/compat_defs.h to try to do clever
things with setmode/getmode without first #include <unistd.h>.  Fixing
that might solve both problems.  Try this patch.

--apb (Alan Barrett)

Index: src/tools/compat/compat_defs.h
===================================================================
--- src/tools/compat/compat_defs.h      30 Oct 2007 20:23:35 -0000      1.65
+++ src/tools/compat/compat_defs.h      11 Jun 2008 07:07:21 -0000
@@ -44,6 +44,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>


Home | Main Index | Thread Index | Old Index