[ClanLib] Fix building with gcc-4.7

Hans de Goede jwrdegoede at fedoraproject.org
Thu Jan 12 21:36:02 UTC 2012


commit d61d05ef1e2d7f60a9f7d1a6c57463dfa3baf823
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Thu Jan 12 22:37:12 2012 +0100

    Fix building with gcc-4.7

 ClanLib-2.3.4-gcc47.patch |  107 +++++++++++++++++++++++++++++++++++++++++++++
 ClanLib.spec              |    7 +++-
 2 files changed, 113 insertions(+), 1 deletions(-)
---
diff --git a/ClanLib-2.3.4-gcc47.patch b/ClanLib-2.3.4-gcc47.patch
new file mode 100644
index 0000000..58b55cc
--- /dev/null
+++ b/ClanLib-2.3.4-gcc47.patch
@@ -0,0 +1,107 @@
+diff -up ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp~ ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp~	2011-07-22 10:03:21.000000000 +0200
++++ ClanLib-2.3.4/Sources/Core/IOData/file_help.cpp	2012-01-12 22:16:39.779011207 +0100
+@@ -34,6 +34,7 @@
+ #include "API/Core/System/exception.h"
+ 
+ #ifndef WIN32
++#include <unistd.h>
+ #include <sys/stat.h>
+ #endif
+ 
+diff -up ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp~ ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp~	2011-08-03 10:13:57.000000000 +0200
++++ ClanLib-2.3.4/Sources/Core/IOData/path_help.cpp	2012-01-12 22:18:30.754009662 +0100
+@@ -43,6 +43,7 @@
+ 
+ #ifndef WIN32
+ #include <cstring>
++#include <unistd.h>
+ #endif
+ 
+ /////////////////////////////////////////////////////////////////////////////
+diff -up ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp~ ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp~	2011-01-27 10:03:39.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/iodevice_provider_pipe_connection.cpp	2012-01-12 22:24:55.536004557 +0100
+@@ -33,6 +33,7 @@
+ #include "API/Core/Text/string_help.h"
+ #include "API/Core/Text/string_format.h"
+ #ifndef WIN32
++#include <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #ifndef UNIX_PATH_MAX
+diff -up ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp~ ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp~	2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/pipe_listen_impl.cpp	2012-01-12 22:25:17.359004259 +0100
+@@ -36,6 +36,7 @@
+ #include "API/Core/Text/string_help.h"
+ #ifndef WIN32
+ #include "Network/Socket/event_provider_unixsocket.h"
++#include <unistd.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #ifndef UNIX_PATH_MAX 
+diff -up ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp~ ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp~	2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/security_identifier.cpp	2012-01-12 22:26:06.047003649 +0100
+@@ -31,6 +31,9 @@
+ #include "API/Core/System/exception.h"
+ #ifdef WIN32
+ #include <AclAPI.h>
++#else
++#include <unistd.h>
++#include <sys/types.h>
+ #endif
+ 
+ /////////////////////////////////////////////////////////////////////////////
+diff -up ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp~ ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp
+--- ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp~	2011-11-25 09:16:46.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/IOData/virtual_directory.cpp	2012-01-12 22:26:37.583003215 +0100
+@@ -38,6 +38,10 @@
+ #include "API/Core/System/weakptr.h"
+ #include "API/Core/Text/string_help.h"
+ 
++#ifndef WIN32
++#include <unistd.h>
++#endif
++
+ /////////////////////////////////////////////////////////////////////////////
+ // CL_VirtualDirectory_Impl Class:
+ 
+diff -up ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp~ ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp
+--- ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp~	2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/System/Unix/service_unix.cpp	2012-01-12 22:29:12.478001042 +0100
+@@ -35,6 +35,7 @@
+ #include "service_unix.h"
+ #include <iostream>
+ #include <signal.h>
++#include <unistd.h>
+ 
+ /////////////////////////////////////////////////////////////////////////////
+ // CL_Service_Unix Construction:
+diff -up ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp~ ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp
+--- ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp~	2011-01-13 12:17:34.000000000 +0100
++++ ClanLib-2.3.4/Sources/Core/Text/console_logger.cpp	2012-01-12 22:27:54.446002158 +0100
+@@ -33,6 +33,10 @@
+ #include "API/Core/Text/string_format.h"
+ #include "API/Core/System/datetime.h"
+ 
++#ifndef WIN32
++#include <unistd.h>
++#endif
++
+ /////////////////////////////////////////////////////////////////////////////
+ // CL_ConsoleLogger Construction:
+ 
+diff -up ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp~ ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp
+--- ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp~	2012-01-12 22:18:49.000000000 +0100
++++ ClanLib-2.3.4/Sources/Display/X11/x11_window.cpp	2012-01-12 22:30:46.492999847 +0100
+@@ -50,6 +50,7 @@
+ #include "display_message_queue_x11.h"
+ #include <X11/Xatom.h>
+ #include <cstdio>
++#include <unistd.h>
+ #include "../Window/input_context_impl.h"
+ #include <X11/XKBlib.h>
+ #include <dlfcn.h>
diff --git a/ClanLib.spec b/ClanLib.spec
index 085e4cc..79c356d 100644
--- a/ClanLib.spec
+++ b/ClanLib.spec
@@ -1,7 +1,7 @@
 Summary:        Cross platform C++ game library
 Name:           ClanLib
 Version:        2.3.4
-Release:        3%{?dist}
+Release:        4%{?dist}
 Group:          System Environment/Libraries
 License:        zlib
 URL:            http://www.clanlib.org/
@@ -10,6 +10,7 @@ Source0:        http://www.clanlib.org/download/releases-2.0/%{name}-%{version}.
 # to reflect the exact version for which it was downloaded
 Source1:        ClanLib-%{version}-generated-docs.zip
 Patch0:         ClanLib-2.3.4-focus.patch
+Patch1:         ClanLib-2.3.4-gcc47.patch
 BuildRequires:  libX11-devel libXi-devel libXmu-devel libGLU-devel libICE-devel
 BuildRequires:  libXext-devel libXxf86vm-devel libXt-devel xorg-x11-proto-devel
 BuildRequires:  libvorbis-devel mikmod-devel alsa-lib-devel
@@ -37,6 +38,7 @@ ClanLib development headers and libraries
 %prep
 %setup -q -a 1
 %patch0 -p1
+%patch1 -p1
 mv reference_doxygen html
 
 
@@ -66,6 +68,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
 
 
 %changelog
+* Thu Jan 12 2012 Hans de Goede <hdegoede at redhat.com> - 2.3.4-4
+- Fix building with gcc-4.7
+
 * Thu Jan 12 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.3.4-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list