summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-03-16 18:04:44 +1300
committerOlly Betts <olly@survex.com>2022-03-16 18:04:44 +1300
commita3540491958959622e4b8c2ed13d0ec088eaa9a5 (patch)
tree1529a4f8a625934a880ce40382ccd321eb288970
parentc546acf2e4f47bc9cf010b62fdbde2b169e36583 (diff)
downloadswig-guile-changes.tar.gz
[guile] Stop using deprecated aliasesguile-changes
The replacements should all work with Guile 1.8.0, which is the oldest version we still aim to support. Fixes #1624
-rw-r--r--Examples/test-suite/csharp/li_std_wstring_runme.cs3
-rw-r--r--Examples/test-suite/guile/guile_ext_test_external.cxx2
-rw-r--r--Examples/test-suite/li_std_wstring.i2
-rw-r--r--Lib/guile/guile_scm_run.swg18
-rw-r--r--Lib/guile/typemaps.i2
5 files changed, 15 insertions, 12 deletions
diff --git a/Examples/test-suite/csharp/li_std_wstring_runme.cs b/Examples/test-suite/csharp/li_std_wstring_runme.cs
index d2927287f..a949f8c38 100644
--- a/Examples/test-suite/csharp/li_std_wstring_runme.cs
+++ b/Examples/test-suite/csharp/li_std_wstring_runme.cs
@@ -84,7 +84,10 @@ public class runme
{
// Unicode strings
+ char unicodechar = '\u73a9'; // Chinese character for father, man
+ string unicodeString = unicodechar.ToString();
string[] test_strings = {
+ unicodeString,
"JP: 日本語", "DE: Kröpeliner Straße" , "RU: Война и мир", "EN: War and Peace"
};
diff --git a/Examples/test-suite/guile/guile_ext_test_external.cxx b/Examples/test-suite/guile/guile_ext_test_external.cxx
index c4f906a97..2729537bd 100644
--- a/Examples/test-suite/guile/guile_ext_test_external.cxx
+++ b/Examples/test-suite/guile/guile_ext_test_external.cxx
@@ -19,6 +19,6 @@ SCM test_create()
SCM test_is_pointer(SCM val)
{
#define FUNC_NAME "test-is-pointer"
- return SCM_BOOL(SWIG_IsPointer(val));
+ return scm_from_bool(SWIG_IsPointer(val));
#undef FUNC_NAME
}
diff --git a/Examples/test-suite/li_std_wstring.i b/Examples/test-suite/li_std_wstring.i
index a790ca7e0..3a451b19b 100644
--- a/Examples/test-suite/li_std_wstring.i
+++ b/Examples/test-suite/li_std_wstring.i
@@ -35,7 +35,7 @@ wchar_t* test_wchar_overload(wchar_t *x) {
return x;
}
-std::wstring test_value(std::wstring x) {
+std::wstring test_value(const std::wstring& x) {
return x;
}
diff --git a/Lib/guile/guile_scm_run.swg b/Lib/guile/guile_scm_run.swg
index 2e96184b1..d1dc0d61f 100644
--- a/Lib/guile/guile_scm_run.swg
+++ b/Lib/guile/guile_scm_run.swg
@@ -125,7 +125,7 @@ SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
else
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type);
- if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) {
+ if (!cdata || scm_is_null(cdata->goops_class) || swig_make_func == SCM_EOL ) {
return smob;
} else {
/* the scm_make() C function only handles the creation of gf,
@@ -145,7 +145,7 @@ SWIGINTERN unsigned long
SWIG_Guile_PointerAddress(SCM object)
{
SCM smob = SWIG_Guile_GetSmob(object);
- if (SCM_NULLP(smob)) return 0;
+ if (scm_is_null(smob)) return 0;
else if (SCM_SMOB_PREDICATE(swig_tag, smob)
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
@@ -158,7 +158,7 @@ SWIGINTERN swig_type_info *
SWIG_Guile_PointerType(SCM object)
{
SCM smob = SWIG_Guile_GetSmob(object);
- if (SCM_NULLP(smob)) return NULL;
+ if (scm_is_null(smob)) return NULL;
else if (SCM_SMOB_PREDICATE(swig_tag, smob)
|| SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
|| SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
@@ -186,7 +186,7 @@ SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
swig_type_info *from;
SCM smob = SWIG_Guile_GetSmob(s);
- if (SCM_NULLP(smob)) {
+ if (scm_is_null(smob)) {
*result = NULL;
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
#if SCM_MAJOR_VERSION >= 2
@@ -252,7 +252,7 @@ SWIGINTERN void
SWIG_Guile_MarkPointerNoncollectable(SCM s)
{
SCM smob = SWIG_Guile_GetSmob(s);
- if (!SCM_NULLP(smob)) {
+ if (!scm_is_null(smob)) {
if (SWIG_Guile_IsValidSmob(smob)) {
SCM_SET_CELL_TYPE(smob, swig_tag);
}
@@ -265,7 +265,7 @@ SWIGINTERN void
SWIG_Guile_MarkPointerDestroyed(SCM s)
{
SCM smob = SWIG_Guile_GetSmob(s);
- if (!SCM_NULLP(smob)) {
+ if (!scm_is_null(smob)) {
if (SWIG_Guile_IsValidSmob(smob)) {
SCM_SET_CELL_TYPE(smob, swig_destroyed_tag);
}
@@ -486,20 +486,20 @@ SWIG_Guile_GetArgs (SCM *dest, SCM rest,
int i;
int num_args_passed = 0;
for (i = 0; i<reqargs; i++) {
- if (!SCM_CONSP(rest))
+ if (!scm_is_pair(rest))
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure"));
*dest++ = SCM_CAR(rest);
rest = SCM_CDR(rest);
num_args_passed++;
}
- for (i = 0; i<optargs && SCM_CONSP(rest); i++) {
+ for (i = 0; i<optargs && scm_is_pair(rest); i++) {
*dest++ = SCM_CAR(rest);
rest = SCM_CDR(rest);
num_args_passed++;
}
for (; i<optargs; i++)
*dest++ = SCM_UNDEFINED;
- if (!SCM_NULLP(rest))
+ if (!scm_is_null(rest))
scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure"));
return num_args_passed;
}
diff --git a/Lib/guile/typemaps.i b/Lib/guile/typemaps.i
index f4d3a0118..62ee029a0 100644
--- a/Lib/guile/typemaps.i
+++ b/Lib/guile/typemaps.i
@@ -426,7 +426,7 @@ typedef unsigned long SCM;
%typecheck(SWIG_TYPECHECK_BOOL)
bool, bool&, const bool&
{
- $1 = SCM_BOOLP($input) ? 1 : 0;
+ $1 = scm_is_bool($input) ? 1 : 0;
}
%typecheck(SWIG_TYPECHECK_DOUBLE)