PDA

View Full Version : Missing includes in ClanLib 0.8.0



stick
10-18-2007, 02:57 PM
Hello ClanLib developers!

Our internal checks, here at SUSE, found out that ClanLib source code is
missing <cstring> in #includes. I'm attaching a patch (includes.patch)
:) I also noticed that ClanLib uses CLvoid instead of void. In GCC 4.3+
types typedefed to void cannot be used in places where void is expected.
(For example, you cannot pass CLvoid* to function expecting void*).
Please keep that in mind, when GCC 4.3 is out and being used ...

Magnus Norddahl
10-21-2007, 12:29 AM
Thank you for your patch - I've applied it to the svn version of ClanLib 0.8, so next official release will include it.

Regarding CLvoid, we only use this define as part of our OpenGL wrapper, where it attempts to stay as loyal as possible to the same defines and function declarations as the system OpenGL headers.

Why the GCC developers spend most of their time making pointless changes to their compiler that only breaks older working code is beyond my understanding, but either way I've applied a patch replacing all CLvoid places with just void. Hopefully it will keep it compiling for a week or two before FSF once again breaks something different but equally pointless. :)

stick
11-01-2007, 01:27 PM
Regarding CLvoid, we only use this define as part of our OpenGL wrapper, where it attempts to stay as loyal as possible to the same defines and function declarations as the system OpenGL headers.

Why the GCC developers spend most of their time making pointless changes to their compiler that only breaks older working code is beyond my understanding, but either way I've applied a patch replacing all CLvoid places with just void. Hopefully it will keep it compiling for a week or two before FSF once again breaks something different but equally pointless. :)

Ahhh, maybe I got it wrong and you CAN pass CLvoid* instead of void*. I got this error


g++ -DPACKAGE_NAME=\"ClanLib\" -DPACKAGE_TARNAME=\"clanlib\" -DPACKAGE_VERSION=\"0.8.0\" "-DPACKAGE_STRING=\"ClanLib 0.8.0\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"clanlib\" -DVERSION=\"0.8.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_KD_H=1 -DHAVE_SYS_VT_H=1 -DHAVE_FSTAB_H=1 -DSIZEOF_INT=4 -DHAVE_LIBZ=1 -DHAVE_LIBSDL_GFX=1 -DHAVE_GLX_GETPROCADDRESSARB=1 -DUSE_GETADDR=1 -I. -I. -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-aliasing -I../../Sources -MT setupdisplay.lo -MD -MP -MF .deps/setupdisplay.Tpo -c setupdisplay.cpp -fPIC -DPIC -o .libs/setupdisplay.o
In file included from ../../Sources/API/Display/Collision/collision_outline.h:60,
from resourcedata_collisionoutline.h:39,
from setupdisplay.cpp:43:
../../Sources/API/Display/Collision/../../GL/opengl_wrap.h:2533: error: '<anonymous>' has incomplete type
../../Sources/API/Display/Collision/../../GL/opengl_wrap.h:2533: error: invalid use of 'CLvoid'
make[2]: *** [setupdisplay.lo] Error 1
make[2]: Leaving directory `/usr/src/packages/BUILD/ClanLib-0.8.0/Sources/Display'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/ClanLib-0.8.0/Sources'
make: *** [all-recursive] Error 1

but now I'm trying to create a simple testcase and mixing void and CLvoid works. Maybe the problem is somewhere else ... :)

rombust
11-02-2007, 08:46 AM
Use 0.8 from the SVN. The problem you can see there, is an old fixed problem.

logixoul
06-26-2008, 10:29 AM
0.9 from svn doesn't compile on opensuse 11.0. patch attached.

rombust
06-26-2008, 12:36 PM
Applied patch, many thanks.