From 4c0a7af95505bb23d3d9c30693993f7b246816c6 Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Wed, 5 Oct 2005 15:19:56 +0000 Subject: [PATCH] Vendor fix for the build problem of snmp_pf. Move the fallback definitions for U?INT32_{MAX,MIN} from asn1.h into the .c files that actually require them (the .h file doesn't refer to these macros). --- contrib/bsnmp/lib/asn1.c | 10 ++++++++++ contrib/bsnmp/lib/asn1.h | 10 ---------- contrib/bsnmp/lib/snmpclient.c | 8 ++++++++ contrib/bsnmp/snmp_ntp/snmp_ntp.c | 10 ++++++++++ contrib/bsnmp/snmpd/main.c | 4 ++++ 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/contrib/bsnmp/lib/asn1.c b/contrib/bsnmp/lib/asn1.c index 67c1e25dda53..d72eee599902 100644 --- a/contrib/bsnmp/lib/asn1.c +++ b/contrib/bsnmp/lib/asn1.c @@ -43,6 +43,16 @@ #include #include "asn1.h" +#if !defined(INT32_MIN) +#define INT32_MIN (-0x7fffffff-1) +#endif +#if !defined(INT32_MAX) +#define INT32_MAX (0x7fffffff) +#endif +#if !defined(UINT32_MAX) +#define UINT32_MAX (0xffffffff) +#endif + static void asn_error_func(const struct asn_buf *, const char *, ...); void (*asn_error)(const struct asn_buf *, const char *, ...) = asn_error_func; diff --git a/contrib/bsnmp/lib/asn1.h b/contrib/bsnmp/lib/asn1.h index 9f7749ade175..ccbafc956723 100644 --- a/contrib/bsnmp/lib/asn1.h +++ b/contrib/bsnmp/lib/asn1.h @@ -179,14 +179,4 @@ enum { ASN_EXCEPT_ENDOFMIBVIEW = 0x02, }; -#if !defined(INT32_MIN) -#define INT32_MIN (-0x7fffffff-1) -#endif -#if !defined(INT32_MAX) -#define INT32_MAX (0x7fffffff) -#endif -#if !defined(UINT32_MAX) -#define UINT32_MAX (0xffffffff) -#endif - #endif diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index fa794f34d7e5..5e7d3517508c 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -64,6 +64,14 @@ #include "snmpclient.h" #include "snmppriv.h" +#if !defined(INT32_MAX) +#define INT32_MAX (0x7fffffff) +#endif +#if !defined(UINT32_MAX) +#define UINT32_MAX (0xffffffff) +#endif + + /* global context */ struct snmp_client snmp_client; diff --git a/contrib/bsnmp/snmp_ntp/snmp_ntp.c b/contrib/bsnmp/snmp_ntp/snmp_ntp.c index b798847dca0f..830c01f6b0d2 100644 --- a/contrib/bsnmp/snmp_ntp/snmp_ntp.c +++ b/contrib/bsnmp/snmp_ntp/snmp_ntp.c @@ -55,6 +55,16 @@ #include "ntp_tree.h" #include "ntp_oid.h" +#if !defined(INT32_MIN) +#define INT32_MIN (-0x7fffffff-1) +#endif +#if !defined(INT32_MAX) +#define INT32_MAX (0x7fffffff) +#endif +#if !defined(UINT32_MAX) +#define UINT32_MAX (0xffffffff) +#endif + #define NTPC_MAX 576 #define NTPC_VERSION 3 #define NTPC_MODE 6 diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c index 676c2027d50e..37ae33e7bc21 100644 --- a/contrib/bsnmp/snmpd/main.c +++ b/contrib/bsnmp/snmpd/main.c @@ -57,6 +57,10 @@ #include "tree.h" #include "oid.h" +#if !defined(INT32_MAX) +#define INT32_MAX (0x7fffffff) +#endif + #define PATH_PID "/var/run/%s.pid" #define PATH_CONFIG "/etc/%s.config"