Skip to content
Snippets Groups Projects
Commit 783474cf authored by Niels Möller's avatar Niels Möller
Browse files

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

available.

Rev: src/nettle/nettle-internal.h:1.5
parent ccc7508e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment