Re: [mpg123-devel] Please test new network code in/out of mpg123 (now with HTTPS support)!
Brought to you by:
sobukus
From: Thomas O. <tho...@or...> - 2022-05-14 04:30:13
|
Am Fri, 13 May 2022 19:28:07 -0700 schrieb Dave Yeo <dav...@gm...>: > The CFLAGS has -DOS2 in it, probably put there by configure, so it is fine Heh, yes. Silly me. AC_CHECK_HEADER([os2.h], [ADD_CPPFLAGS="$ADD_CPPFLAGS -DOS2"]) But we could skip that definition and instead use __OS2__? Would that exclude anyone? > >>> Also, this snippet in local.c: > >>> > >>> #ifdef __EMX__ > >>> /* Special ways for OS/2 EMX */ > >>> #include <stdlib.h> > >>> #else > >>> /* POSIX stuff */ > >>> #ifdef HAVE_TERMIOS > >>> #include <termios.h> > >>> #include <sys/ioctl.h> > >>> #endif > >>> #endif > OK, it _should_ have worked with EMX as it had better term support. Not > sure why it was disabled, happened before my time. So I'll just drop that part. We're not testing with EMX anymore? > I think using isatty() would be fine, or using HAVE_TERMIOS as is which > seems fine as well. Well, it's about the runtime check. Let's look at that snippet: int term_width(int fd) { #ifdef __EMX__ /* OS/2 */ int s[2]; _scrsize (s); if (s[0] >= 0) return s[0]; #else #ifdef HAVE_TERMIOS /* POSIX */ struct winsize geometry; geometry.ws_col = 0; if(ioctl(fd, TIOCGWINSZ, &geometry) >= 0) return (int)geometry.ws_col; #else So you're currently running the ioctl()? Is mpg123 able to get the terminal width that way? Does it always attempt terminal control by default, giving you that error message about tcsetattr? I committed a change that omits the tcsetattr() on __OS2__. Does that make terminal control work for you (with some uglyness because input is echoed)? Maybe I'll also just omit the error check for tcsetattr and treat this as a fallback mode. We wouldn't have special code for OS/2 then, as things build and might get fixed properly for runtime. Alrighty then, Thomas |