[Pkg-octave-commit] r2455 - octave-forge-pkgs/octave-ann/trunk/debian/patches
Rafael Laboissiere
rafael at alioth.debian.org
Tue Nov 18 09:11:18 UTC 2008
Author: rafael
Date: 2008-11-18 09:11:18 +0000 (Tue, 18 Nov 2008)
New Revision: 2455
Added:
octave-forge-pkgs/octave-ann/trunk/debian/patches/extend-after-exception.diff
Modified:
octave-forge-pkgs/octave-ann/trunk/debian/patches/series
Log:
Add patch
Added: octave-forge-pkgs/octave-ann/trunk/debian/patches/extend-after-exception.diff
===================================================================
--- octave-forge-pkgs/octave-ann/trunk/debian/patches/extend-after-exception.diff (rev 0)
+++ octave-forge-pkgs/octave-ann/trunk/debian/patches/extend-after-exception.diff 2008-11-18 09:11:18 UTC (rev 2455)
@@ -0,0 +1,66 @@
+Put %extend declarations after the %exception declaration, otherwise
+the try/catch block will not be exercised for the extended class
+methods.
+
+ -- Rafael Laboissiere <rafael at localhost> Tue, 18 Nov 2008 08:34:16 +0100
+
+--- a/src/ann/bindings/ann.i
++++ b/src/ann/bindings/ann.i
+@@ -72,6 +72,28 @@
+ delete [] $3;
+ }
+
++// replace (std::ostream& out) with std::cout
++%typemap(in,numinputs=0) std::ostream& out {
++ $1=&std::cout;
++}
++
++// argout typemap for (ANNkdStats& st)
++%typemap(in,numinputs=0,noblock=1) ANNkdStats& st (ANNkdStats tmp) {
++ $1=&tmp;
++}
++%typemap(argout) ANNkdStats& st {
++ %append_output(SWIG_NewPointerObj(new ANNkdStats(*$1),SWIGTYPE_p_ANNkdStats,1));
++}
++
++// catch fatal errors
++%exception {
++ try {
++ $action
++ } catch (ANN_exception& e) {
++ error("ANN fatal error: %s",e.msg.c_str());
++ }
++}
++
+ // can't process k without nn_idx,dd
+ %define annkFRSearch_fix(name)
+ %extend name {
+@@ -103,28 +125,6 @@
+ delete_pts(ANNkd_tree);
+ delete_pts(ANNbd_tree);
+
+-// replace (std::ostream& out) with std::cout
+-%typemap(in,numinputs=0) std::ostream& out {
+- $1=&std::cout;
+-}
+-
+-// argout typemap for (ANNkdStats& st)
+-%typemap(in,numinputs=0,noblock=1) ANNkdStats& st (ANNkdStats tmp) {
+- $1=&tmp;
+-}
+-%typemap(argout) ANNkdStats& st {
+- %append_output(SWIG_NewPointerObj(new ANNkdStats(*$1),SWIGTYPE_p_ANNkdStats,1));
+-}
+-
+-// catch fatal errors
+-%exception {
+- try {
+- $action;
+- } catch (ANN_exception& e) {
+- error("ANN fatal error: %s",e.msg.c_str());
+- }
+-}
+-
+ %include "/usr/include/ANN/ANN.h"
+ %include "/usr/include/ANN/ANNperf.h"
+ %include "/usr/include/ANN/ANNx.h"
Modified: octave-forge-pkgs/octave-ann/trunk/debian/patches/series
===================================================================
--- octave-forge-pkgs/octave-ann/trunk/debian/patches/series 2008-11-17 10:11:43 UTC (rev 2454)
+++ octave-forge-pkgs/octave-ann/trunk/debian/patches/series 2008-11-18 09:11:18 UTC (rev 2455)
@@ -1,3 +1,4 @@
use-libann-package.diff
cope-with-null-args.diff
remove-own-pts.diff
+extend-after-exception.diff
More information about the Pkg-octave-commit
mailing list