Skip to content

Commit

Permalink
Fix ext/snmp for newer net-snmp versions on Windows (GH-15888)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cmb69 authored Sep 20, 2024
1 parent 1b171bb commit 6f5610c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/snmp/snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6f5610c

Please sign in to comment.