GnuCash  5.6-150-g038405b370+
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
guile-mappings.h
1 /********************************************************************\
2  * guile-mappings.h - Guile version compatibility mappings *
3  * Copyright (C) 2003, David Hampton *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License*
16  * along with this program; if not, write to the Free Software *
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
18 \********************************************************************/
19 
20 #include <libguile.h> /* for SCM_MAJOR_VERSION etc */
21 
22 /* Convenience macros */
23 
24 #if defined(scm_to_utf8_string) && SCM_MAJOR_VERSION >= 2
25 #undef scm_to_utf8_string
26 #undef scm_from_utf8_string
27 #undef SWIG_scm2str
28 #define SWIG_scm2str(s) scm_to_utf8_string(s)
29 #undef SWIG_str02scm
30 #define SWIG_str02scm(str) \
31  str ? scm_from_utf8_string(str) : SCM_BOOL_F
32 #endif
33 #define scm_is_equal(obj1,obj2) scm_is_true(scm_equal_p(obj1,obj2))
34 #define scm_is_exact(obj) scm_is_true(scm_exact_p(obj))
35 #define scm_is_list(obj) scm_is_true(scm_list_p(obj))
36 #define scm_is_procedure(obj) scm_is_true(scm_procedure_p(obj))