From b3cc02cfd000ed942cd81998fe0c7669c72a4ed8 Mon Sep 17 00:00:00 2001 From: John Lenz Date: Wed, 21 Jun 2006 04:16:21 +0000 Subject: [PATCH] Remove integers_runme.ss because Chicken does not test for integer overflow Fixes to get apply_strings.i to work in the testsuite Minor documentation updates git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9170 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 6 ++++++ Doc/Manual/Chicken.html | 11 ++++++----- Examples/test-suite/chicken/integers_runme.ss | 6 ------ Lib/chicken/chicken.swg | 2 +- Lib/chicken/multi-generic.scm | 2 ++ 5 files changed, 15 insertions(+), 12 deletions(-) delete mode 100644 Examples/test-suite/chicken/integers_runme.ss diff --git a/CHANGES.current b/CHANGES.current index f78ccf67a..d37de6628 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,12 @@ Version 1.3.30 (in progress) ============================ +06/20/2006: wuzzeb (John Lenz) + [Chicken] + Minor fixes to get apply_strings.i testsuite to pass + Remove integers_runme.scm from the testsuite, because SWIG and Chicken does + handle overflows. + 06/17/2006: olly [php] Added some missing keywords to the PHP4 keyword list, and fixed __LINE__ and __FILE__ which were in the wrong category. diff --git a/Doc/Manual/Chicken.html b/Doc/Manual/Chicken.html index 0a913e9e2..c415478b9 100644 --- a/Doc/Manual/Chicken.html +++ b/Doc/Manual/Chicken.html @@ -548,7 +548,9 @@ all the modules.

%feature(compactdefaultargs). -

TinyCLOS has a limitation such that generic methods do not properly work on methods +

18.7.1 TinyCLOS problems with Chicken version <= 1.92

+ +

In Chicken versions equal to or below 1.92, TinyCLOS has a limitation such that generic methods do not properly work on methods with different number of specializers: TinyCLOS assumes that every method added to a generic function will have the same number of specializers. SWIG generates functions with different lengths of specializers when C/C++ functions are overloaded. For example, the code

@@ -571,13 +573,12 @@ int foo(int a);

Using unpatched TinyCLOS, the second (define-method) will replace the first one, so calling (foo 3 f) will produce an error.

-

There are two solutions to this: the +

There are three solutions to this. The easist is to upgrade to the latest Chicken version. Otherwise, the file Lib/chicken/tinyclos-multi-generic.patch in the SWIG source contains a patch against -tinyclos.scm inside the chicken source to add support into TinyCLOS for multi-argument generics. +tinyclos.scm inside the 1.92 chicken source to add support into TinyCLOS for multi-argument generics. (This patch was accepted into Chicken) This requires chicken to be rebuilt and custom install of chicken. An alternative is the Lib/chicken/multi-generic.scm file in the SWIG source. This file can be loaded after TinyCLOS is loaded, and it will override some functions -inside TinyCLOS to correctly support multi-argument generics. This solution will work on any install of chicken. -Please see the comments at the top of both files for more information.

+inside TinyCLOS to correctly support multi-argument generics. Please see the comments at the top of both files for more information.

diff --git a/Examples/test-suite/chicken/integers_runme.ss b/Examples/test-suite/chicken/integers_runme.ss deleted file mode 100644 index b97c7f1fe..000000000 --- a/Examples/test-suite/chicken/integers_runme.ss +++ /dev/null @@ -1,6 +0,0 @@ -(load "integers.so") -(define-macro (throws-exception? form) - `(condition-case (begin ,form #f) - ((exn) #t))) - -(include "../schemerunme/integers.scm") diff --git a/Lib/chicken/chicken.swg b/Lib/chicken/chicken.swg index 9f930bcc2..d55091b89 100644 --- a/Lib/chicken/chicken.swg +++ b/Lib/chicken/chicken.swg @@ -335,7 +335,7 @@ SIMPLE_TYPEMAP(double, C_c_double, C_flonum, C_swig_is_number, (double), C_SIZEO $result = C_SCHEME_FALSE; } else { - int string_len = strlen ($1); + int string_len = strlen ((char *) ($1)); C_word *string_space = C_alloc (C_SIZEOF_STRING (string_len)); $result = C_string (&string_space, string_len, s); } diff --git a/Lib/chicken/multi-generic.scm b/Lib/chicken/multi-generic.scm index a1a5c369e..82c7b50c4 100644 --- a/Lib/chicken/multi-generic.scm +++ b/Lib/chicken/multi-generic.scm @@ -1,3 +1,5 @@ +;; This file is no longer neccissary with Chicken versions avove 1.92 +;; ;; This file overrides two functions inside TinyCLOS to provide support ;; for multi-argument generics. There are many ways of linking this file ;; into your code... all that needs to happen is this file must be