From d0f8b674d9c3ccd342abe51e02bb0998f6ad8244 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 14 Sep 2024 16:57:59 +0200 Subject: [PATCH] Fix ext/snmp for newer net-snmp versions on Windows 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. --- ext/snmp/snmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 7e8d4d0bc2fc1..1425cf12752a7 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -26,6 +26,11 @@ #include "php.h" #include "main/php_network.h" #include "ext/standard/info.h" + +#ifdef PHP_WIN32 +// avoid conflicting declarations of (v)asprintf() +# define HAVE_ASPRINTF +#endif #include "php_snmp.h" #include "zend_exceptions.h"