mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
common.h: allow for no alloca.h on BSD
This commit is contained in:
parent
b4a20b24a2
commit
0d4aa6cce3
@ -33,6 +33,10 @@
|
|||||||
#ifndef Z_COMMON_H
|
#ifndef Z_COMMON_H
|
||||||
#define Z_COMMON_H
|
#define Z_COMMON_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
#define ARRAY_SIZE(x) ((int) (sizeof(x) / sizeof((x)[0])))
|
#define ARRAY_SIZE(x) ((int) (sizeof(x) / sizeof((x)[0])))
|
||||||
#endif
|
#endif
|
||||||
@ -41,7 +45,9 @@
|
|||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
# define z_alloca(nmemb) _alloca(nmemb)
|
# define z_alloca(nmemb) _alloca(nmemb)
|
||||||
#else
|
#else
|
||||||
|
# if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)) /* BSD */
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
|
# endif
|
||||||
# define z_alloca(nmemb) alloca(nmemb)
|
# define z_alloca(nmemb) alloca(nmemb)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -149,10 +155,6 @@ typedef unsigned __int64 uint64_t;
|
|||||||
# define set_module_colour(s, y, x, c) do { (s)->encoded_data[(y)][(x)] = (c); } while (0)
|
# define set_module_colour(s, y, x, c) do { (s)->encoded_data[(y)][(x)] = (c); } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
INTERNAL int ctoi(const char source);
|
INTERNAL int ctoi(const char source);
|
||||||
INTERNAL char itoc(const int source);
|
INTERNAL char itoc(const int source);
|
||||||
INTERNAL int to_int(const unsigned char source[], const int length);
|
INTERNAL int to_int(const unsigned char source[], const int length);
|
||||||
|
Loading…
Reference in New Issue
Block a user