[libfann] 56/133: Add patch to fix FTBFS on alpha/armel
Christian Kastner
chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:07:48 UTC 2014
This is an automated email from the git hooks/post-receive script.
chrisk-guest pushed a commit to branch master
in repository libfann.
commit cada452466cbe3cafde49033736eb62179f3ad36
Author: Christian Kastner <debian at kvr.at>
Date: Thu Jul 1 01:15:02 2010 +0200
Add patch to fix FTBFS on alpha/armel
---
.../0004-Portable-handling-for-va_list.patch | 65 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 66 insertions(+)
diff --git a/debian/patches/0004-Portable-handling-for-va_list.patch b/debian/patches/0004-Portable-handling-for-va_list.patch
new file mode 100644
index 0000000..23d130f
--- /dev/null
+++ b/debian/patches/0004-Portable-handling-for-va_list.patch
@@ -0,0 +1,65 @@
+From: Christian Kastner <debian at kvr.at>
+Date: Thu, 1 Jul 2010 01:02:47 +0200
+Subject: [PATCH] Portable handling for va_list
+
+The current code wrongly assumes va_list is always implemented as an array. va_list
+however is an opaque type, and may also be implemented as a struct, for
+example. This patch implements handling of va_list in a platform-independent
+way, fixing a FTBFS on alpha and armel.
+
+Forwarded: no
+Last-Update: 2010-07-01
+---
+ src/include/fann_cpp.h | 21 +++++++++++++++------
+ 1 files changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/src/include/fann_cpp.h b/src/include/fann_cpp.h
+index eb647af..bf6e75b 100644
+--- a/src/include/fann_cpp.h
++++ b/src/include/fann_cpp.h
+@@ -916,9 +916,12 @@ public:
+ bool create_standard(unsigned int num_layers, ...)
+ {
+ va_list layers;
++ unsigned int arr[num_layers];
++
+ va_start(layers, num_layers);
+- bool status = create_standard_array(num_layers,
+- reinterpret_cast<const unsigned int *>(layers));
++ for (unsigned int ii = 0; ii < num_layers; ii++)
++ arr[ii] = va_arg(layers, unsigned int);
++ bool status = create_standard_array(num_layers, arr);
+ va_end(layers);
+ return status;
+ }
+@@ -966,9 +969,12 @@ public:
+ bool create_sparse(float connection_rate, unsigned int num_layers, ...)
+ {
+ va_list layers;
++ unsigned int arr[num_layers];
++
+ va_start(layers, num_layers);
+- bool status = create_sparse_array(connection_rate, num_layers,
+- reinterpret_cast<const unsigned int *>(layers));
++ for (unsigned int ii = 0; ii < num_layers; ii++)
++ arr[ii] = va_arg(layers, unsigned int);
++ bool status = create_sparse_array(connection_rate, num_layers, arr);
+ va_end(layers);
+ return status;
+ }
+@@ -1013,9 +1019,12 @@ public:
+ bool create_shortcut(unsigned int num_layers, ...)
+ {
+ va_list layers;
++ unsigned int arr[num_layers];
++
+ va_start(layers, num_layers);
+- bool status = create_shortcut_array(num_layers,
+- reinterpret_cast<const unsigned int *>(layers));
++ for (unsigned int ii = 0; ii < num_layers; ii++)
++ arr[ii] = va_arg(layers, unsigned int);
++ bool status = create_shortcut_array(num_layers, arr);
+ va_end(layers);
+ return status;
+ }
+--
diff --git a/debian/patches/series b/debian/patches/series
index 9af5cef..ea961ab 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
0001-Link-python-pyfann-dynamically-instead-of-statically.patch
0002-Link-against-libm.patch
0003-Patch-upstreams-Makefile.am-reflecting-Debian.patch
+0004-Portable-handling-for-va_list.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libfann.git
More information about the debian-science-commits
mailing list