Merge branch 'vim' into feat/emb-common-lisp
[vim_extended.git] / src / if_mzsch.h
blob45888919b522ce37f98e7140ae37371f5932df06
1 /* vi:set ts=8 sts=4 sw=4:
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
12 /* #ifdef needed for "make depend" */
13 #ifdef FEAT_MZSCHEME
14 # include <schvers.h>
15 # include <scheme.h>
16 #endif
18 #ifdef __MINGW32__
19 # undef __CYGWIN32__
20 #endif
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
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")
36 # ifdef scheme_format
37 # undef scheme_format
38 # endif
39 # define scheme_format scheme_format_utf8
41 # define SCHEME_GET_BYTE_STRING(obj) (SCHEME_BYTE_STRINGP(obj) ? obj : \
42 scheme_char_string_to_byte_string(obj))
43 #else
44 # define SCHEME_GET_BYTE_STRING(obj) (obj)
45 # define SCHEME_BYTE_STRLEN_VAL SCHEME_STRLEN_VAL
46 # define SCHEME_BYTE_STR_VAL SCHEME_STR_VAL
47 # define scheme_byte_string_to_char_string(obj) (obj)
48 #endif
50 /* Precise GC macros */
51 #ifndef MZ_GC_DECL_REG
52 # define MZ_GC_DECL_REG(size) /* empty */
53 #endif
54 #ifndef MZ_GC_VAR_IN_REG
55 # define MZ_GC_VAR_IN_REG(x, v) /* empty */
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
61 # define MZ_GC_REG() /* empty */
62 #endif
63 #ifndef MZ_GC_UNREG
64 # define MZ_GC_UNREG() /* empty */
65 #endif
67 #ifdef MZSCHEME_FORCE_GC
69 * force garbage collection to check all references are registered
70 * seg faults will indicate not registered refs
72 # define MZ_GC_CHECK() scheme_collect_garbage();
73 #else
74 # define MZ_GC_CHECK() /* empty */
75 #endif
77 #endif /* _IF_MZSCH_H_ */