| 1 |
/* -*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*- */ |
| 2 |
/* vim: set filetype=c tabstop=8 shiftwidth=4 expandtab: */ |
| 3 |
|
| 4 |
/* |
| 5 |
* Copyright (c) 1990, Giuseppe Attardi. |
| 6 |
* Copyright (c) 2001, Juan Jose Garcia Ripoll. |
| 7 |
* |
| 8 |
* See file 'LICENSE' for the copyright details. |
| 9 |
* |
| 10 |
*/ |
| 11 |
|
| 12 |
/* config.h.in -- Template configuration file. */ |
| 13 |
|
| 14 |
#if defined(_MSC_VER) || defined(__MINGW32__) || __WIN32__ || __WIN64__ |
| 15 |
#define ECL_MS_WINDOWS_HOST |
| 16 |
#endif |
| 17 |
|
| 18 |
/* |
| 19 |
* If ECL_API has been predefined, that means we are building the core |
| 20 |
* library and, under windows, we must tell the compiler to export |
| 21 |
* extern functions from the shared library. |
| 22 |
* If ECL_API is not defined, we are simply building an application that |
| 23 |
* uses ECL and, under windows, we must tell the compiler that certain |
| 24 |
* will be imported from a DLL. |
| 25 |
*/ |
| 26 |
#if defined(ECL_MS_WINDOWS_HOST) || defined(cygwin) |
| 27 |
# define ECL_DLLEXPORT __declspec(dllexport) |
| 28 |
# ifdef ECL_API |
| 29 |
# undef \ |
| 30 |
ECL_API /* Avoid autoconf removing this */ |
| 31 |
# define ECL_API __declspec(dllexport) |
| 32 |
# else |
| 33 |
# define ECL_API __declspec(dllimport) |
| 34 |
# endif |
| 35 |
#else |
| 36 |
# define ECL_DLLEXPORT |
| 37 |
# ifdef ECL_API |
| 38 |
# undef \ |
| 39 |
ECL_API /* Avoid autoconf removing this */ |
| 40 |
# endif |
| 41 |
# define ECL_API |
| 42 |
#endif |
| 43 |
|
| 44 |
/* Decimal number made with the formula yymmvv */ |
| 45 |
#define ECL_VERSION_NUMBER @ECL_VERSION_NUMBER@ |
| 46 |
|
| 47 |
/* |
| 48 |
* FEATURES LINKED IN |
| 49 |
*/ |
| 50 |
|
| 51 |
/* Use GNU Multiple Precision library for bignums */ |
| 52 |
#ifndef DPP |
| 53 |
#include "@ECL_GMP_HEADER@" |
| 54 |
#endif |
| 55 |
|
| 56 |
/* Userland threads? */ |
| 57 |
#undef ECL_THREADS |
| 58 |
#ifdef ECL_THREADS |
| 59 |
# if defined(ECL_MS_WINDOWS_HOST) |
| 60 |
# define ECL_WINDOWS_THREADS |
| 61 |
# endif |
| 62 |
/* # udef ECL_SEMAPHORES */ |
| 63 |
#undef ECL_RWLOCK |
| 64 |
#endif |
| 65 |
|
| 66 |
/* Use Boehm's garbage collector */ |
| 67 |
#undef GBC_BOEHM |
| 68 |
#ifdef GBC_BOEHM |
| 69 |
# ifdef ECL_THREADS |
| 70 |
# define GC_THREADS /* For >= 7.2 */ |
| 71 |
# endif |
| 72 |
# define ECL_DYNAMIC_VV |
| 73 |
# include "@ECL_BOEHM_GC_HEADER@" |
| 74 |
/* GC >= 7.2 defines these macros to intercept thread functions, but |
| 75 |
* in doing so it breaks mingw. */ |
| 76 |
# if defined(ECL_MS_WINDOWS_HOST) && defined(_beginthreadex) |
| 77 |
# undef _beginthread |
| 78 |
# undef _endthread |
| 79 |
# undef _beginthreadex |
| 80 |
# undef _endthreadex |
| 81 |
# endif |
| 82 |
#endif |
| 83 |
#undef ECL_LIBATOMIC_OPS_H |
| 84 |
|
| 85 |
/* Network streams */ |
| 86 |
#undef ECL_TCP |
| 87 |
#if defined(ECL_TCP) && defined(ECL_MS_WINDOWS_HOST) |
| 88 |
# define ECL_WSOCK |
| 89 |
#endif |
| 90 |
|
| 91 |
/* Foreign functions interface */ |
| 92 |
#undef ECL_FFI |
| 93 |
|
| 94 |
/* Support for Unicode strings */ |
| 95 |
#undef ECL_UNICODE |
| 96 |
|
| 97 |
/* Allow STREAM operations to work on arbitrary objects */ |
| 98 |
#undef ECL_CLOS_STREAMS |
| 99 |
|
| 100 |
/* Stack grows downwards */ |
| 101 |
#undef ECL_DOWN_STACK |
| 102 |
|
| 103 |
/* We have libffi and can use it */ |
| 104 |
#undef HAVE_LIBFFI |
| 105 |
|
| 106 |
/* Use mprotect for fast interrupt dispatch */ |
| 107 |
#ifndef NACL |
| 108 |
#undef ECL_USE_MPROTECT |
| 109 |
#endif |
| 110 |
#if defined(ECL_MS_WINDOWS_HOST) |
| 111 |
# define ECL_USE_GUARD_PAGE |
| 112 |
#endif |
| 113 |
/* Integer types */ |
| 114 |
@ECL_STDINT_HEADER@ |
| 115 |
#undef ecl_uint8_t |
| 116 |
#undef ecl_int8_t |
| 117 |
#undef ecl_uint16_t |
| 118 |
#undef ecl_int16_t |
| 119 |
#undef ecl_uint32_t |
| 120 |
#undef ecl_int32_t |
| 121 |
#undef ecl_uint64_t |
| 122 |
#undef ecl_int64_t |
| 123 |
#undef ecl_long_long_t |
| 124 |
#undef ecl_ulong_long_t |
| 125 |
|
| 126 |
/* |
| 127 |
* C TYPES AND SYSTEM LIMITS |
| 128 |
*/ |
| 129 |
/* |
| 130 |
* The integer type |
| 131 |
* |
| 132 |
* cl_fixnum must be an integer type, large enough to hold a pointer. |
| 133 |
* Ideally, according to the ISOC99 standard, we should use intptr_t, |
| 134 |
* but the required headers are not present in all systems. Hence we |
| 135 |
* use autoconf to guess the following values. |
| 136 |
*/ |
| 137 |
#define ECL_INT_BITS @CL_INT_BITS@ |
| 138 |
#define ECL_LONG_BITS @CL_LONG_BITS@ |
| 139 |
#define ECL_FIXNUM_BITS @CL_FIXNUM_BITS@ |
| 140 |
#define MOST_POSITIVE_FIXNUM ((cl_fixnum)@CL_FIXNUM_MAX@) |
| 141 |
#define MOST_NEGATIVE_FIXNUM ((cl_fixnum)@CL_FIXNUM_MIN@) |
| 142 |
#define MOST_POSITIVE_FIXNUM_VAL @CL_FIXNUM_MAX@ |
| 143 |
#define MOST_NEGATIVE_FIXNUM_VAL @CL_FIXNUM_MIN@ |
| 144 |
|
| 145 |
typedef @CL_FIXNUM_TYPE@ cl_fixnum; |
| 146 |
typedef unsigned @CL_FIXNUM_TYPE@ cl_index; |
| 147 |
typedef unsigned @CL_FIXNUM_TYPE@ cl_hashkey; |
| 148 |
|
| 149 |
#define ECL_BIGNUM_REGISTER_NUMBER 3 |
| 150 |
|
| 151 |
/* |
| 152 |
* The character type |
| 153 |
*/ |
| 154 |
#define ECL_CHAR_CODE_LIMIT @CHAR_CODE_LIMIT@ /* ASCII or unicode character code limit */ |
| 155 |
typedef @ECL_CHARACTER@ ecl_character; |
| 156 |
typedef unsigned char ecl_base_char; |
| 157 |
|
| 158 |
/* |
| 159 |
* Array limits |
| 160 |
*/ |
| 161 |
#define ECL_ARRAY_RANK_LIMIT 64 /* array rank limit */ |
| 162 |
#ifdef GBC_BOEHM |
| 163 |
#define ECL_ARRAY_DIMENSION_LIMIT @CL_FIXNUM_MAX@ |
| 164 |
#define ECL_ARRAY_TOTAL_LIMIT @CL_FIXNUM_MAX@ |
| 165 |
#else |
| 166 |
#define ECL_ARRAY_DIMENSION_LIMIT 16*1024*1024 |
| 167 |
#define ECL_ARRAY_TOTAL_LIMIT 16*1024*1024 |
| 168 |
#endif |
| 169 |
|
| 170 |
/* |
| 171 |
* Function limits. |
| 172 |
* |
| 173 |
* In general, any of these limits must fit in a "signed int". |
| 174 |
*/ |
| 175 |
/* Maximum number of function arguments (arbitrary) */ |
| 176 |
#define ECL_CALL_ARGUMENTS_LIMIT 65536 |
| 177 |
|
| 178 |
/* Maximum number of required arguments */ |
| 179 |
#define ECL_LAMBDA_PARAMETERS_LIMIT ECL_CALL_ARGUMENTS_LIMIT |
| 180 |
|
| 181 |
/* Numb. of args. which will be passed using the C stack */ |
| 182 |
/* See cmplam.lsp if you change this value */ |
| 183 |
#define ECL_C_ARGUMENTS_LIMIT 63 |
| 184 |
|
| 185 |
/* Maximum number of output arguments (>= ECL_C_ARGUMENTS_LIMIT) */ |
| 186 |
#define ECL_MULTIPLE_VALUES_LIMIT 64 |
| 187 |
|
| 188 |
/* A setjmp that does not save signals */ |
| 189 |
#define ecl_setjmp @ECL_SETJMP@ |
| 190 |
#define ecl_longjmp @ECL_LONGJMP@ |
| 191 |
|
| 192 |
/* |
| 193 |
* Structure/Instance limits. The index to a slot must fit in the |
| 194 |
* "int" type. We also require ECL_SLOTS_LIMIT <= ECL_CALL_ARGUMENTS_LIMIT |
| 195 |
* because constructors typically require as many arguments as slots, |
| 196 |
* or more. |
| 197 |
*/ |
| 198 |
#define ECL_SLOTS_LIMIT 32768 |
| 199 |
|
| 200 |
/* compiler understands long float */ |
| 201 |
#define ECL_LONG_FLOAT |
| 202 |
|
| 203 |
/* compiler understands complex */ |
| 204 |
#undef ECL_COMPLEX_FLOAT |
| 205 |
|
| 206 |
/* do we want NaNs and Infs */ |
| 207 |
#undef ECL_IEEE_FP |
| 208 |
|
| 209 |
/* We can use small, two-words conses, without type information */ |
| 210 |
#undef ECL_SMALL_CONS |
| 211 |
|
| 212 |
/* Do we use C or C++ compiler to compile ecl? */ |
| 213 |
#undef ECL_CXX_CORE |
| 214 |
|
| 215 |
/* Use CMU Common-Lisp's FORMAT routine */ |
| 216 |
#undef ECL_CMU_FORMAT |
| 217 |
|
| 218 |
/* Use the serialization framework */ |
| 219 |
#undef ECL_EXTERNALIZABLE |
| 220 |
|
| 221 |
/* do we want to deactivate all support for floating point exceptions */ |
| 222 |
#undef ECL_AVOID_FPE_H |
| 223 |
|
| 224 |
/* can manipulate floating point environment */ |
| 225 |
#undef HAVE_FENV_H |
| 226 |
|
| 227 |
/* feenableexcept is available */ |
| 228 |
#undef HAVE_FEENABLEEXCEPT |
| 229 |
|
| 230 |
/* wide-strings are available */ |
| 231 |
#undef HAVE_WCHAR_H |
| 232 |
|
| 233 |
/* whether we have read/write locks */ |
| 234 |
#undef HAVE_POSIX_RWLOCK |
| 235 |
|
| 236 |
/* |
| 237 |
* C macros for inlining, denoting probable code paths and other stuff |
| 238 |
* that makes better code. Most of it is GCC specific. |
| 239 |
*/ |
| 240 |
#if defined(__cplusplus) || \ |
| 241 |
(defined(__GNUC__) && \ |
| 242 |
(defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__))) |
| 243 |
#define ECL_INLINE inline |
| 244 |
#define ECL_CAN_INLINE 1 |
| 245 |
#else |
| 246 |
#define ECL_INLINE |
| 247 |
#define ECL_CAN_INLINE 0 |
| 248 |
#endif |
| 249 |
|
| 250 |
#if !defined(__GNUC__) |
| 251 |
# define ecl_likely(form) (form) |
| 252 |
# define ecl_unlikely(form) (form) |
| 253 |
# define ecl_attr_noreturn |
| 254 |
#else |
| 255 |
# if (__GNUC__ < 3) |
| 256 |
# define ecl_likely(form) (form) |
| 257 |
# define ecl_unlikely(form) (form) |
| 258 |
# else |
| 259 |
# define ecl_likely(form) __builtin_expect(form,1) |
| 260 |
# define ecl_unlikely(form) __builtin_expect(form,0) |
| 261 |
# endif |
| 262 |
# if (__GNUC__ < 4) |
| 263 |
# define ecl_attr_noreturn |
| 264 |
# else |
| 265 |
# define ecl_attr_noreturn __attribute__((noreturn)) |
| 266 |
# endif |
| 267 |
#endif |
| 268 |
|
| 269 |
#if defined(__SSE2__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2) |
| 270 |
#undef ECL_SSE2 |
| 271 |
#endif |