]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add struct-vs-array compatibility macros for jmp_buf and ether_[sd]host
authorTed Lemon <source@isc.org>
Thu, 16 May 1996 07:23:04 +0000 (07:23 +0000)
committerTed Lemon <source@isc.org>
Thu, 16 May 1996 07:23:04 +0000 (07:23 +0000)
includes/osdep.h
osdep.h

index be4bcf0c6eb2f07813b6281167e8c28471474256..77898cdc8c03607a8b230e52de860c856d5f28e8 100644 (file)
 #  define USE_NIT_SEND
 #  define USE_NIT_RECEIVE
 #endif
+
+/* jmp_buf is assumed to be a struct unless otherwise defined in the
+   system header. */
+#ifndef jbp_decl
+# define jbp_decl(x)   jmp_buf *x
+#endif
+#ifndef jref
+# define jref(x)       (&(x))
+#endif
+#ifndef jdref
+# define jdref(x)      (*(x))
+#endif
+
+/* On some systems, the struct ether_header source and destinations buffers
+   are arrays; on others, they are structs.   We assume they're arrays
+   unless otherwise defined in the system header. */
+#ifndef ETHER_SRC
+# define ETHER_SRC(x)  ((x) -> ether_shost)
+#endif
+#ifndef ETHER_DEST
+# define ETHER_DEST(x) ((x) -> ether_dhost)
+#endif
diff --git a/osdep.h b/osdep.h
index be4bcf0c6eb2f07813b6281167e8c28471474256..77898cdc8c03607a8b230e52de860c856d5f28e8 100644 (file)
--- a/osdep.h
+++ b/osdep.h
 #  define USE_NIT_SEND
 #  define USE_NIT_RECEIVE
 #endif
+
+/* jmp_buf is assumed to be a struct unless otherwise defined in the
+   system header. */
+#ifndef jbp_decl
+# define jbp_decl(x)   jmp_buf *x
+#endif
+#ifndef jref
+# define jref(x)       (&(x))
+#endif
+#ifndef jdref
+# define jdref(x)      (*(x))
+#endif
+
+/* On some systems, the struct ether_header source and destinations buffers
+   are arrays; on others, they are structs.   We assume they're arrays
+   unless otherwise defined in the system header. */
+#ifndef ETHER_SRC
+# define ETHER_SRC(x)  ((x) -> ether_shost)
+#endif
+#ifndef ETHER_DEST
+# define ETHER_DEST(x) ((x) -> ether_dhost)
+#endif