Re: [mpg123-devel] Please test new network code in/out of mpg123 (now with HTTPS support)!
Brought to you by:
sobukus
From: Dave Y. <dav...@gm...> - 2022-05-13 14:57:19
|
On 05/13/22 12:18 AM, Thomas Orgis wrote: > … please test the updated state in svn trunk (with autoreconf). I added > detection of _setmode() (Windows) and setmode() nd introduced a common > place for calling those. > > Index: src/compat/compat.c > =================================================================== > --- src/compat/compat.c (revisión: 5064) > +++ src/compat/compat.c (copia de trabajo) > @@ -155,6 +155,15 @@ > return fclose(stream); > } > > +void compat_binmode(int fd, int enable) > +{ > +#if defined(HAVE__SETMODE) > + _setmode(fd, enable ? _O_BINARY : _O_TEXT) > +#elif defined(HAVE_SETMODE) > + setmode(fd, enable ? O_BINARY : O_TEXT) > +#endif > +} > + > > Index: src/net123_exec.c > =================================================================== > --- src/net123_exec.c (revisión: 5064) > +++ src/net123_exec.c (copia de trabajo) > @@ -227,6 +227,9 @@ > return NULL; > } > > + compat_binmode(fd[0], TRUE); > + compat_binmode(fd[1], TRUE); > + > nh->worker = fork(); > if(nh->worker == -1) > { > > > Does that do the trick? > Unluckily it seems that io.h also declares _setmode() but not _O_BINARY or _O_TEXT. ... libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../mpg123.svn -I./src -DPKGLIBDIR=\"h:/tmp/mpg123/lib/mpg123\" -I../mpg123.svn/src -I../mpg123.svn/src/compat -I../mpg123.svn/src/libmpg123 -I../mpg123.svn/src/libout123 -I./src/libmpg123 -I./src/libsyn123 -I./src/libout123 -DOS2 -DOPT_GENERIC -DREAL_IS_FLOAT -DNEWOLD_WRITE_SAMPLE -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math -g -O2 -MT src/compat/compat.lo -MD -MP -MF src/compat/.deps/compat.Tpo -c ../mpg123.svn/src/compat/compat.c -DDLL_EXPORT -DPIC -o src/compat/.libs/compat.o ../mpg123.svn/src/compat/compat.c: In function 'compat_binmode': ../mpg123.svn/src/compat/compat.c:161:2: warning: implicit declaration of function '_setmode' [-Wimplicit-function-declaration] 161 | _setmode(fd, enable ? _O_BINARY : _O_TEXT); | ^~~~~~~~ ../mpg123.svn/src/compat/compat.c:161:24: error: '_O_BINARY' undeclared (first use in this function); did you mean 'O_BINARY'? 161 | _setmode(fd, enable ? _O_BINARY : _O_TEXT); | ^~~~~~~~~ | O_BINARY ../mpg123.svn/src/compat/compat.c:161:24: note: each undeclared identifier is reported only once for each function it appears in ../mpg123.svn/src/compat/compat.c:161:36: error: '_O_TEXT' undeclared (first use in this function); did you mean 'O_TEXT'? 161 | _setmode(fd, enable ? _O_BINARY : _O_TEXT); | ^~~~~~~ | O_TEXT make: *** [src/compat/compat.lo] Error 1 Dave |