nel-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nel] GNU/Linux fixes


From: Loic Dachary
Subject: [Nel] GNU/Linux fixes
Date: Sun, 17 Feb 2002 15:38:17 +0100

        Hi,

        I'd be grateful if you could apply the patch below. It was
generated with today's CVS. Nel + snowballs compile + run with
this patch. Here is a short description:

        - AM_GL_VERIFY autoconf macro (not used but necessary to turn
          the current hackish workaround into a proper fix)

        - virtual destructors with throw() (gcc-3)

        - friend declaration 

        - Makefile inconsistency 

        - Missing newline at end of file

        - dynamic_cast workaround for gcc

        - Spurious dots in Makefile.am SUBDIRS

        - noop inlines that prevent proper compilation when in
          --with-debug mode

        - uncommented string after endif

        - proper stl lib inclusion when --with-debug=full

        - missing parenthesis at end of 'if' expr

        Thanks in advance,

Index: nel/acinclude.m4
===================================================================
RCS file: /home/cvsroot/code/nel/acinclude.m4,v
retrieving revision 1.7
diff -u -r1.7 acinclude.m4
--- nel/acinclude.m4    29 Jan 2002 13:21:42 -0000      1.7
+++ nel/acinclude.m4    17 Feb 2002 13:02:19 -0000
@@ -45,6 +45,14 @@
 dnl    Description: check the instalation of the OpenGL library and set the
 dnl                 OPENGL_CFLAGS and OPENGL_LIBS variables to use it.
 dnl
+dnl AM_GL_VERIFY
+dnl
+dnl    Description: checks OpenGL headers and libraries consistency.
+dnl                 Define NEL_ARB_MULTITEXTURE_NO_TYPEDEFS
+dnl                  if GL_ARB_multitexture is defined in gl.h but is missing
+dnl                  functions typedefs. This happens, for instance, with 
+dnl                   Mesa-3.4.2 & Mesa-4.0.1.
+dnl
 dnl
 dnl AM_PATH_FREETYPE
 dnl
@@ -605,6 +613,32 @@
 AC_SUBST(OPENGL_CFLAGS)
 AC_SUBST(OPENGL_LIBS)
 
+])
+
+AC_DEFUN(AM_GL_VERIFY,
+[ 
+_CPPFLAGS="$CPPFLAGS"
+
+CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS"
+
+AC_MSG_CHECKING([for GL_ARB_multitexture in gl.h])
+AC_EGREP_CPP(glActiveTextureARB,
+[#define GL_GLEXT_PROTOTYPES
+#include <GL/gl.h>],
+[
+  AC_EGREP_CPP(PFNGLACTIVETEXTUREARBPROC,
+  [#include <GL/gl.h>],
+  [AC_MSG_RESULT([found and typedefs defined])],
+  [
+    AC_MSG_RESULT([found and missing typdefs, define 
NEL_ARB_MULTITEXTURE_NO_TYPEDEFS])
+    AC_DEFINE(NEL_ARB_MULTITEXTURE_NO_TYPEDEFS)
+  ])
+],
+[
+  AC_MSG_RESULT([not found, this is ok])
+])
+
+CPPFLAGS="$_CPPFLAGS"
 ])
 
 
Index: nel/configure.in
===================================================================
RCS file: /home/cvsroot/code/nel/configure.in,v
retrieving revision 1.59
diff -u -r1.59 configure.in
--- nel/configure.in    28 Jan 2002 15:22:19 -0000      1.59
+++ nel/configure.in    17 Feb 2002 13:02:19 -0000
@@ -247,7 +247,7 @@
 dnl OpenGL
 
 AM_PATH_OPENGL($enable_3d)
-
+AM_GL_VERIFY
 
 dnl ====================================================================
 dnl Check for XF86VidMode extension (-lXxf86vm)
Index: nel/include/nel/misc/common.h
===================================================================
RCS file: /home/cvsroot/code/nel/include/nel/misc/common.h,v
retrieving revision 1.34
diff -u -r1.34 common.h
--- nel/include/nel/misc/common.h       12 Feb 2002 13:56:16 -0000      1.34
+++ nel/include/nel/misc/common.h       17 Feb 2002 13:02:22 -0000
@@ -240,6 +240,7 @@
        Exception();
        Exception(const std::string &reason);
        Exception(const char *format, ...);
+       virtual ~Exception() throw() {};
        virtual const char      *what() const throw();
 };
 
Index: nel/include/nel/misc/stream.h
===================================================================
RCS file: /home/cvsroot/code/nel/include/nel/misc/stream.h,v
retrieving revision 1.50
diff -u -r1.50 stream.h
--- nel/include/nel/misc/stream.h       27 Nov 2001 15:59:55 -0000      1.50
+++ nel/include/nel/misc/stream.h       17 Feb 2002 13:02:22 -0000
@@ -77,6 +77,8 @@
 
        EStream( const IStream &f, const std::string& str );
 
+       virtual ~EStream() throw() {}
+
        // May Not be Filled...
        std::string     StreamName;
 };
Index: nel/include/nel/net/buf_net_base.h
===================================================================
RCS file: /home/cvsroot/code/nel/include/nel/net/buf_net_base.h,v
retrieving revision 1.5
diff -u -r1.5 buf_net_base.h
--- nel/include/nel/net/buf_net_base.h  21 Jun 2001 12:35:16 -0000      1.5
+++ nel/include/nel/net/buf_net_base.h  17 Feb 2002 13:02:22 -0000
@@ -135,7 +135,7 @@
 
 protected:
 
-       friend CBufSock;
+       friend class NLNET::CBufSock;
        
        /// Constructor
        CBufNetBase();
Index: nel/src/3d/Makefile.am
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/Makefile.am,v
retrieving revision 1.67
diff -u -r1.67 Makefile.am
--- nel/src/3d/Makefile.am      15 Feb 2002 17:37:54 -0000      1.67
+++ nel/src/3d/Makefile.am      17 Feb 2002 13:02:25 -0000
@@ -460,10 +460,7 @@
                        visual_collision_manager_user.h                 \
                        water_height_map.cpp                            \
                        water_height_map.h                              \
-                       water_imp.cpp                                   \
                        water_model.cpp                                 \
-                       water_model.cpp (essai)                         \
-                       water_model.cpp(old)                            \
                        water_model.h                                   \
                        water_pool_manager.cpp                          \
                        water_pool_manager.h                            \
Index: nel/src/3d/cube_map_builder.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/cube_map_builder.h,v
retrieving revision 1.1
diff -u -r1.1 cube_map_builder.h
--- nel/src/3d/cube_map_builder.h       4 Feb 2002 10:42:31 -0000       1.1
+++ nel/src/3d/cube_map_builder.h       17 Feb 2002 13:02:25 -0000
@@ -57,4 +57,4 @@
 }
 
 
-#endif
\ No newline at end of file
+#endif
Index: nel/src/3d/landscape.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/landscape.h,v
retrieving revision 1.31
diff -u -r1.31 landscape.h
--- nel/src/3d/landscape.h      6 Feb 2002 16:54:56 -0000       1.31
+++ nel/src/3d/landscape.h      17 Feb 2002 13:02:25 -0000
@@ -104,6 +104,7 @@
 
 public:
        EBadBind() {}
+       ~EBadBind() throw () {}
        virtual const char      *what() const throw();
 
 };
Index: nel/src/3d/ps_misc.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/ps_misc.h,v
retrieving revision 1.1
diff -u -r1.1 ps_misc.h
--- nel/src/3d/ps_misc.h        2 Oct 2001 16:35:39 -0000       1.1
+++ nel/src/3d/ps_misc.h        17 Feb 2002 13:02:25 -0000
@@ -82,4 +82,4 @@
 
 } // NL3D
 
-#endif
\ No newline at end of file
+#endif
Index: nel/src/3d/scene.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/scene.cpp,v
retrieving revision 1.62
diff -u -r1.62 scene.cpp
--- nel/src/3d/scene.cpp        6 Feb 2002 16:54:56 -0000       1.62
+++ nel/src/3d/scene.cpp        17 Feb 2002 13:02:25 -0000
@@ -463,7 +463,11 @@
 #endif
 
        // Look if this instance get lightmap information
-       CMeshBase *pMB = dynamic_cast<CMeshBase*>( (IShape*)(pTShp->Shape) );
+#if defined(__GNUC__) && __GNUC__ < 3
+       CMeshBase *pMB = (CMeshBase*)((IShape*)(pTShp->Shape));
+#else // not GNUC
+       CMeshBase *pMB = dynamic_cast<CMeshBase*>((IShape*)(pTShp->Shape));
+#endif // not GNUC
        CMeshBaseInstance *pMBI = dynamic_cast<CMeshBaseInstance*>( pTShp );
        if( ( pMB != NULL ) && ( pMBI != NULL ) )
        { // Try to bind to automatic animation
Index: nel/src/3d/driver/Makefile.am
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/driver/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- nel/src/3d/driver/Makefile.am       18 Dec 2000 15:30:11 -0000      1.1
+++ nel/src/3d/driver/Makefile.am       17 Feb 2002 13:02:25 -0000
@@ -4,7 +4,7 @@
 
 MAINTAINERCLEANFILES = Makefile.in
 
-SUBDIRS              = opengl .
+SUBDIRS              = opengl
 
 
 # End of Makefile.am
Index: nel/src/3d/driver/opengl/driver_opengl.h
===================================================================
RCS file: /home/cvsroot/code/nel/src/3d/driver/opengl/driver_opengl.h,v
retrieving revision 1.110
diff -u -r1.110 driver_opengl.h
--- nel/src/3d/driver/opengl/driver_opengl.h    15 Feb 2002 17:43:03 -0000      
1.110
+++ nel/src/3d/driver/opengl/driver_opengl.h    17 Feb 2002 13:02:26 -0000
@@ -381,10 +381,10 @@
        virtual void                    forceTextureResize(uint divisor);
 
        /// Setup texture env functions. Used by setupMaterial
-       inline void                             setTextureEnvFunction(uint 
stage, CMaterial& mat);
+       void                            setTextureEnvFunction(uint stage, 
CMaterial& mat);
 
        /// setup the texture matrix for a given number of stages (starting 
from 0)
-       inline void      setupUserTextureMatrix(uint numStages, CMaterial& mat);
+       void      setupUserTextureMatrix(uint numStages, CMaterial& mat);
 
        /// For objects with caustics, setup the first texture (which actually 
is the one from the material)
        /*static inline void            setupCausticsFirstTex(const CMaterial 
&mat);
Index: nel/src/3d/driver/opengl/driver_opengl_material.cpp
===================================================================
RCS file: 
/home/cvsroot/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp,v
retrieving revision 1.57
diff -u -r1.57 driver_opengl_material.cpp
--- nel/src/3d/driver/opengl/driver_opengl_material.cpp 15 Feb 2002 17:43:41 
-0000      1.57
+++ nel/src/3d/driver/opengl/driver_opengl_material.cpp 17 Feb 2002 13:02:27 
-0000
@@ -104,7 +104,7 @@
 
 
 // --------------------------------------------------
-inline void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
+void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
 {
        ITexture        *text= mat.getTexture(stage);
        if(text)
@@ -138,7 +138,7 @@
 
 
 //--------------------------------
-inline void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
+void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
 { 
        if (
                (_UserTexMatEnabled != 0 && (mat.getFlags() & 
IDRV_MAT_USER_TEX_MAT_ALL) == 0)          
Index: nel/src/misc/Makefile.am
===================================================================
RCS file: /home/cvsroot/code/nel/src/misc/Makefile.am,v
retrieving revision 1.39
diff -u -r1.39 Makefile.am
--- nel/src/misc/Makefile.am    12 Dec 2001 15:40:10 -0000      1.39
+++ nel/src/misc/Makefile.am    17 Feb 2002 13:02:28 -0000
@@ -4,7 +4,7 @@
 
 MAINTAINERCLEANFILES  = Makefile.in
 
-SUBDIRS               = config_file .
+SUBDIRS               = config_file
 
 lib_LTLIBRARIES       = libnelmisc.la
 
Index: nel/src/misc/mutex.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/misc/mutex.cpp,v
retrieving revision 1.26
diff -u -r1.26 mutex.cpp
--- nel/src/misc/mutex.cpp      8 Jan 2002 15:56:36 -0000       1.26
+++ nel/src/misc/mutex.cpp      17 Feb 2002 13:02:28 -0000
@@ -25,7 +25,9 @@
 
 #include "stdmisc.h"
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif // _GNU_SOURCE
 
 #include "nel/misc/mutex.h"
 #include "nel/misc/time_nl.h"
Index: nel/src/misc/path.cpp
===================================================================
RCS file: /home/cvsroot/code/nel/src/misc/path.cpp,v
retrieving revision 1.19
diff -u -r1.19 path.cpp
--- nel/src/misc/path.cpp       12 Feb 2002 13:55:59 -0000      1.19
+++ nel/src/misc/path.cpp       17 Feb 2002 13:02:28 -0000
@@ -723,7 +723,7 @@
 #else // NL_OS_WINDOWS
        struct stat buf;
        return stat (filename.c_str (), &buf) == 0;
-#endif NL_OS_WINDOWS
+#endif // NL_OS_WINDOWS
 }
 
 bool CFile::fileExists (const string& filename)
Index: nel/src/sound/driver/Makefile.am
===================================================================
RCS file: /home/cvsroot/code/nel/src/sound/driver/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- nel/src/sound/driver/Makefile.am    3 Aug 2001 10:16:59 -0000       1.2
+++ nel/src/sound/driver/Makefile.am    17 Feb 2002 13:02:29 -0000
@@ -4,7 +4,7 @@
 
 MAINTAINERCLEANFILES          = Makefile.in
 
-SUBDIRS                       = openal .
+SUBDIRS                       = openal
 
 noinst_LTLIBRARIES            = libnelsnd_lowlevel.la
 
Index: snowballs2/acinclude.m4
===================================================================
RCS file: /home/cvsroot/code/snowballs2/acinclude.m4,v
retrieving revision 1.7
diff -u -r1.7 acinclude.m4
--- snowballs2/acinclude.m4     29 Jan 2002 13:21:42 -0000      1.7
+++ snowballs2/acinclude.m4     17 Feb 2002 13:02:43 -0000
@@ -364,7 +364,12 @@
                           path to the STLPort library files directory.
                           e.g. /usr/local/stlport/lib])
 
-stlport_lib="stlport_gcc"
+if test "$with_debug" = "full"
+then
+       stlport_lib="stlport_gcc_stldebug"
+else
+       stlport_lib="stlport_gcc"
+fi
 
 if test "$with_stlport" = no
 then
Index: snowballs2/client/src/entities.cpp
===================================================================
RCS file: /home/cvsroot/code/snowballs2/client/src/entities.cpp,v
retrieving revision 1.42
diff -u -r1.42 entities.cpp
--- snowballs2/client/src/entities.cpp  14 Feb 2002 13:03:53 -0000      1.42
+++ snowballs2/client/src/entities.cpp  17 Feb 2002 13:02:44 -0000
@@ -719,7 +719,7 @@
                        }
 */
                        // snap to the ground
-                       if (!GlobalRetriever->isInterior(gPos)
+                       if (!GlobalRetriever->isInterior(gPos))
                                
entity.VisualCollisionEntity->snapToGround(entity.Position);
 
                        if (entity.Type == CEntity::Other &&
@@ -728,7 +728,7 @@
 //                             nlinfo("detected over entity %d", entity.Id);
                                entity.ServerPosition.z = entity.Position.z;
                                entity.Position = entity.ServerPosition;
-                               if (!GlobalRetriever->isInterior(gPos)
+                               if (!GlobalRetriever->isInterior(gPos))
                                        
entity.VisualCollisionEntity->snapToGround(entity.Position);
                                
entity.MovePrimitive->setGlobalPosition(CVectorD(entity.Position.x, 
entity.Position.y, entity.Position.z), 0);
                        }

-- 
Loic   Dachary         http://www.dachary.org/  address@hidden
12 bd  Magenta         http://www.senga.org/      address@hidden
75010    Paris         T: 33 1 42 45 07 97          address@hidden
        GPG Public Key: http://www.dachary.org/loic/gpg.txt


reply via email to

[Prev in Thread] Current Thread [Next in Thread]