summaryrefslogtreecommitdiff
path: root/bindings/hubbub/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/hubbub/utils.h')
-rw-r--r--bindings/hubbub/utils.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/bindings/hubbub/utils.h b/bindings/hubbub/utils.h
new file mode 100644
index 0000000..2e2aaf2
--- /dev/null
+++ b/bindings/hubbub/utils.h
@@ -0,0 +1,28 @@
+/*
+ * This file is part of libdom.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
+ */
+
+#ifndef dom_hubbub_utils_h_
+#define dom_hubbub_utils_h_
+
+#ifndef max
+#define max(a,b) ((a)>(b)?(a):(b))
+#endif
+
+#ifndef min
+#define min(a,b) ((a)<(b)?(a):(b))
+#endif
+
+#ifndef SLEN
+/* Calculate length of a string constant */
+#define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */
+#endif
+
+#ifndef UNUSED
+#define UNUSED(x) ((x)=(x))
+#endif
+
+#endif