14
|
1 /* vi:set ts=8 sts=4 sw=4:
|
|
2 *
|
|
3 * MzScheme interface for Vim, wrapper around scheme.h
|
|
4 */
|
|
5 #ifndef _IF_MZSCH_H_
|
|
6 #define _IF_MZSCH_H_
|
|
7 #ifdef __MINGW32__
|
|
8 /* Hack to engage Cygwin-specific settings */
|
|
9 # define __CYGWIN32__
|
|
10 #endif
|
|
11
|
800
|
12 /* #ifdef needed for "make depend" */
|
|
13 #ifdef FEAT_MZSCHEME
|
1894
|
14 # include <schvers.h>
|
800
|
15 # include <scheme.h>
|
|
16 #endif
|
14
|
17
|
|
18 #ifdef __MINGW32__
|
|
19 # undef __CYGWIN32__
|
|
20 #endif
|
|
21
|
|
22 #if MZSCHEME_VERSION_MAJOR >= 299
|
|
23 /* macros to be compatible with 20x versions */
|
|
24 # define scheme_config scheme_current_config()
|
|
25 # define scheme_make_string scheme_make_byte_string
|
|
26 # define scheme_make_string_output_port scheme_make_byte_string_output_port
|
|
27 # define scheme_get_sized_string_output scheme_get_sized_byte_string_output
|
|
28 # define scheme_write_string scheme_write_byte_string
|
|
29 # define scheme_make_sized_string scheme_make_sized_byte_string
|
|
30
|
|
31 # define SCHEME_STRINGP(obj) (SCHEME_BYTE_STRINGP(obj) || SCHEME_CHAR_STRINGP(obj))
|
|
32 # define SCHEME_STR_VAL(obj) SCHEME_BYTE_STR_VAL( \
|
|
33 (SCHEME_BYTE_STRINGP(obj) ? obj : scheme_char_string_to_byte_string(obj)))
|
|
34 # define GUARANTEE_STRING(fname, argnum) GUARANTEE_TYPE(fname, argnum, SCHEME_STRINGP, "string")
|
|
35
|
|
36 # ifdef scheme_format
|
|
37 # undef scheme_format
|
|
38 # endif
|
|
39 # define scheme_format scheme_format_utf8
|
|
40
|
274
|
41 # define SCHEME_GET_BYTE_STRING(obj) (SCHEME_BYTE_STRINGP(obj) ? obj : \
|
14
|
42 scheme_char_string_to_byte_string(obj))
|
|
43 #else
|
274
|
44 # define SCHEME_GET_BYTE_STRING(obj) (obj)
|
14
|
45 # define SCHEME_BYTE_STRLEN_VAL SCHEME_STRLEN_VAL
|
|
46 # define SCHEME_BYTE_STR_VAL SCHEME_STR_VAL
|
274
|
47 # define scheme_byte_string_to_char_string(obj) (obj)
|
14
|
48 #endif
|
|
49
|
1894
|
50 /* Precise GC macros */
|
|
51 #ifndef MZ_GC_DECL_REG
|
2330
|
52 # define MZ_GC_DECL_REG(size) /* empty */
|
1894
|
53 #endif
|
|
54 #ifndef MZ_GC_VAR_IN_REG
|
2330
|
55 # define MZ_GC_VAR_IN_REG(x, v) /* empty */
|
1894
|
56 #endif
|
|
57 #ifndef MZ_GC_ARRAY_VAR_IN_REG
|
|
58 # define MZ_GC_ARRAY_VAR_IN_REG(x, v, l) /* empty */
|
|
59 #endif
|
|
60 #ifndef MZ_GC_REG
|
2330
|
61 # define MZ_GC_REG() /* empty */
|
1894
|
62 #endif
|
|
63 #ifndef MZ_GC_UNREG
|
2330
|
64 # define MZ_GC_UNREG() /* empty */
|
1894
|
65 #endif
|
|
66
|
|
67 #ifdef MZSCHEME_FORCE_GC
|
|
68 /*
|
|
69 * force garbage collection to check all references are registered
|
|
70 * seg faults will indicate not registered refs
|
|
71 */
|
|
72 # define MZ_GC_CHECK() scheme_collect_garbage();
|
|
73 #else
|
|
74 # define MZ_GC_CHECK() /* empty */
|
|
75 #endif
|
|
76
|
14
|
77 #endif /* _IF_MZSCH_H_ */
|