Bug #67188 [Asn->Fbk]: phpdbg_utils.c needs termio.h

From: Date: Wed, 02 Jul 2014 19:45:20 +0000
Subject: Bug #67188 [Asn->Fbk]: phpdbg_utils.c needs termio.h
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186429@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67188&edit=1 ID: 67188 Updated by: tyrael@php.net Reported by: rainer dot jung at kippdata dot de Summary: phpdbg_utils.c needs termio.h -Status: Assigned +Status: Feedback Type: Bug Package: phpdbg Operating System: Solaris 10 Sparc PHP Version: 5.6.0beta2 Assigned To: tyrael Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2014-06-22 17:05:53] tyrael@php.net after fixing #67212 the compilation should finish, albeit we would fallback to the default terminal width (80). I'm not sure it is worth the trouble for adding additional HAVE_TERMIO_H checks, considering that termio.h isn't posix compliant, and solaris 11 is out for a while now(and has termios.h). what do you think? ------------------------------------------------------------------------ [2014-05-03 10:32:54] rainer dot jung at kippdata dot de Description: ------------ The new function phpdbg_get_terminal_width() in phpdbg_utils.c needs #include <termio.h> on Solaris 10. Otherwise compilations stops with: .../phpdbg_utils.c: In function 'phpdbg_get_terminal_width': .../phpdbg_utils.c:444:17: error: storage size of 'w' isn't known .../phpdbg_utils.c:446:34: error: 'TIOCGWINSZ' undeclared (first use in this function) The code is only used when HAVE_SYS_IOCTL_H is set. I suggest to add a configure test for HAVE_TERMIO_H and is both are defined add #include <termio.h> Patch would be --- sapi/phpdbg/phpdbg_utils.c 2014-05-01 16:42:03.000000000 +0200 +++ sapi/phpdbg/phpdbg_utils.c 2014-05-03 12:27:23.964463000 +0200 @@ -32,6 +32,9 @@ # include "win32/time.h" #elif defined(HAVE_SYS_IOCTL_H) # include "sys/ioctl.h" +#ifdef HAVE_TERMIO_H +# include "termio.h" +#endif #endif ZEND_EXTERN_MODULE_GLOBALS(phpdbg); Needed Autofoo adjustments probably (untested): --- configure.in 2014-05-01 16:42:03.000000000 +0200 +++ configure.in 2014-05-03 12:30:32.696237000 +0200 @@ -518,6 +518,7 @@ sys/varargs.h \ sys/wait.h \ sys/loadavg.h \ +termio.h \ termios.h \ unistd.h \ unix.h \ --- main/php_config.h.in 2014-05-02 00:05:58.000000000 +0200 +++ main/php_config.h.in 2014-05-03 12:30:49.051849000 +0200 @@ -1921,6 +1921,9 @@ /* Define to 1 if you have the `tempnam' function. */ #undef HAVE_TEMPNAM +/* Define to 1 if you have the <termio.h> header file. */ +#undef HAVE_TERMIO_H + /* Define to 1 if you have the <termios.h> header file. */ #undef HAVE_TERMIOS_H Test script: --------------- No test script, compilation already fails. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67188&edit=1

« previous php.bugs (#186429) next »