fix conflict with max() macro with gcc6, which causes build failure in KDE/Qt

like krfb
epel9
Than Ngo 9 years ago
parent 12553b15db
commit 3dc41b0aec

@ -0,0 +1,99 @@
diff -Nur libvncserver-LibVNCServer-0.9.10.than/libvncclient/listen.c libvncserver-LibVNCServer-0.9.10/libvncclient/listen.c
--- libvncserver-LibVNCServer-0.9.10.than/libvncclient/listen.c 2014-10-21 17:57:11.000000000 +0200
+++ libvncserver-LibVNCServer-0.9.10/libvncclient/listen.c 2016-02-18 13:13:26.265271713 +0100
@@ -99,7 +99,7 @@
if(listen6Socket >= 0)
FD_SET(listen6Socket, &fds);
- r = select(max(listenSocket, listen6Socket)+1, &fds, NULL, NULL, NULL);
+ r = select(VNC_MAX(listenSocket, listen6Socket)+1, &fds, NULL, NULL, NULL);
if (r > 0) {
if (FD_ISSET(listenSocket, &fds))
@@ -195,9 +195,9 @@
FD_SET(client->listen6Sock, &fds);
if (timeout < 0)
- r = select(max(client->listenSock, client->listen6Sock) +1, &fds, NULL, NULL, NULL);
+ r = select(VNC_MAX(client->listenSock, client->listen6Sock) +1, &fds, NULL, NULL, NULL);
else
- r = select(max(client->listenSock, client->listen6Sock) +1, &fds, NULL, NULL, &to);
+ r = select(VNC_MAX(client->listenSock, client->listen6Sock) +1, &fds, NULL, NULL, &to);
if (r > 0)
{
diff -Nur libvncserver-LibVNCServer-0.9.10.than/libvncserver/httpd.c libvncserver-LibVNCServer-0.9.10/libvncserver/httpd.c
--- libvncserver-LibVNCServer-0.9.10.than/libvncserver/httpd.c 2014-10-21 17:57:11.000000000 +0200
+++ libvncserver-LibVNCServer-0.9.10/libvncserver/httpd.c 2016-02-18 13:13:56.527062313 +0100
@@ -192,7 +192,7 @@
}
tv.tv_sec = 0;
tv.tv_usec = 0;
- nfds = select(max(rfbScreen->httpListen6Sock, max(rfbScreen->httpSock,rfbScreen->httpListenSock)) + 1, &fds, NULL, NULL, &tv);
+ nfds = select(VNC_MAX(rfbScreen->httpListen6Sock, VNC_MAX(rfbScreen->httpSock,rfbScreen->httpListenSock)) + 1, &fds, NULL, NULL, &tv);
if (nfds == 0) {
return;
}
diff -Nur libvncserver-LibVNCServer-0.9.10.than/libvncserver/rfbserver.c libvncserver-LibVNCServer-0.9.10/libvncserver/rfbserver.c
--- libvncserver-LibVNCServer-0.9.10.than/libvncserver/rfbserver.c 2014-10-21 17:57:11.000000000 +0200
+++ libvncserver-LibVNCServer-0.9.10/libvncserver/rfbserver.c 2016-02-18 13:13:40.808171081 +0100
@@ -367,7 +367,7 @@
}
FD_SET(sock,&(rfbScreen->allFds));
- rfbScreen->maxFd = max(sock,rfbScreen->maxFd);
+ rfbScreen->maxFd = VNC_MAX(sock,rfbScreen->maxFd);
INIT_MUTEX(cl->outputMutex);
INIT_MUTEX(cl->refCountMutex);
diff -Nur libvncserver-LibVNCServer-0.9.10.than/libvncserver/sockets.c libvncserver-LibVNCServer-0.9.10/libvncserver/sockets.c
--- libvncserver-LibVNCServer-0.9.10.than/libvncserver/sockets.c 2014-10-21 17:57:11.000000000 +0200
+++ libvncserver-LibVNCServer-0.9.10/libvncserver/sockets.c 2016-02-18 13:13:48.695116507 +0100
@@ -193,7 +193,7 @@
rfbLog("Autoprobing selected TCP6 port %d\n", rfbScreen->ipv6port);
FD_SET(rfbScreen->listen6Sock, &(rfbScreen->allFds));
- rfbScreen->maxFd = max((int)rfbScreen->listen6Sock,rfbScreen->maxFd);
+ rfbScreen->maxFd = VNC_MAX((int)rfbScreen->listen6Sock,rfbScreen->maxFd);
#endif
}
else
@@ -220,7 +220,7 @@
rfbLog("Listening for VNC connections on TCP6 port %d\n", rfbScreen->ipv6port);
FD_SET(rfbScreen->listen6Sock, &(rfbScreen->allFds));
- rfbScreen->maxFd = max((int)rfbScreen->listen6Sock,rfbScreen->maxFd);
+ rfbScreen->maxFd = VNC_MAX((int)rfbScreen->listen6Sock,rfbScreen->maxFd);
}
#endif
@@ -236,7 +236,7 @@
rfbLog("Listening for VNC connections on TCP port %d\n", rfbScreen->port);
FD_SET(rfbScreen->udpSock, &(rfbScreen->allFds));
- rfbScreen->maxFd = max((int)rfbScreen->udpSock,rfbScreen->maxFd);
+ rfbScreen->maxFd = VNC_MAX((int)rfbScreen->udpSock,rfbScreen->maxFd);
}
}
@@ -555,7 +555,7 @@
/* AddEnabledDevice(sock); */
FD_SET(sock, &rfbScreen->allFds);
- rfbScreen->maxFd = max(sock,rfbScreen->maxFd);
+ rfbScreen->maxFd = VNC_MAX(sock,rfbScreen->maxFd);
return sock;
}
diff -Nur libvncserver-LibVNCServer-0.9.10.than/rfb/rfbproto.h libvncserver-LibVNCServer-0.9.10/rfb/rfbproto.h
--- libvncserver-LibVNCServer-0.9.10.than/rfb/rfbproto.h 2014-10-21 17:57:11.000000000 +0200
+++ libvncserver-LibVNCServer-0.9.10/rfb/rfbproto.h 2016-02-18 13:14:08.672978267 +0100
@@ -93,7 +93,7 @@
#endif
#if !defined(WIN32) || defined(__MINGW32__)
-#define max(a,b) (((a)>(b))?(a):(b))
+#define VNC_MAX(a,b) (((a)>(b))?(a):(b))
#ifdef LIBVNCSERVER_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif

@ -1,7 +1,7 @@
Summary: Library to make writing a VNC server easy
Name: libvncserver
Version: 0.9.10
Release: 4%{?dist}
Release: 5%{?dist}
# NOTE: --with-filetransfer => GPLv2
License: GPLv2+
@ -11,6 +11,7 @@ Source0: https://github.com/LibVNC/libvncserver/archive/LibVNCServer-%{versio
Patch1: LibVNCServer-0.9.10-system_minilzo.patch
Patch2: libvncserver-0.9.1-multilib.patch
Patch3: LibVNCServer-0.9.10-system-crypto-policy.patch
Patch4: LibVNCServer-0.9.10-max-gcc6.patch
BuildRequires: autoconf
BuildRequires: automake
@ -66,6 +67,7 @@ developing applications that use %{name}.
rm -fv common/lzodefs.h common/lzoconf.h commmon/minilzo.h common/minilzo.c
%patch2 -p1 -b .multilib
%patch3 -p1
%patch4 -p1
# Fix encoding
for file in ChangeLog ; do
@ -127,6 +129,10 @@ make -C test test ||:
%changelog
* Thu Feb 18 2016 Than Ngo <than@redhat.com> - 0.9.10-5
- fix conflict with max() macro with gcc6, which causes build failure in KDE/Qt
like krfb
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

Loading…
Cancel
Save