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__
|
4074
|
10 # include <stdint.h>
|
14
|
11 #endif
|
|
12
|
800
|
13 /* #ifdef needed for "make depend" */
|
|
14 #ifdef FEAT_MZSCHEME
|
1894
|
15 # include <schvers.h>
|
800
|
16 # include <scheme.h>
|
|
17 #endif
|
14
|
18
|
|
19 #ifdef __MINGW32__
|
|
20 # undef __CYGWIN32__
|
|
21 #endif
|
|
22
|
|
23 #if MZSCHEME_VERSION_MAJOR >= 299
|
|
24 # define SCHEME_STRINGP(obj) (SCHEME_BYTE_STRINGP(obj) || SCHEME_CHAR_STRINGP(obj))
|
4074
|
25 # define BYTE_STRING_VALUE(obj) ((char_u *)SCHEME_BYTE_STR_VAL(obj))
|
|
26 #else
|
|
27 /* macros for compatibility with older versions */
|
|
28 # define scheme_current_config() scheme_config
|
|
29 # define scheme_make_sized_byte_string scheme_make_sized_string
|
|
30 # define scheme_format_utf8 scheme_format
|
|
31 # ifndef DYNAMIC_MZSCHEME
|
|
32 /* for dynamic MzScheme there will be separate definitions in if_mzsch.c */
|
|
33 # define scheme_get_sized_byte_string_output scheme_get_sized_string_output
|
|
34 # define scheme_make_byte_string scheme_make_string
|
|
35 # define scheme_make_byte_string_output_port scheme_make_string_output_port
|
|
36 # endif
|
14
|
37
|
|
38 # define SCHEME_BYTE_STRLEN_VAL SCHEME_STRLEN_VAL
|
4074
|
39 # define BYTE_STRING_VALUE(obj) ((char_u *)SCHEME_STR_VAL(obj))
|
274
|
40 # define scheme_byte_string_to_char_string(obj) (obj)
|
4074
|
41 # define SCHEME_BYTE_STRINGP SCHEME_STRINGP
|
14
|
42 #endif
|
|
43
|
1894
|
44 /* Precise GC macros */
|
|
45 #ifndef MZ_GC_DECL_REG
|
2330
|
46 # define MZ_GC_DECL_REG(size) /* empty */
|
1894
|
47 #endif
|
|
48 #ifndef MZ_GC_VAR_IN_REG
|
2330
|
49 # define MZ_GC_VAR_IN_REG(x, v) /* empty */
|
1894
|
50 #endif
|
|
51 #ifndef MZ_GC_ARRAY_VAR_IN_REG
|
|
52 # define MZ_GC_ARRAY_VAR_IN_REG(x, v, l) /* empty */
|
|
53 #endif
|
|
54 #ifndef MZ_GC_REG
|
2330
|
55 # define MZ_GC_REG() /* empty */
|
1894
|
56 #endif
|
|
57 #ifndef MZ_GC_UNREG
|
2330
|
58 # define MZ_GC_UNREG() /* empty */
|
1894
|
59 #endif
|
|
60
|
|
61 #ifdef MZSCHEME_FORCE_GC
|
|
62 /*
|
|
63 * force garbage collection to check all references are registered
|
|
64 * seg faults will indicate not registered refs
|
|
65 */
|
|
66 # define MZ_GC_CHECK() scheme_collect_garbage();
|
|
67 #else
|
|
68 # define MZ_GC_CHECK() /* empty */
|
|
69 #endif
|
|
70
|
14
|
71 #endif /* _IF_MZSCH_H_ */
|