build-sys: guile-snarf should use host CPP.
[geda-gaf/whiteaudio.git] / missing.h
blob1d4666aaba148f572bfbfd43b2b01c2a110ef017
2 /* This file contains preprocessor macros which provide substitutes
3 * for missing functions or other definitions based on the results of
4 * configure. */
6 /* We need to be able to pass UTF-8 strings to and from libguile. The
7 * most forward-compatible way to do this is to explicitly use the
8 * "utf8" API for doing so, but this API is only available from Guile
9 * 2.0 onwards.
11 * In Guile 2.0 there is a similar "locale" API which encodes/decodes
12 * strings differently based on the locale, so we need to avoid it in
13 * case the user decides to set a non-UTF-8 locale. However, the
14 * "locale" API *is* present in Guile 1.8, in which it doesn't attempt
15 * to encode/decode the strings its passed, so we can use it as a
16 * direct replacement for the "utf8" API.
18 * Confused yet?
21 #ifndef HAVE_SCM_FROM_UTF8_STRINGN
22 # define scm_from_utf8_stringn scm_from_locale_stringn
23 #endif
24 #ifndef HAVE_SCM_FROM_UTF8_STRING
25 # define scm_from_utf8_string(x) scm_from_utf8_stringn ((x), -1)
26 #endif
27 #ifndef HAVE_SCM_TO_UTF8_STRINGN
28 # define scm_to_utf8_stringn scm_to_locale_stringn
29 #endif
30 #ifndef HAVE_SCM_TO_UTF8_STRING
31 # define scm_to_utf8_string(x) scm_to_utf8_stringn ((x), NULL)
32 #endif
34 #ifndef HAVE_SCM_FROM_UTF8_SYMBOLN
35 # define scm_from_utf8_symboln scm_from_locale_symboln
36 #endif
37 #ifndef HAVE_SCM_FROM_UTF8_SYMBOL
38 # define scm_from_utf8_symbol scm_from_locale_symbol
39 #endif