]> git.proxmox.com Git - mirror_frr.git/commitdiff
[lib] include inttypes.h rather than stdint.h, provide defines where missing
authorPaul Jakma <paul.jakma@sun.com>
Sun, 28 May 2006 08:08:24 +0000 (08:08 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Sun, 28 May 2006 08:08:24 +0000 (08:08 +0000)
2006-05-28 Paul Jakma <paul.jakma@sun.com>

* zebra.h: Include inttypes.h rather than stdint.h, best practice
  according to the autoconf manual.
  Add UINT*_MAX defines for older platforms lacking these (FBSD 4)

lib/ChangeLog
lib/zebra.h

index db3c546c636fa04e4a6284c4ea3ce0a679d89512..b857b135f4670c1b0b190069771fd33aa273df0e 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-28 Paul Jakma <paul.jakma@sun.com>
+
+       * zebra.h: Include inttypes.h rather than stdint.h, best practice
+         according to the autoconf manual.
+         Add UINT*_MAX defines for older platforms lacking these (FBSD 4)
+
 2006-05-21 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * if.h: (struct connected) Document the meaning of the
index bf7509e2ca38a21b9e42dc784013d96f94f687a3..2e2f8cda03b2ed3e7159ee694ebc7fd86e78b6f8 100644 (file)
@@ -82,9 +82,9 @@ typedef int socklen_t;
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif /* HAVE_LIMITS_H */
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif /* HAVE_STDINT_H */
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif /* HAVE_INTTYPES_H */
 
 /* machine dependent includes */
 #ifdef SUNOS_5
@@ -206,10 +206,27 @@ typedef int socklen_t;
 #include <netinet6/nd6.h>
 #endif /* HAVE_NETINET6_ND6_H */
 
-/* Some systems do not define UINT32_MAX */
+/* Some systems do not define UINT32_MAX, etc.. from inttypes.h
+ * e.g. this makes life easier for FBSD 4.11 users.
+ */
+#ifndef INT8_MAX
+#define INT8_MAX       (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX      (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX      (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX      (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX     (65535U)
+#endif
 #ifndef UINT32_MAX
-#define UINT32_MAX 0xFFFFFFFFU
-#endif /* UINT32_MAX */
+#define UINT32_MAX     (4294967295U)
+#endif
 
 #ifdef HAVE_LIBUTIL_H
 #include <libutil.h>