Used updated upstream fix for GCC 6 issue

This commit is contained in:
Jitka Plesnikova 2016-03-01 14:16:29 +01:00
parent 0bf467bbf3
commit fe618e8c35
3 changed files with 27 additions and 20 deletions

View File

@ -36,7 +36,7 @@
Summary: Connects C/C++/Objective C to some high-level programming languages
Name: swig
Version: 3.0.8
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv3+ and BSD
URL: http://swig.sourceforge.net/
Source0: http://downloads.sourceforge.net/project/swig/swig/swig-%{version}/swig-%{version}.tar.gz
@ -51,7 +51,8 @@ Source4: ccache-swig.csh
# on these arches
Patch0: swig308-Fix-li_boost_array-test.patch
Patch1: swig308-Do-not-use-isystem.patch
Patch2: swig308-Update-test-for-macro-isfinite.patch
Patch2: swig308-Python-Use-std-isfinite-under-C-11.patch
BuildRequires: perl, python2-devel, pcre-devel
BuildRequires: autoconf, automake, gawk, dos2unix
@ -267,6 +268,9 @@ install -pm 644 %{SOURCE3} %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d
%doc Doc Examples COPYRIGHT
%changelog
* Tue Mar 01 2016 Jitka Plesnikova <jplesnik@redhat.com> - 3.0.8-5
- Used updated upstream fix for GCC 6 issue
* Mon Feb 22 2016 Jitka Plesnikova <jplesnik@redhat.com> - 3.0.8-4
- Patched to build against GCC 6
- Disable Go tests, because they failed against new Go 1.6

View File

@ -0,0 +1,15 @@
diff -up swig-3.0.8/Lib/typemaps/fragments.swg.orig swig-3.0.8/Lib/typemaps/fragments.swg
--- swig-3.0.8/Lib/typemaps/fragments.swg.orig 2015-12-30 23:23:47.000000000 +0100
+++ swig-3.0.8/Lib/typemaps/fragments.swg 2016-03-01 10:13:29.840682167 +0100
@@ -168,8 +168,11 @@
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
#ifndef SWIG_isfinite
+/* isfinite() is a macro for C99, but a function in namespace std for C++11. */
# if defined(isfinite)
# define SWIG_isfinite(X) (isfinite(X))
+# elif defined __cplusplus && __cplusplus >= 201103L
+# define SWIG_isfinite(X) (std::isfinite(X))
# elif defined(_MSC_VER)
# define SWIG_isfinite(X) (_finite(X))
# elif defined(__sun) && defined(__SVR4)

View File

@ -1,12 +0,0 @@
diff -up swig-3.0.8/Lib/typemaps/fragments.swg.orig swig-3.0.8/Lib/typemaps/fragments.swg
--- swig-3.0.8/Lib/typemaps/fragments.swg.orig 2016-02-18 08:30:57.625989817 +0100
+++ swig-3.0.8/Lib/typemaps/fragments.swg 2016-02-18 08:31:13.260900411 +0100
@@ -168,7 +168,7 @@
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
#ifndef SWIG_isfinite
-# if defined(isfinite)
+# if defined(isfinite) || (defined __cplusplus && __cplusplus >= 201103L)
# define SWIG_isfinite(X) (isfinite(X))
# elif defined(_MSC_VER)
# define SWIG_isfinite(X) (_finite(X))