Commit 1dfe8a91 1dfe8a91be0d0d99d9fa285b33a9e0f39cbf1385 by Sergey Poznyakoff

Add support for Guile 1.8

(mu_scm_error): New function
1 parent d785147d
1 /* GNU Mailutils -- a suite of utilities for electronic mail 1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006
3 Free Software Foundation, Inc.
3 4
4 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public 6 modify it under the terms of the GNU Lesser General Public
...@@ -42,6 +43,39 @@ extern SCM scm_long2num (long val); ...@@ -42,6 +43,39 @@ extern SCM scm_long2num (long val);
42 # define MU_SCM_SYMBOL_VALUE(p) SCM_VARIABLE_REF(scm_c_lookup(p)) 43 # define MU_SCM_SYMBOL_VALUE(p) SCM_VARIABLE_REF(scm_c_lookup(p))
43 #endif 44 #endif
44 45
46 #if GUILE_VERSION < 18
47
48 # define scm_i_string_chars SCM_ROCHARS
49 # define scm_i_string_length SCM_ROLENGTH
50 # define scm_is_string(s) (SCM_NIMP(s) && SCM_STRINGP(s))
51 # define scm_from_locale_stringn(s,l) scm_makfromstr(s,l,0)
52 # define scm_from_locale_string(s) scm_makfrom0str(s)
53
54 # define scm_from_locale_symbol(s) scm_str2symbol(s)
55
56 # define scm_from_int SCM_MAKINUM
57
58 //# define scm_i_string_chars SCM_STRING_CHARS
59
60 # define scm_gc_malloc scm_must_malloc
61
62 /* FIXME */
63 # define scm_is_integer SCM_INUMP
64 # define scm_to_int32 SCM_INUM
65 # define scm_to_int SCM_INUM
66
67 # define DECL_SCM_T_ARRAY_HANDLE(name)
68 # define SCM_T_ARRAY_HANDLE_PTR(name) 0
69 # define scm_vector_writable_elements(res,handle,a,b) SCM_VELTS(res)
70 # define scm_array_handle_release(h)
71
72 #else
73
74 # define DECL_SCM_T_ARRAY_HANDLE(name) scm_t_array_handle name
75 # define SCM_T_ARRAY_HANDLE_PTR(name) &(name)
76
77 #endif
78
45 typedef struct 79 typedef struct
46 { 80 {
47 int debug_guile; 81 int debug_guile;
...@@ -59,6 +93,8 @@ typedef struct ...@@ -59,6 +93,8 @@ typedef struct
59 extern "C" { 93 extern "C" {
60 #endif 94 #endif
61 95
96 void mu_scm_error (const char *func_name, int status,
97 const char *fmt, SCM args);
62 extern SCM mu_scm_makenum (unsigned long val); 98 extern SCM mu_scm_makenum (unsigned long val);
63 extern void mu_set_variable (const char *name, SCM value); 99 extern void mu_set_variable (const char *name, SCM value);
64 extern void mu_scm_init (void); 100 extern void mu_scm_init (void);
......