diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-10 23:19:58 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-10 23:19:58 +0100 |
commit | c461a856bc3bca4b1190cf46a1d8a4f401f79b5c (patch) | |
tree | dae918632e8bfc1f3d0c23f00a23e7c2e68db4ef /common.h | |
parent | Add test from github issue #10 (diff) | |
download | libkeccak-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 '')
-rw-r--r-- | common.h | 17 |
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 |