libtool-patches
[Top][All Lists]
Advanced

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

Avoid warning on cygwin


From: Eric Blake
Subject: Avoid warning on cygwin
Date: Thu, 10 Apr 2008 16:56:07 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

The libtool wrapper executable is triggering a warning when building on cygwin:

src/.libs/lt-m4.c: In function `main':
src/.libs/lt-m4.c:288: warning: implicit declaration of function `_setmode'

Cygwin declares setmode in <io.h>, whereas mingw declares _setmode in <io.h>.  
Even though <io.h> is not standard, my understanding is that the cwrapperexe is 
only created on platforms where it is present.

OK to apply this?

2008-04-10  Eric Blake  <address@hidden>

        Avoid usage of setmode without declaration on cygwin.
        * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src): Ensure
        setmode has prototype for both mingw and cygwin.

Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /sources/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.102
diff -u -p -r1.102 ltmain.m4sh
--- libltdl/config/ltmain.m4sh  16 Mar 2008 08:34:25 -0000      1.102
+++ libltdl/config/ltmain.m4sh  10 Apr 2008 16:54:24 -0000
@@ -2514,10 +2514,11 @@ EOF
            cat <<"EOF"
 #include <stdio.h>
 #include <stdlib.h>
+#include <io.h>
 #ifdef _MSC_VER
 # include <direct.h>
 # include <process.h>
-# include <io.h>
+# define setmode _setmode
 #else
 # include <unistd.h>
 # include <stdint.h>
@@ -2664,7 +2665,7 @@ EOF
            case "$host" in
              *mingw* | *cygwin* )
                # make stdout use "unix" line endings
-               echo "          _setmode(1,_O_BINARY);"
+               echo "          setmode(1,_O_BINARY);"
                ;;
              esac
 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]