summaryrefslogtreecommitdiffstats
path: root/contrib/bsnmp/lib/support.h
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2006-02-27 16:16:18 +0000
committerharti <harti@FreeBSD.org>2006-02-27 16:16:18 +0000
commit9b4fc3d8f13de6a6c075d5b243b2e8370bd35367 (patch)
tree8b4bdaf89989b90cdbdc0b6e86d7cbd38ff6174f /contrib/bsnmp/lib/support.h
parenta923e07ab3efd8202b4be3f02e729f61e7aef5af (diff)
downloadFreeBSD-src-9b4fc3d8f13de6a6c075d5b243b2e8370bd35367.zip
FreeBSD-src-9b4fc3d8f13de6a6c075d5b243b2e8370bd35367.tar.gz
Virgin import of bsnmpd 1.12
Diffstat (limited to 'contrib/bsnmp/lib/support.h')
-rw-r--r--contrib/bsnmp/lib/support.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/contrib/bsnmp/lib/support.h b/contrib/bsnmp/lib/support.h
index 53aba2c..415c85b 100644
--- a/contrib/bsnmp/lib/support.h
+++ b/contrib/bsnmp/lib/support.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004
+ * Copyright (C) 2004-2005
* Hartmut Brandt.
* All rights reserved.
*
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/lib/support.h,v 1.1 2004/08/06 08:47:59 brandt Exp $
+ * $Begemot: bsnmp/lib/support.h,v 1.2 2005/10/06 07:14:59 brandt_h Exp $
*
* Functions that are missing on certain systems. This header file is not
* to be installed.
@@ -68,4 +68,29 @@ void freeaddrinfo(struct addrinfo *);
#endif
+/*
+ * For systems with missing stdint.h or inttypes.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
+
+/*
+ * Systems missing SA_SIZE(). Taken from FreeBSD net/route.h:1.63
+ */
+#ifndef SA_SIZE
+
+#define SA_SIZE(sa) \
+ ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \
+ sizeof(long) : \
+ 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) )
+
+#endif
+
#endif
OpenPOWER on IntegriCloud