Fix ext/snmp for newer net-snmp versions on Windows (GH-15888)

As of net-snmp 5.8.0, the library defines their own `(v)asprintf()` if
not available on the system.  However, PHP also does this, so when
building ext/snmp there would be conflicting declarations on Windows.
To avoid this, we explictly define `HAVE_ASPRINTF`, so net-snmp does
not redeclare when its headers are included.
This commit is contained in:
Christoph M. Becker 2024-09-20 23:59:17 +02:00 committed by GitHub
parent 1b171bb6b4
commit 6f5610ccc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,6 +26,11 @@
#include "php.h" #include "php.h"
#include "main/php_network.h" #include "main/php_network.h"
#include "ext/standard/info.h" #include "ext/standard/info.h"
#ifdef PHP_WIN32
// avoid conflicting declarations of (v)asprintf()
# define HAVE_ASPRINTF
#endif
#include "php_snmp.h" #include "php_snmp.h"
#include "zend_exceptions.h" #include "zend_exceptions.h"