Commit 783474cf authored by Niels Möller's avatar Niels Möller

(TMP_ALLOC etc): Include <alloca.h> if

available.

Rev: src/nettle/nettle-internal.h:1.5
parent ccc7508e
......@@ -35,13 +35,13 @@
* fix maximum size, and abort if we ever need anything larger. */
#if HAVE_ALLOCA
# define TMP_DECL(name, type, max) \
type *name
# define TMP_ALLOC(name, size) \
(name = alloca(sizeof (*name) * size))
# if HAVE_ALLOCA_H
# include <alloca.h>
# endif
# define TMP_DECL(name, type, max) type *name
# define TMP_ALLOC(name, size) (name = alloca(sizeof (*name) * size))
#else /* !HAVE_ALLOCA */
# define TMP_DECL(name, type, max) \
type name[max]
# define TMP_DECL(name, type, max) type name[max]
# define TMP_ALLOC(name, size) \
do { if (size > (sizeof(name) / sizeof(name[0]))) abort(); } while (0)
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment