wvdial: fix build with gcc 6

This commit is contained in:
Juergen Daubert 2016-07-02 13:51:26 +02:00
parent 5b8fcf3d96
commit f1b1652d94
3 changed files with 62 additions and 4 deletions

View File

@ -3,4 +3,5 @@ acd3b2050c9b65fff2aecda6576ee7bc wvdial-1.61.tar.gz
55223f12591529d2a2a1892cb2a261d1 wvstreams-4.6.1-gcc47.patch
03786884a06fe119f6201dcc8a40639d wvstreams-4.6.1-include_stat.patch
1d224fb5dcde664258f681db2f422737 wvstreams-4.6.1-openssl.patch
93c763880bf11a9b23e863358c5fb333 wvstreams-4.6.1-use-explicit-cast.patch
2760dac31a43d452a19a3147bfde571c wvstreams-4.6.1.tar.gz

View File

@ -5,11 +5,14 @@
name=wvdial
version=1.61
release=5
release=6
source=(https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wvstreams/$name-$version.tar.gz \
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wvstreams/wvstreams-4.6.1.tar.gz \
$name-$version.patch wvstreams-4.6.1-openssl.patch \
wvstreams-4.6.1-include_stat.patch wvstreams-4.6.1-gcc47.patch)
$name-$version.patch \
wvstreams-4.6.1-openssl.patch \
wvstreams-4.6.1-include_stat.patch \
wvstreams-4.6.1-gcc47.patch \
wvstreams-4.6.1-use-explicit-cast.patch)
build() {
@ -17,12 +20,16 @@ build() {
cd wvstreams-4.6.1
patch -p1 -i $SRC/wvstreams-4.6.1-use-explicit-cast.patch
patch -p1 -i $SRC/wvstreams-4.6.1-openssl.patch
patch -p1 -i $SRC/wvstreams-4.6.1-include_stat.patch
patch -p1 -i $SRC/wvstreams-4.6.1-gcc47.patch
./configure --prefix=/usr --without-{pam,tcl,qt,dbus}
make -j1 CXXOPTS='-fno-tree-dce -fno-optimize-sibling-calls -fPIC -DPIC' COPTS='-O2 -fPIC -DPIC'
CXXOPTS='-fno-tree-dce -fno-optimize-sibling-calls -fPIC -DPIC -w' \
COPTS='-O2 -fPIC -DPIC' \
make -j1
cd $SRC/$name-$version

View File

@ -0,0 +1,50 @@
From 32ecfa8e89306ace726f7ad14f2b09c2aa1b96c4 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Tue, 9 Feb 2016 21:02:59 +0100
Subject: [PATCH] Use explicit cast and prevent compiler error
---
streams/wvstream.cc | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/streams/wvstream.cc b/streams/wvstream.cc
index 4564f3c..76565b4 100644
--- a/streams/wvstream.cc
+++ b/streams/wvstream.cc
@@ -907,9 +907,9 @@ void WvStream::_build_selectinfo(SelectInfo &si, time_t msec_timeout,
if (forceable)
{
- si.wants.readable = readcb;
- si.wants.writable = writecb;
- si.wants.isexception = exceptcb;
+ si.wants.readable = static_cast<bool>(readcb);
+ si.wants.writable = static_cast<bool>(writecb);
+ si.wants.isexception = static_cast<bool>(exceptcb);
}
else
{
@@ -1019,7 +1019,7 @@ bool WvStream::_select(time_t msec_timeout, bool readable, bool writable,
IWvStream::SelectRequest WvStream::get_select_request()
{
- return IWvStream::SelectRequest(readcb, writecb, exceptcb);
+ return IWvStream::SelectRequest(static_cast<bool>(readcb), static_cast<bool>(writecb), static_cast<bool>(exceptcb));
}
@@ -1107,7 +1107,10 @@ bool WvStream::continue_select(time_t msec_timeout)
// inefficient, because if the alarm was expired then pre_select()
// returned true anyway and short-circuited the previous select().
TRACE("hello-%p\n", this);
- return !alarm_was_ticking || select(0, readcb, writecb, exceptcb);
+ return !alarm_was_ticking || select(0,
+ static_cast<bool>(readcb),
+ static_cast<bool>(writecb),
+ static_cast<bool>(exceptcb));
}
--
2.5.0