mirror of
https://github.com/mpv-player/mpv
synced 2024-09-09 01:16:56 +02:00
Define HAVE_SETMODE conditionally, and use it in stream/stream_file.c instead
of platform specific predefined macros. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30829 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
66278a55ec
commit
b10a6917f4
13
configure
vendored
13
configure
vendored
@ -4050,6 +4050,17 @@ fi
|
||||
echores "$_setenv"
|
||||
|
||||
|
||||
echocheck "setmode()"
|
||||
_setmode=no
|
||||
def_setmode='#define HAVE_SETMODE 0'
|
||||
cat > $TMPC << EOF
|
||||
#include <io.h>
|
||||
int main(void) { setmode(0, 0); return 0; }
|
||||
EOF
|
||||
cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
|
||||
echores "$_setmode"
|
||||
|
||||
|
||||
if sunos; then
|
||||
echocheck "sysi86()"
|
||||
cat > $TMPC << EOF
|
||||
@ -8870,6 +8881,7 @@ $def_nanosleep
|
||||
$def_posix_select
|
||||
$def_select
|
||||
$def_setenv
|
||||
$def_setmode
|
||||
$def_shm
|
||||
$def_strsep
|
||||
$def_swab
|
||||
@ -9225,7 +9237,6 @@ $def_yasm
|
||||
#define HAVE_LDBRX 0
|
||||
#define HAVE_POLL_H 1
|
||||
#define HAVE_PPC4XX 0
|
||||
#define HAVE_SETMODE 0
|
||||
#define HAVE_SYS_SELECT_H 0
|
||||
#define HAVE_VFP_ARGS 1
|
||||
#define HAVE_VIRTUALALLOC 0
|
||||
|
@ -145,13 +145,13 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
|
||||
// read from stdin
|
||||
mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN);
|
||||
f=0; // 0=stdin
|
||||
#if defined(__MINGW32__) || defined(__OS2__)
|
||||
#if HAVE_SETMODE
|
||||
setmode(fileno(stdin),O_BINARY);
|
||||
#endif
|
||||
} else {
|
||||
mp_msg(MSGT_OPEN,MSGL_INFO,"Writing to stdout\n");
|
||||
f=1;
|
||||
#if defined(__MINGW32__) || defined(__OS2__)
|
||||
#if HAVE_SETMODE
|
||||
setmode(fileno(stdout),O_BINARY);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user