set(HAVE_LIBSOCKET 0)
set(HAVE_SETLOCALE 1)
set(HAVE_SETMODE 1)
+set(HAVE__SETMODE 1)
set(HAVE_GETPEERNAME 1)
set(HAVE_GETSOCKNAME 1)
set(HAVE_GETHOSTNAME 1)
check_symbol_exists("setmode" "${CURL_INCLUDES}" HAVE_SETMODE)
check_symbol_exists("setrlimit" "${CURL_INCLUDES}" HAVE_SETRLIMIT)
+if(WIN32 OR CYGWIN)
+ check_function_exists("_setmode" HAVE__SETMODE)
+endif()
+
if(NOT _ssl_enabled)
check_symbol_exists("arc4random" "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM)
endif()
curl_pflags="${curl_pflags} UNIX";;
esac
fi
- case $host_os in
- cygwin*|msys*) curl_pflags="${curl_pflags} CYGWIN";;
- esac
+ if test "$curl_cv_cygwin" = 'yes'; then
+ curl_pflags="${curl_pflags} CYGWIN"
+ fi
case $host_os in
msys*) curl_pflags="${curl_pflags} MSYS";;
esac
;;
esac
+curl_cv_cygwin='no'
+case $host_os in
+ cygwin*|msys*) curl_cv_cygwin='yes';;
+esac
+
AM_CONDITIONAL([HAVE_WINDRES],
[test "$curl_cv_native_windows" = "yes" && test -n "${RC}"])
utimes \
])
+if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then
+ AC_CHECK_FUNCS([_setmode])
+fi
+
if test -z "$ssl_backends"; then
AC_CHECK_FUNCS([arc4random])
fi
/* Define if you have the setmode function. */
#define HAVE_SETMODE 1
+/* Define if you have the _setmode function. */
+#define HAVE__SETMODE 1
+
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
/* Define to 1 if you have the `setmode' function. */
#cmakedefine HAVE_SETMODE 1
+/* Define to 1 if you have the `_setmode' function. */
+#cmakedefine HAVE__SETMODE 1
+
/* Define to 1 if you have the `setrlimit' function. */
#cmakedefine HAVE_SETRLIMIT 1
***************************************************************************/
#include "tool_setup.h"
-#ifdef HAVE_SETMODE
+#if defined(HAVE_SETMODE) || defined(HAVE__SETMODE)
#ifdef HAVE_IO_H
# include <io.h>
#ifdef O_BINARY
# ifdef __HIGHC__
_setmode(stream, O_BINARY);
+# elif defined(HAVE__SETMODE)
+ (void)_setmode(fileno(stream), O_BINARY);
# else
(void)setmode(fileno(stream), O_BINARY);
# endif
#endif
}
-#endif /* HAVE_SETMODE */
+#endif /* HAVE_SETMODE || HAVE__SETMODE */
***************************************************************************/
#include "tool_setup.h"
-#ifdef HAVE_SETMODE
+#if defined(HAVE_SETMODE) || defined(HAVE__SETMODE)
void set_binmode(FILE *stream);
#define set_binmode(x) Curl_nop_stmt
-#endif /* HAVE_SETMODE */
+#endif /* HAVE_SETMODE || HAVE__SETMODE */
#endif /* HEADER_CURL_TOOL_BINMODE_H */