blob: 4efe2d6275398525e1a9ac812e23c427d10f3545 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/* $OpenBSD: mk_cmds_defs.h,v 1.1 1996/11/15 09:26:08 downsj Exp $ */
#include <stdio.h>
#include <string.h>
#ifdef __STDC__
#define PROTOTYPE(p) p
typedef void * pointer;
#else
#define const
#define volatile
#define PROTOTYPE(p) ()
typedef char * pointer;
#endif /* not __STDC__ */
#if defined(__GNUC__)
#define LOCAL_ALLOC(x) __builtin_alloca(x)
#define LOCAL_FREE(x)
#else
#if defined(vax)
#define LOCAL_ALLOC(x) alloca(x)
#define LOCAL_FREE(x)
extern pointer alloca PROTOTYPE((unsigned));
#else
#if defined(__HIGHC__) /* Barf! */
pragma on(alloca);
#define LOCAL_ALLOC(x) alloca(x)
#define LOCAL_FREE(x)
extern pointer alloca PROTOTYPE((unsigned));
#else
/* no alloca? */
#define LOCAL_ALLOC(x) malloc(x)
#define LOCAL_FREE(x) free(x)
#endif
#endif
#endif /* LOCAL_ALLOC stuff */
|