1 /* Copyright (C) 2001-2009, Parrot Foundation.
7 * Platform-specific config file
11 #ifndef PARROT_CONFIG_H_GUARD
12 #define PARROT_CONFIG_H_GUARD
15 ** ONLY PUT EMBEDDER-ACCESSIBLE SYMBOLS UP HERE!!!
16 ** Other symbols may go below.
19 #define PARROT_VERSION "@VERSION@@DEVEL@"
20 #define PARROT_CONFIG_DATE "@configdate@"
21 #define PARROT_MAJOR_VERSION @MAJOR@
22 #define PARROT_MINOR_VERSION @MINOR@
23 #define PARROT_PATCH_VERSION @PATCH@
24 #define PARROT_ARCHNAME "@cpuarch@-@osname@"
25 #define PARROT_JIT_CAPABLE @jitcapable@
26 #define PARROT_EXEC_CAPABLE @execcapable@
27 #define PARROT_SHARE_EXT "@share_ext@"
28 #define PARROT_LOAD_EXT "@load_ext@"
29 #define PARROT_OBJ_EXT "@o@"
31 typedef @iv@ Parrot_Int;
32 typedef unsigned @iv@ Parrot_UInt;
33 typedef @nv@ Parrot_Float;
34 typedef @opcode_t@ Parrot_Opcode;
35 typedef void * Parrot_Pointer;
37 typedef char Parrot_Int1;
38 typedef unsigned char Parrot_UInt1;
39 typedef @int2_t@ Parrot_Int2;
40 typedef unsigned @int2_t@ Parrot_UInt2;
41 typedef @int4_t@ Parrot_Int4;
42 typedef unsigned @int4_t@ Parrot_UInt4;
44 typedef @float4_t@ Parrot_Float4;
45 typedef @float8_t@ Parrot_Float8;
47 #include "parrot/platform_limits.h"
48 #ifndef PARROT_INTVAL_MIN
49 # define PARROT_INTVAL_MIN @intvalmin@
51 #ifndef PARROT_INTVAL_MAX
52 # define PARROT_INTVAL_MAX @intvalmax@
55 #ifndef PARROT_FLOATVAL_MIN
56 # define PARROT_FLOATVAL_MIN @floatvalmin@
58 #ifndef PARROT_FLOATVAL_MAX
59 # define PARROT_FLOATVAL_MAX @floatvalmax@
62 /* Temporary until we find a way to make it work in the right place. */
63 struct PackFile; typedef struct PackFile * Parrot_PackFile;
65 /* Symbol export and import decoration. At the time of writing, note that
66 * PARROT_IN_CORE won't always imply !PARROT_IN_EXTENSION. */
67 #if defined(PARROT_IN_EXTENSION)
68 #if defined(__cplusplus)
69 # define PARROT_EXPORT extern "C" @sym_import@
70 # define PARROT_DATA extern "C" @sym_import@
71 # define PARROT_DYNEXT_EXPORT extern "C" @sym_export@
73 # define PARROT_EXPORT @sym_import@
74 # define PARROT_DATA extern @sym_import@
75 # define PARROT_DYNEXT_EXPORT @sym_export@
78 #if defined(__cplusplus)
79 # define PARROT_EXPORT extern "C" @sym_export@
80 # define PARROT_DATA extern "C" @sym_export@
82 # define PARROT_EXPORT @sym_export@
83 # define PARROT_DATA extern @sym_export@
87 #define PARROT_NOINLINE @noinline@
89 #if defined(PARROT_IN_CORE)
91 /* Put any other symbols here. */
95 #define PARROT_CPU_ARCH "@cpuarch@"
96 #define PARROT_OS_NAME "@jitosname@"
97 #define PARROT_BYTEORDER 0x@byteorder@
98 #define PARROT_BIGENDIAN @bigendian@
100 #define PARROT_LITTLEENDIAN !(PARROT_BIGENDIAN)
102 typedef Parrot_Int INTVAL;
103 typedef Parrot_UInt UINTVAL;
104 typedef Parrot_Float FLOATVAL;
106 typedef @hugeintval@ HUGEINTVAL;
107 typedef unsigned @hugeintval@ UHUGEINTVAL;
108 typedef @hugefloatval@ HUGEFLOATVAL;
110 #define INTVAL_SIZE @intvalsize@
111 #define NUMVAL_SIZE @nvsize@
112 #define OPCODE_T_SIZE @opcode_t_size@
113 #define PTR_SIZE @ptrsize@
114 #define SHORT_SIZE @shortsize@
115 #define INT_SIZE @intsize@
116 #define LONG_SIZE @longsize@
117 #define HUGEINTVAL_SIZE @hugeintvalsize@
118 #define DOUBLE_SIZE @doublesize@
120 /* We don't have a portable config for 64-bit
123 # if INTVAL_SIZE >= 8
124 typedef Parrot_Int INTVAL64;
125 typedef Parrot_Int Parrot_Int64;
127 # if HUGEINTVAL_SIZE >= 8
128 typedef HUGEINTVAL INTVAL64;
129 typedef HUGEINTVAL Parrot_Int64;
131 /* No 64-bit type available? */
132 typedef union { unsigned char b[8]; } INTVAL64;
133 typedef INTVAL64 Parrot_Int64;
139 typedef Parrot_Opcode opcode_t;
140 typedef size_t ptrcast_t;
142 typedef struct _vtable VTABLE;
143 typedef void DPOINTER;
145 /* JIT and exec cores. */
146 #define JIT_CPUARCH "@jitcpuarch@"
147 #define JIT_OSNAME "@jitosname@"
148 #define JIT_ARCHNAME "@jitarchname@"
149 #define JIT_CAPABLE @jitcapable@
150 #define EXEC_CAPABLE @execcapable@
151 #define PARROT_EXEC_OS_@jitosname@ 1
152 #define PARROT_@jitcpu@ 1
154 /* Oplib and dynamic ops related. */
155 #define PARROT_CORE_OPLIB_NAME "core_ops"
156 #define PARROT_CORE_OPLIB_INIT Parrot_DynOp_core_@MAJOR@_@MINOR@_@PATCH@
158 #define PARROT_GET_CORE_OPLIB(i) PARROT_CORE_OPLIB_INIT((i), 1)
161 #define PARROT_HAS_ICU @has_icu@
163 /* Int and float formats. */
164 #define INTVAL_FMT "@intvalfmt@"
165 #define FLOATVAL_FMT "@floatvalfmt@"
167 #include "parrot/has_header.h"
168 #include "parrot/feature.h"
172 #endif /* PARROT_CONFIG_H_GUARD */
176 * c-file-style: "parrot"
178 * vim: expandtab shiftwidth=4: