Jump to content

[PATCH][8080] Using GCC 4.4 on Fedora 11 [Pre-Release] x86_64


Auntie Mangos

Recommended Posts

Mangos Version: 7739

Custom Patches: None

SD2 Version: None

Database Name and Version : None

How it SHOULD work: Compile without Errors

How it DOES work: Compile with Errors

Posted this earlier in the Bug section without receving any negative comments. Posting here for review by dev team.

Ref: http://getmangos.eu/community/viewtopic.php?id=7742

Command Output for GCC/Kernel

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.29.1-111.fc11.x86_64 #1 SMP Fri Apr 24 10:57:09 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# yum list | grep ^gcc
gcc.x86_64                              4.4.0-3                        installed
gcc-c++.x86_64                          4.4.0-3                        installed
gcc-gfortran.x86_64                     4.4.0-3                        installed
gcc-gnat.x86_64                         4.4.0-3                        rawhide  
gcc-java.x86_64                         4.4.0-3                        rawhide  
gcc-objc.x86_64                         4.4.0-3                        rawhide  
gcc-objc++.x86_64                       4.4.0-3                        rawhide  
[root@localhost ~]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i586 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.0 20090427 (Red Hat 4.4.0-3) (GCC) 

The patch i created to get mangos to compile from clean git

diff --git a/dep/src/sockets/SocketHandler.cpp b/dep/src/sockets/SocketHandler.cpp
index 9ec5412..64a0d9f 100644
--- a/dep/src/sockets/SocketHandler.cpp
+++ b/dep/src/sockets/SocketHandler.cpp
@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#pragma warning(disable:4786)
#endif
#endif
+#include <cstdio>
#include <stdlib.h>
#include <errno.h>

diff --git a/dep/src/sockets/StdoutLog.cpp b/dep/src/sockets/StdoutLog.cpp
index c01d8b8..190c65b 100644
--- a/dep/src/sockets/StdoutLog.cpp
+++ b/dep/src/sockets/StdoutLog.cpp
@@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#ifdef _MSC_VER
#pragma warning(disable:4786)
#endif
+#include <cstdio>
#include "ISocketHandler.h"
#include "Socket.h"
#include "StdoutLog.h"
diff --git a/dep/src/sockets/TcpSocket.cpp b/dep/src/sockets/TcpSocket.cpp
index 36df37d..75d307f 100644
--- a/dep/src/sockets/TcpSocket.cpp
+++ b/dep/src/sockets/TcpSocket.cpp
@@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#else
#include <errno.h>
#endif
+#include <cstdio>
#include "ISocketHandler.h"
#include <fcntl.h>
#include <assert.h>
diff --git a/src/shared/vmap/CoordModelMapping.h b/src/shared/vmap/CoordModelMapping.h
index 71b5163..32b8b1c 100644
--- a/src/shared/vmap/CoordModelMapping.h
+++ b/src/shared/vmap/CoordModelMapping.h
@@ -19,6 +19,7 @@
#ifndef _COORDMODELMAPPING_H_
#define _COORDMODELMAPPING_H_

+#include <cstdio>
#include <G3D/Table.h>
#include <G3D/Array.h>

diff --git a/src/shared/vmap/DebugCmdLogger.h b/src/shared/vmap/DebugCmdLogger.h
index b9cc05c..6a2bf1e 100644
--- a/src/shared/vmap/DebugCmdLogger.h
+++ b/src/shared/vmap/DebugCmdLogger.h
@@ -19,6 +19,7 @@
#ifndef _DEBUGCMDLOGGER_H
#define _DEBUGCMDLOGGER_H

+#include <cstdio>
#include <G3D/Vector3.h>
#include <G3D/Array.h>

Link to comment
Share on other sites

  • 39 years later...

#ifdef __GNUC__ >= 4.4

does not look like proper preprocessor syntax to me..."#ifdef" does not take expressions, only checks for existing definition. Nor do i think __GNUC__ defines minor versions.

I think it evaluates to true for any GCC...

You probably meant to check something like:

#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4)

But in my opinion the check is unnecessary anyway, just because older compilers include it implicitly doesn't mean it was ever meant to be by the C++ standard...just add the missing includes without exceptions.

Link to comment
Share on other sites

  • 1 month later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use