x-engine-c
v0.2.13
The C engine for x-lang
Loading...
Searching...
No Matches
x.h
Go to the documentation of this file.
1
#ifndef X_H
2
#define X_H
3
30
#include <stdarg.h>
/* va_list */
31
32
/*#define X_USE_STDLIB*/
33
/*#define X_USE_STDLIB_NONSTD*/
34
/*#define X_HEAP*/
35
47
#define X_VERSION "0.1.0"
48
57
#ifndef X_MACHINE
58
#define X_MACHINE "undefined"
59
#endif
/* X_MACHINE */
60
61
#ifdef DEBUG
63
#define X_DEBUG_BUFFER_SIZE 65536
64
#endif
/* DEBUG */
65
77
#if __alpha__ || __alpha || _M_ALPHA
78
#define X_ARCH "alpha"
79
#elif __amd64__ || __amd64 || __x86_64__ || __x86_64 || _M_X64 || _M_AMD64
80
#define X_ARCH "amd64"
81
#elif __arm__ || __thumb__ || __TARGET_ARCH_ARM || __TARGET_ARCH_THUMB || _ARM || _M_ARM || _M_ARMT || __arm
82
#define X_ARCH "arm"
83
#elif __aarch64__
84
#define X_ARCH "arm64"
85
#elif __bfin || __BFIN__
86
#define X_ARCH "blackfin"
87
#elif __convex__
88
#define X_ARCH "convex"
89
#elif __epiphany__
90
#define X_ARCH "epiphany"
91
#elif __hppa__ || __HPPA__ || __hppa
92
#define X_ARCH "pa_risc"
93
#elif i386 || __i386 || __i386__ || __i386 || __i386 || __IA32__ || _M_I86 || _M_IX86 || __X86__ || _X86_ || __THW_INTEL__ || __I86__ || __INTEL__ || __386
94
#define X_ARCH "x86"
95
#elif __ia64__ || _IA64 || __IA64__ || __ia64 || _M_IA64 || _M_IA64 || __itanium__
96
#define X_ARCH "ia64"
97
#elif __m68k__ || M68000 || __MC68K__
98
#define X_ARCH "m68k"
99
#elif __mips__ || mips || __mips || __MIPS__
100
#define X_ARCH "mips"
101
#elif __powerpc || __powerpc__ || __powerpc64__ || __POWERPC__ || __ppc__ || __ppc64__ || __PPC__ || __PPC64__ || _ARCH_PPC || _ARCH_PPC64 || _M_PPC || _ARCH_PPC || _ARCH_PPC64 || __ppc
102
#define X_ARCH "powerpc"
103
#elif pyr
104
#define X_ARCH "pyramid9810"
105
#elif __THW_RS6000 || _IBMR2 || _POWER || _ARCH_PWR || _ARCH_PWR2 || _ARCH_PWR3 || _ARCH_PWR4
106
#define X_ARCH "rs6000"
107
#elif __sparc__ || __sparc
108
#define X_ARCH "sparc"
109
#elif __sh__
110
#define X_ARCH "superh"
111
#elif __370__ || __THW_370__ || __s390__ || __s390x__ || __zarch__ || __SYSC_ZARCH__
112
#define X_ARCH "systemz"
113
#elif _TMS320C2XX || __TMS320C2000__ || _TMS320C5X || __TMS320C55X__ || TMS320C6X || __TMS320C6X__
114
#define X_ARCH "tms320"
115
#elif __TMS470__
116
#define X_ARCH "tms470"
117
#else
118
#define X_ARCH "undefined"
119
#endif
120
129
typedef
long
x_int_t
;
130
132
#define X_INT_STR_PRINTF_CONV "l"
133
135
typedef
char
x_assert_int_ptr_size
[
sizeof
(
x_int_t
) ==
sizeof
(
void
*) ? 1 : -1];
136
138
typedef
char
x_char_t
;
139
141
#define X_INT_CHAR_PRINTF_CONV "c"
142
151
#define X_STR_LITERAL(s) (x_char_t *)(s), (sizeof(s) - 1)
152
160
#ifdef DEBUG
161
163
void
_x_debug_va(
char
*file,
long
unsigned
line,
int
fd,
char
*fmt, va_list ap);
164
175
#define x_debug_va(fd, fmt, ap) _x_debug_va(__FILE__, __LINE__, fd, fmt, ap)
176
178
void
_x_debug(
char
*file,
long
unsigned
line,
int
fd,
char
*fmt, ...);
179
190
#define x_debug(fd, fmt, ...) _x_debug(__FILE__, __LINE__, fd, fmt, __VA_ARGS__)
191
192
#else
/* DEBUG */
193
195
#define x_debug_va(fd, fmt, ap) {}
197
#define x_debug(fd, fmt, ...) {}
198
199
#endif
/* DEBUG */
200
204
void
x_error
(
int
fd,
x_char_t
*message,
x_char_t
*p_text);
205
206
#endif
/* X_H */
x_error
void x_error(int fd, x_char_t *message, x_char_t *p_text)
Definition
x.c:27
x_int_t
long x_int_t
Definition
x.h:129
x_assert_int_ptr_size
char x_assert_int_ptr_size[sizeof(x_int_t)==sizeof(void *) ? 1 :-1]
Definition
x.h:135
x_char_t
char x_char_t
Definition
x.h:138
ext
x-expr
include
x.h
Generated by
1.9.8