Remove the old dummynet directory and update the new code with the missing files...
[ipfw.git] / dummynet2 / include / sys / cdefs.h
diff --git a/dummynet2/include/sys/cdefs.h b/dummynet2/include/sys/cdefs.h
new file mode 100644 (file)
index 0000000..b95b4b7
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _CDEFS_H_
+#define _CDEFS_H_
+
+/*
+ * various compiler macros and common functions
+ */
+
+#ifndef __unused
+#define __unused       __attribute__ ((__unused__))
+#endif
+
+#ifndef __packed
+#define __packed       __attribute__ ((__packed__))
+#endif
+
+#ifndef __aligned
+#define __aligned(x) __attribute__((__aligned__(x)))
+#endif
+
+/* defined as assert */
+void panic(const char *fmt, ...);
+
+#define KASSERT(exp,msg) do {                                           \
+        if (__predict_false(!(exp)))                                    \
+                panic msg;                                              \
+} while (0)
+
+/* don't bother to optimize */
+#ifndef __predict_false
+#define __predict_false(x)   (x)       /* __builtin_expect((exp), 0) */
+#endif
+
+#endif /* !_CDEFS_H_ */