]> The Tcpdump Group git mirrors - libpcap/blobdiff - gencode.c
In gencode.c use SWAPLONG() from pcap-util.h.
[libpcap] / gencode.c
index 3ddd8b4c18e99a3d61bfa84a99394258371e3da5..7cd144cd816118dd57a11db98a1c26f67d5aac87 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -47,6 +47,7 @@
 #include "pcap/sll.h"
 #include "pcap/ipnet.h"
 #include "diag-control.h"
+#include "pcap-util.h"
 
 #include "scanner.h"
 
@@ -2097,14 +2098,6 @@ gen_false(compiler_state_t *cstate)
        return gen_uncond(cstate, 0);
 }
 
-/*
- * Byte-swap a 32-bit number.
- * ("htonl()" or "ntohl()" won't work - we want to byte-swap even on
- * big-endian platforms.)
- */
-#define        SWAPLONG(y) \
-((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))
-
 /*
  * Generate code to match a particular packet type.
  *