Merged from the latest developing branch.
[MacVim.git] / src / if_mzsch.h
blobb745cce9eec5f56451ed2d4c6ab2b804627459ea
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 <scheme.h>
15 #endif
17 #ifdef __MINGW32__
18 # undef __CYGWIN32__
19 #endif
21 #if MZSCHEME_VERSION_MAJOR >= 299
22 /* macros to be compatible with 20x versions */
23 # define scheme_config scheme_current_config()
24 # define scheme_make_string scheme_make_byte_string
25 # define scheme_make_string_output_port scheme_make_byte_string_output_port
26 # define scheme_get_sized_string_output scheme_get_sized_byte_string_output
27 # define scheme_write_string scheme_write_byte_string
28 # define scheme_make_sized_string scheme_make_sized_byte_string
30 # define SCHEME_STRINGP(obj) (SCHEME_BYTE_STRINGP(obj) || SCHEME_CHAR_STRINGP(obj))
31 # define SCHEME_STR_VAL(obj) SCHEME_BYTE_STR_VAL( \
32 (SCHEME_BYTE_STRINGP(obj) ? obj : scheme_char_string_to_byte_string(obj)))
33 # define GUARANTEE_STRING(fname, argnum) GUARANTEE_TYPE(fname, argnum, SCHEME_STRINGP, "string")
35 # ifdef scheme_format
36 # undef scheme_format
37 # endif
38 # define scheme_format scheme_format_utf8
40 # define SCHEME_GET_BYTE_STRING(obj) (SCHEME_BYTE_STRINGP(obj) ? obj : \
41 scheme_char_string_to_byte_string(obj))
42 #else
43 # define SCHEME_GET_BYTE_STRING(obj) (obj)
44 # define SCHEME_BYTE_STRLEN_VAL SCHEME_STRLEN_VAL
45 # define SCHEME_BYTE_STR_VAL SCHEME_STR_VAL
46 # define scheme_byte_string_to_char_string(obj) (obj)
47 #endif
49 #endif /* _IF_MZSCH_H_ */