2011-10-03 16:59:38 -04:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2020-11-05 02:22:10 -05:00
|
|
|
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2011-10-03 16:59:38 -04:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2020-11-04 08:02:01 -05:00
|
|
|
* are also available at https://curl.se/docs/copyright.html.
|
2011-10-03 16:59:38 -04:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2012-04-06 17:35:15 -04:00
|
|
|
#include "tool_setup.h"
|
2011-10-03 16:59:38 -04:00
|
|
|
|
|
|
|
#ifdef HAVE_SETMODE
|
|
|
|
|
|
|
|
#ifdef HAVE_IO_H
|
|
|
|
# include <io.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_FCNTL_H
|
|
|
|
# include <fcntl.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "tool_binmode.h"
|
|
|
|
|
2013-01-03 20:50:28 -05:00
|
|
|
#include "memdebug.h" /* keep this as LAST include */
|
2011-10-03 16:59:38 -04:00
|
|
|
|
|
|
|
void set_binmode(FILE *stream)
|
|
|
|
{
|
2011-10-04 20:58:18 -04:00
|
|
|
#ifdef O_BINARY
|
|
|
|
# ifdef __HIGHC__
|
2011-10-03 16:59:38 -04:00
|
|
|
_setmode(stream, O_BINARY);
|
2011-10-04 20:58:18 -04:00
|
|
|
# else
|
2014-12-14 16:31:10 -05:00
|
|
|
(void)setmode(fileno(stream), O_BINARY);
|
2011-10-04 20:58:18 -04:00
|
|
|
# endif
|
2011-10-05 16:27:29 -04:00
|
|
|
#else
|
|
|
|
(void)stream;
|
2011-10-03 16:59:38 -04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* HAVE_SETMODE */
|