[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Avoid warning on cygwin
From: |
Eric Blake |
Subject: |
Re: Avoid warning on cygwin |
Date: |
Fri, 11 Apr 2008 17:22:19 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:
>
> * Eric Blake wrote on Thu, Apr 10, 2008 at 06:56:07PM CEST:
> > src/.libs/lt-m4.c: In function `main':
> > src/.libs/lt-m4.c:288: warning: implicit declaration of function `_setmode'
>
> > OK to apply this?
>
> OK provided it's been tested under MinGW. I tested linux -> mingw
> cross, where _setmode is declared, and setmode is declared #if UWIN.
I've completed a test of cross-compiling cygwin->mingw, with no change in
behavior. I tweaked the patch slighly, since the call to setmode was only
emitted into the wrapper source for $host of *mingw* or *cygwin*, so I only
restricted the additional #include <io.h> to just __CYGWIN__ rather than
unconditionally (in case the cwrapper_exe is ever used on other platforms,
where setmode is not present). In the end, I committed this:
Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /sources/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.105
diff -u -p -r1.105 ltmain.m4sh
--- libltdl/config/ltmain.m4sh 10 Apr 2008 21:18:02 -0000 1.105
+++ libltdl/config/ltmain.m4sh 11 Apr 2008 17:19:00 -0000
@@ -2506,9 +2506,13 @@ EOF
# include <direct.h>
# include <process.h>
# include <io.h>
+# define setmode _setmode
#else
# include <unistd.h>
# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
#endif
#include <malloc.h>
#include <stdarg.h>
@@ -2652,7 +2656,7 @@ EOF
case "$host" in
*mingw* | *cygwin* )
# make stdout use "unix" line endings
- echo " _setmode(1,_O_BINARY);"
+ echo " setmode(1,_O_BINARY);"
;;
esac