#define DEFAULT_MAXREDIRS 50L
+#if defined(O_BINARY) && defined(HAVE_SETMODE)
+ #ifdef __HIGHC__
+ #define SET_BINMODE(file) _setmode(file,O_BINARY)
+ #else
+ #define SET_BINMODE(file) setmode(fileno(file),O_BINARY)
+ #endif
+#else
+ #define SET_BINMODE(file) ((void)0)
+#endif
+
#ifdef __DJGPP__
#include <dos.h>
if(curlx_strequal("-", nextarg)) {
file = stdin;
-#if defined(O_BINARY) && defined(HAVE_SETMODE)
if(subletter == 'b') /* forced binary */
- setmode(fileno(stdin), O_BINARY);
-#endif
+ SET_BINMODE(stdin);
}
else {
file = fopen(nextarg, "rb");
}
else if(uploadfile && curlx_strequal(uploadfile, "-")) {
-#if defined(O_BINARY) && defined(HAVE_SETMODE)
- setmode(fileno(stdin), O_BINARY);
-#endif
+ SET_BINMODE(stdin);
infd = stdin;
}
if(!config->errors)
config->errors = stderr;
-#if defined(O_BINARY) && defined(HAVE_SETMODE)
if(!outfile && !(config->conf & CONF_GETTEXT)) {
/* We get the output to stdout and we have not got the ASCII/text flag,
then set stdout to be binary */
- setmode( fileno(stdout), O_BINARY );
+ SET_BINMODE(stdout);
}
-#endif
if(1 == config->tcp_nodelay)
my_setopt(curl, CURLOPT_TCP_NODELAY, 1);