Bug #72384 [NEW]: php_log_err fails with undeclared identifier
| From: | phpdev at ehrhardt dot nl | Date: | Sat, 11 Jun 2016 21:08:14 +0000 |
| Subject: | Bug #72384 [NEW]: php_log_err fails with undeclared identifier | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-201539@lists.php.net to get a copy of this message | ||
From: phpdev at ehrhardt dot nl
Operating system: Windows
PHP version: 7.1.0alpha1
Package: Compile Failure
Bug Type: Bug
Bug description:php_log_err fails with undeclared identifier
Description:
------------
If an extension (like xdebug) uses php_log_err() the build on Windows
fails with
ext\xdebug\xdebug_stack.c(172): error C2065: 'LOG_NOTICE': undeclared
identifier
This is caused by the following:
php_log_err() has been removed from main/main.c and is replaced by
php_log_err_with_severity()
php_log_err is now in main/php.h:
#define php_log_err(msg) php_log_err_with_severity(msg, LOG_NOTICE)
However, LOG_NOTICE is undefined on Windows when win32/syslog.h is not
included (where is is defined as 6).
Test script:
---------------
Try to compile any extension that uses php_log_err() on Windows. xdebug
has some other issues, but the solution is to add these lines in any
c-file that calls php_log_err():
#if defined(WIN32) && PHP_VERSION_ID >= 70100
#include "win32/syslog.h"
#endif
This is a workaround. It should be solved in core.
Expected result:
----------------
no build failure on Windows
Actual result:
--------------
Fatal error C2065: 'LOG_NOTICE': undeclared identifier
--
Edit bug report at https://bugs.php.net/bug.php?id=72384&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72384&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72384&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72384&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72384&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72384&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72384&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72384&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72384&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72384&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72384&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72384&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72384&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72384&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72384&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72384&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72384&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72384&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72384&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72384&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72384&r=mysqlcfg