"Itay 'z9u2K' Duvdevani" <[EMAIL PROTECTED]> writes:

> While emergeing kdemultimedia-3.1.2-r1, cdconfigimp.cpp fails to compile due 
> to an undefines type, __u64, that is defined in /usr/include/asm/types.h.
> 
> looking at /usr/include/asm/types.h (kernel 2.4.21, i386 vanilla, lines 20-23) 
> I see that the types __u64 and __s64 will be defines only when compiling 
> under GCC and while not under strinct ANSI mode.
> 
> Looking at the emerge output, I see the file (cdconfigimp.cpp) was compiled 
> with this command:
> g++ -DHAVE_CONFIG_H -I. -I. -I..   -I/usr/kde/3.1/include -I/usr/qt/3/include 
> -I/usr/X11R6/include  -static -Wall 
> -DDATADIR=\"/usr/kde/3.1/share/apps/kaudiocreator\" -DQT_THREAD_SUPPORT  
> -D_REENTRANT -I/usr/X11R6/include,esd  -Wnon-virtual-dtor -Wno-long-long 
> -Wundef -Wall
> 
> -pedantic
> 
> -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings
> 
> -ansi
> 
> -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -DNDEBUG 
> -DNO_DEBUG -O2 -O2 -march=athlon-xp -pipe -ffast-math -mmmx -msse -m3dnow 
> -fomit-frame-pointer -funroll-loops -fno-exceptions -fno-check-new 
> -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST  -c -o cdconfigimp.o `test -f 
> 'cdconfigimp.cpp' || echo './'`cdconfigimp.cpp
> 
> So no wonder GCC complians it has no __u64, -ansi and -pedantic  won't let it 
> GCC define these types...
> 
> Well, I though about commenting out these #if and #endif lines "just this 
> once", but I might REALY screw things up... :)
> 
> Help?
> Thanks.

Don't screw up the system headers. If you really want to muck around
with code, modify cdconfigimp.cpp by adding

#if defined(__GNUC__) && defined(__STRICT_ANSI__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#endif

Another possible solution is to surround <sys/types.h> with

#if defined(__GNUC__) && defined(__STRICT_ANSI__)
#define SAVED_STRICT_ANSI __STRICT_ANSI__
#undef __STRICT_ANSI__ 
#endif

#include <sys/types.h>

#if defined(__GNUC__) && defined(SAVED_STRICT_ANSI)
#define __STRICT_ANSI__ SAVED_STRICT_ANSI
#endif

in this source file only (UNTESTED!). This assumes that sys/types.h is
included from the source directly, not from another header. 

In either case, you will still get a warning, because ISO C++ does not
support long long, but I think it will work (UNTESTED!).

The proper approach is probably to have a closer look at the code and
see whether it really needs the long long type.

-- 
Oleg Goldshmidt | [EMAIL PROTECTED]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to