fix: define _DEFAULT_SOURCE and _BSD_SOURCE for BSD types

On newer glibc versions, BSD types like u_char are only available
when _DEFAULT_SOURCE or _BSD_SOURCE feature test macros are defined.

Define these macros before including any headers to ensure BSD types
are available for net-snmp headers.
This commit is contained in:
Graham McIntire 2026-01-30 13:17:17 -06:00
parent bcba9e67a0
commit 522223c57c

View file

@ -1,6 +1,10 @@
// Pure C NIF for net-snmp MIB resolution
// Directly links to libnetsnmp without Rust layer
// Enable BSD types (u_char, u_short, etc.) on newer glibc
#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#include <erl_nif.h>
#include <sys/types.h>
#include <net-snmp/net-snmp-config.h>