src/flac/utils.c: Fix for OpenBSD
authorErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 26 Jan 2016 01:50:44 +0000 (12:50 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 26 Jan 2016 02:03:31 +0000 (13:03 +1100)
OpenBSD defineds `TIOCGWINSZ` in `termios.h` which is already being
included, so this fix should work on most POSIX systems.

Closes: https://sourceforge.net/p/flac/bugs/435/

src/flac/utils.c

index 444c98e..a384eff 100644 (file)
@@ -183,7 +183,7 @@ int get_console_width(void)
        int s[2];
        _scrsize (s);
        width = s[0];
-#elif defined GWINSZ_IN_SYS_IOCTL
+#elif defined TIOCGWINSZ
        struct winsize w;
        if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
                width = w.ws_col;