Skip to content

Commit 6f5610c

Browse files
authored
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.
1 parent 1b171bb commit 6f5610c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/snmp/snmp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
#include "php.h"
2727
#include "main/php_network.h"
2828
#include "ext/standard/info.h"
29+
30+
#ifdef PHP_WIN32
31+
// avoid conflicting declarations of (v)asprintf()
32+
# define HAVE_ASPRINTF
33+
#endif
2934
#include "php_snmp.h"
3035

3136
#include "zend_exceptions.h"

0 commit comments

Comments
 (0)