Bug #72384 [Csd]: php_log_err fails with undeclared identifier
| From: | phpdev at ehrhardt dot nl | Date: | Wed, 15 Jun 2016 10:57:57 +0000 |
| Subject: | Bug #72384 [Csd]: php_log_err fails with undeclared identifier | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201642@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72384&edit=1
ID: 72384
User updated by: phpdev at ehrhardt dot nl
Reported by: phpdev at ehrhardt dot nl
Summary: php_log_err fails with undeclared identifier
Status: Closed
Type: Bug
Package: Compile Failure
Operating System: *
PHP Version: 7.1.0alpha1
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
Aha! Anatol was as quick as always.
Previous Comments:
------------------------------------------------------------------------
[2016-06-15 10:50:54] derick@php.net
It is also not only Windows. But it *is* fixed (in PHP) already in https://github.com/php/php-src/commit/d2bc82586b67882fdcdabac8e05cfbb4104bfd47
------------------------------------------------------------------------
[2016-06-14 23:36:01] phpdev at ehrhardt dot nl
@Pierre: the problem is a generic one. Every extension that calls php_log_err() will fail to compile
with PHP 7.1 on Windows. I just took xdebug as example, because that is where I encountered it and
where I applied the workaround.
------------------------------------------------------------------------
[2016-06-14 23:30:24] phpdev at ehrhardt dot nl
@kronecker8: with which PHP version?
------------------------------------------------------------------------
[2016-06-14 23:23:07] kronecker8 at gmail dot com
I got this bug on Ubuntu 14.04 (x64). Can anybody help me?
------------------------------------------------------------------------
[2016-06-11 21:08:11] phpdev at ehrhardt dot nl
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 this bug report at https://bugs.php.net/bug.php?id=72384&edit=1