aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-10 23:19:58 +0100
committerMattias Andrée <maandree@kth.se>2019-02-10 23:19:58 +0100
commitc461a856bc3bca4b1190cf46a1d8a4f401f79b5c (patch)
treedae918632e8bfc1f3d0c23f00a23e7c2e68db4ef /common.h
parentAdd test from github issue #10 (diff)
downloadlibkeccak-c461a856bc3bca4b1190cf46a1d8a4f401f79b5c.tar.gz
libkeccak-c461a856bc3bca4b1190cf46a1d8a4f401f79b5c.tar.bz2
libkeccak-c461a856bc3bca4b1190cf46a1d8a4f401f79b5c.tar.xz
General API improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/common.h b/common.h
new file mode 100644
index 0000000..1245bf6
--- /dev/null
+++ b/common.h
@@ -0,0 +1,17 @@
+/* See LICENSE file for copyright and license details. */
+#include "libkeccak.h"
+
+
+#include <sys/stat.h>
+#include <alloca.h>
+#include <errno.h>
+#include <unistd.h>
+
+
+/* Use built in functions and branching optimisation if available */
+#ifndef __GNUC__
+# define __builtin_expect(expression, expect) expression
+# define __builtin_memset(dest, c, n) memset(dest, c, n)
+# define __builtin_memcpy(dest, src, n) memcpy(dest, src, n)
+# define __builtin_memmove(dest, src, n) memmove(dest, src, n)
+#endif