summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-02-28 08:00:06 +0100
committerRemi Collet <fedora@famillecollet.com>2015-02-28 08:00:06 +0100
commit93859de439f26071e6804a7627d9a788c7156512 (patch)
tree7d9b1d2cdcedf5a83b8c3b5d875fabfcb6071e65
parent4134525dca1f47c8b6425efcc86c9b0f6943ea7e (diff)
php-pecl-quickhash: fix gcc 5 build
-rw-r--r--php-pecl-quickhash.spec10
-rw-r--r--quickhash-pr5.patch80
2 files changed, 88 insertions, 2 deletions
diff --git a/php-pecl-quickhash.spec b/php-pecl-quickhash.spec
index ce1f1ed..99fd042 100644
--- a/php-pecl-quickhash.spec
+++ b/php-pecl-quickhash.spec
@@ -2,7 +2,7 @@
#
# Copyright (c) 2013-2015 Remi Collet
# License: CC-BY-SA
-# http://creativecommons.org/licenses/by-sa/3.0/
+# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
@@ -22,7 +22,7 @@
Summary: Set of specific strongly-typed classes for sets and hashing
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.0.0
-Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
@@ -30,6 +30,7 @@ Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
# https://github.com/derickr/quickhash/pull/4
Patch0: %{pecl_name}-pr4.patch
+Patch1: %{pecl_name}-pr5.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel
@@ -84,6 +85,7 @@ mv %{pecl_name}-%{version} NTS
cd NTS
%patch0 -p1
+%patch1 -p1
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_QUICKHASH_VERSION/{s/.* "//;s/".*$//;p}' php_quickhash.h)
@@ -208,6 +210,10 @@ rm -rf %{buildroot}
%changelog
+* Sat Feb 28 2015 Remi Collet <remi@fedoraproject.org> - 1.0.0-6
+- add patch for GCC 5 build
+- open https://github.com/derickr/quickhash/pull/5
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.0.0-5.1
- Fedora 21 SCL mass rebuild
diff --git a/quickhash-pr5.patch b/quickhash-pr5.patch
new file mode 100644
index 0000000..5b95f21
--- /dev/null
+++ b/quickhash-pr5.patch
@@ -0,0 +1,80 @@
+From 6eb2e6c55e2c3247285648be5f918e6220e81968 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Sat, 28 Feb 2015 07:49:38 +0100
+Subject: [PATCH] Fix build with gcc 5
+
+See http://www.gnu.org/software/gcc/gcc-5/porting_to.html
+
+Simpler to drop "inline", especially as pointer to these functions are used.
+---
+ lib/hash-algorithms.c | 10 +++++-----
+ lib/hash-algorithms.h | 10 +++++-----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/lib/hash-algorithms.c b/lib/hash-algorithms.c
+index 86c3abc..96ab313 100644
+--- a/lib/hash-algorithms.c
++++ b/lib/hash-algorithms.c
+@@ -29,7 +29,7 @@
+ * Returns:
+ * - the hash key
+ */
+-inline uint32_t qha_jenkins1(uint32_t key)
++uint32_t qha_jenkins1(uint32_t key)
+ {
+ key = (key ^ 61) ^ (key >> 16);
+ key = key + (key << 3);
+@@ -50,7 +50,7 @@ inline uint32_t qha_jenkins1(uint32_t key)
+ * Returns:
+ * - the hash key
+ */
+-inline uint32_t qha_jenkins2(uint32_t key)
++uint32_t qha_jenkins2(uint32_t key)
+ {
+ key = (key+0x7ed55d16) + (key<<12);
+ key = (key^0xc761c23c) ^ (key>>19);
+@@ -70,12 +70,12 @@ inline uint32_t qha_jenkins2(uint32_t key)
+ * Returns:
+ * - the hash key
+ */
+-inline uint32_t qha_no_hash(uint32_t key)
++uint32_t qha_no_hash(uint32_t key)
+ {
+ return key;
+ }
+
+-inline uint32_t qha_djb2(char *key)
++uint32_t qha_djb2(char *key)
+ {
+ uint32_t hash = 5381;
+ int c;
+@@ -87,7 +87,7 @@ inline uint32_t qha_djb2(char *key)
+ return hash;
+ }
+
+-inline uint32_t qha_sdbm(char *key)
++uint32_t qha_sdbm(char *key)
+ {
+ uint32_t hash = 0;
+ int c;
+diff --git a/lib/hash-algorithms.h b/lib/hash-algorithms.h
+index 8de96cd..48da5fa 100644
+--- a/lib/hash-algorithms.h
++++ b/lib/hash-algorithms.h
+@@ -21,11 +21,11 @@
+ #ifndef QH_HASH_ALGORITHMS_H
+ #define QH_HASH_ALGORITHMS_H
+
+-inline uint32_t qha_jenkins1(uint32_t key);
+-inline uint32_t qha_jenkins2(uint32_t key);
+-inline uint32_t qha_no_hash(uint32_t key);
++uint32_t qha_jenkins1(uint32_t key);
++uint32_t qha_jenkins2(uint32_t key);
++uint32_t qha_no_hash(uint32_t key);
+
+-inline uint32_t qha_djb2(char *key);
+-inline uint32_t qha_sdbm(char *key);
++uint32_t qha_djb2(char *key);
++uint32_t qha_sdbm(char *key);
+
+ #endif