View Issue Details

IDProjectCategoryView StatusLast Update
0000580OpenMPTlibopenmptpublic2014-08-26 11:29
Reporterwiz Assigned Tomanx  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSNetBSDOS Version7.99.1
Product VersionOpenMPT 1.23.04.00 / libopenmpt 0.2-beta5 (upgrade first) 
Summary0000580: libopenmpt-0.2.4115-beta5: struct ttysize does not provide used members.
Description

NetBSD defines both TIOCGSIZE and TIOCGWINSZ, but struct ttysize does not
contain the members openmpt123 wants to use. Reordering the ifdefs fixes the compilation problem for me.
Suggested patch attached.

TagsNo tags attached.
Attached Files
struct_ttysize.diff (925 bytes)   
$NetBSD$

NetBSD defines both TIOCGSIZE and TIOCGWINSZ, but struct ttysize does not
contain the referenced members.

--- openmpt123/openmpt123.hpp.orig	2014-02-01 16:52:29.000000000 +0000
+++ openmpt123/openmpt123.hpp
@@ -336,18 +336,18 @@ struct commandlineflags {
 					terminal_height = tmp;
 				}
 			}
-			#if defined(TIOCGSIZE)
-				struct ttysize ts;
-				if ( ioctl( STDERR_FILENO, TIOCGSIZE, &ts ) >= 0 ) {
-					terminal_width = ts.ts_cols;
-					terminal_height = ts.ts_rows;
-				}
-			#elif defined(TIOCGWINSZ)
+			#if defined(TIOCGWINSZ)
 				struct winsize ts;
 				if ( ioctl( STDERR_FILENO, TIOCGWINSZ, &ts ) >= 0 ) {
 					terminal_width = ts.ws_col;
 					terminal_height = ts.ws_row;
 				}
+			#elif defined(TIOCGSIZE)
+				struct ttysize ts;
+				if ( ioctl( STDERR_FILENO, TIOCGSIZE, &ts ) >= 0 ) {
+					terminal_width = ts.ts_cols;
+					terminal_height = ts.ts_rows;
+				}
 			#endif
 		}
 #endif
struct_ttysize.diff (925 bytes)   
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

manx

manx

2014-08-26 11:29

administrator   ~0001767

I commited your patch as r4215.

Issue History

Date Modified Username Field Change
2014-08-26 10:30 wiz New Issue
2014-08-26 10:30 wiz File Added: struct_ttysize.diff
2014-08-26 11:19 manx Assigned To => manx
2014-08-26 11:19 manx Status new => acknowledged
2014-08-26 11:29 manx Note Added: 0001767
2014-08-26 11:29 manx Status acknowledged => resolved
2014-08-26 11:29 manx Resolution open => fixed