5 /* Copyright (C) 2001, 2002, 2006, 2008 Free Software Foundation, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 # define SCM_GC8MARKP(X) SCM_GC_MARK_P(X)
25 # define SCM_SETGC8MARK(X) SCM_SET_GC_MARK(X)
29 # define SCM_GC_MARK_P(X) SCM_GCMARKP(X)
30 # define SCM_SET_GC_MARK(X) SCM_SETGCMARK(X)
33 #ifndef SCM_ARRAY_FLAG_CONTIGUOUS
34 # define SCM_ARRAY_FLAG_CONTIGUOUS SCM_ARRAY_CONTIGUOUS
37 #ifndef HAVE_SCM_T_BITS
38 typedef scm_bits_t scm_t_bits;
39 typedef scm_array scm_t_array;
40 typedef scm_array_dim scm_t_array_dim;
41 typedef scm_mutex_t scm_t_mutex;
42 typedef scm_cond_t scm_t_cond;
43 typedef scm_key_t scm_t_key;
44 typedef scm_catch_body_t scm_t_catch_body;
45 typedef scm_catch_handler_t scm_t_catch_handler;
46 typedef scm_rstate scm_t_rstate;
47 typedef scm_port scm_t_port;
48 typedef scm_fport scm_t_fport;
51 #ifndef SCM_VALIDATE_DOUBLE_COPY
52 #define SCM_VALIDATE_DOUBLE_COPY SCM_VALIDATE_NUMBER_COPY
55 #ifndef HAVE_SCM_C_DEFINE_MODULE
56 #define scm_c_define_module(NAME,INIT,DATA) \
57 scm_make_module (scm_read_0str ("(" NAME ")"))
61 #define SCM_MAKE_CHAR SCM_MAKICHR
62 #define SCM_CHAR SCM_ICHR
63 #define SCM_CHARP SCM_ICHRP
67 #define SCM_ROSTRINGP(x) (SCM_STRINGP (x) || SCM_SYMBOLP (x))
68 #define SCM_RWSTRINGP(x) SCM_STRINGP (x)
69 #define SCM_ROCHARS(x) \
70 (SCM_STRINGP (x) ? SCM_STRING_CHARS (x) : SCM_SYMBOL_CHARS (x))
71 #define SCM_ROLENGTH(x) \
72 (SCM_STRINGP (x) ? SCM_STRING_LENGTH (x) : SCM_SYMBOL_LENGTH (x))
75 #ifndef SCM_STRING_COERCE_0TERMINATION_X
76 #ifdef SCM_COERCE_SUBSTR
77 #define SCM_STRING_COERCE_0TERMINATION_X SCM_COERCE_SUBSTR
79 #define SCM_STRING_COERCE_0TERMINATION_X(x) (x)
83 #ifndef HAVE_SCM_C_READ_STRING
84 #define scm_c_read_string scm_read_0str
85 #define scm_c_eval_string scm_eval_0str
86 #define scm_str2symbol(X) SCM_CAR (scm_intern0 (X))
87 #define scm_mem2string(X, Y) scm_makfromstr ((X), (Y), 0)
90 #ifndef HAVE_SCM_MAKE_REAL
91 #define scm_make_real(X) scm_makdbl ((X), 0.0)
94 #ifdef HAVE_SCM_NUM2DOUBLE
95 #define scm_real2double scm_num2double
96 #define SCM_REAL2DOUBLE SCM_NUM2DOUBLE
98 #define scm_real2double(X, POS, WHERE) scm_num2dbl ((X), (WHERE))
99 #define SCM_REAL2DOUBLE(X, POS) scm_num2dbl ((X), FUNC_NAME)
102 #ifndef SCM_VALIDATE_DOUBLE_DEF_COPY
103 #define SCM_VALIDATE_DOUBLE_DEF_COPY SCM_VALIDATE_NUMBER_DEF_COPY
106 #ifndef HAVE_SCM_GC_PROTECT_OBJECT
107 #define scm_gc_protect_object scm_protect_object
110 #ifndef HAVE_SCM_C_DEFINE_GSUBR
111 #define scm_c_define_gsubr scm_make_gsubr
114 #ifndef SCM_STRING_CHARS
115 #define SCM_STRING_CHARS SCM_CHARS
116 #define SCM_STRING_UCHARS SCM_UCHARS
117 #define SCM_STRING_LENGTH SCM_LENGTH
121 #define SCM_SUBSTRP(X) 0
124 #ifndef SCM_VECTOR_LENGTH
125 #define SCM_VECTOR_LENGTH SCM_LENGTH
126 #define SCM_UVECTOR_LENGTH SCM_LENGTH
129 #ifndef SCM_SET_VECTOR_LENGTH
130 #define SCM_SET_VECTOR_LENGTH SCM_SETLENGTH
131 #define SCM_SET_UVECTOR_LENGTH SCM_SETLENGTH
134 #ifndef SCM_VECTOR_BASE
135 #define SCM_VECTOR_BASE SCM_CHARS
136 #define SCM_UVECTOR_BASE SCM_CHARS
139 #ifndef SCM_SET_VECTOR_BASE
140 #define SCM_SET_VECTOR_BASE SCM_SETCHARS
141 #define SCM_SET_UVECTOR_BASE SCM_SETCHARS
144 #ifndef SCM_UVECTOR_MAX_LENGTH
145 #define SCM_UVECTOR_MAX_LENGTH SCM_LENGTH_MAX
148 #ifndef HAVE_SCM_LIST_1
149 #define scm_list_1 SCM_LIST1
150 #define scm_list_2 SCM_LIST2
151 #define scm_list_3 SCM_LIST3
152 #define scm_list_4 SCM_LIST4
153 #define scm_list_5 SCM_LIST5
154 #define scm_list_n scm_listify
157 #ifndef SCM_SYMBOL_CHARS
158 #define SCM_SYMBOL_CHARS SCM_CHARS