Bug 97179 - Compilation error on x86-64 due to redefinion of __u64 in cdromAccess.ccpp
Summary: Compilation error on x86-64 due to redefinion of __u64 in cdromAccess.ccpp
Status: RESOLVED UNMAINTAINED
Alias: None
Product: mpeglib
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
: 100476 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-16 21:18 UTC by james
Modified: 2011-09-19 12:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description james 2005-01-16 21:18:56 UTC
Version:           CVS as of Sunday 16 January 2005 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          
gcc (GCC) 3.4.3  (Gentoo Linux 3.4.3, ssp-3.4.3-0, pie-8.7.6.6)
 
OS:                Linux

Just got a new AMD64, and compiling KDE from CVS results in an error compiling kdemultimedia/mpeglib/lib/input/cdromAccess.cpp

Specifically:

/usr/include/asm/types.h:32: error: conflicting declaration 'typedef long long unsigned int __u64'
cdromAccess.cpp:32: error: '__u64' has a previous declaration as `typedef long unsigned int __u64'
/usr/include/asm/types.h:32: error: declaration of `typedef long long unsigned int __u64'
cdromAccess.cpp:32: error: conflicts with previous declaration `typedef long unsigned int __u64'
/usr/include/asm/types.h:32: error: declaration of `typedef long long unsigned int __u64'
cdromAccess.cpp:32: error: conflicts with previous declaration `typedef long unsigned int __u64'
make: *** [cdromAccess.lo] Error 1

What seems to be happening is that in KERNEL_VERSION > 2.5.70, it's using the kernel headers, but it's being redefined right after that due to the 1.09->1.10 revision in CVS of the file. 

The addition of an additional #ifdef __u64 should fix it. (as the diff below has) 

--- /usr/portage/distfiles/cvs-src/kde/kdemultimedia/mpeglib/lib/input/cdromAccess.cpp  2004-12-16 15:36:44.000000000 -0600
+++ kdemultimedia/mpeglib/lib/input/cdromAccess.cpp     2005-01-16 04:15:10.378563408 -0600
@@ -28,6 +28,7 @@
   #ifndef __u64
   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,70)
   #include <bits/wordsize.h>
+  #ifndef __u64
   #if __WORDSIZE == 64
   typedef unsigned long __u64;
   #else
@@ -35,6 +36,7 @@
   #endif
   #endif
   #endif
+  #endif
   #include "cdromAccess_Linux.cpp"
 #endif
Comment 1 james 2005-01-16 21:27:14 UTC
Ooops, mistake in the above. Don't use.
Comment 2 james 2005-01-17 01:00:26 UTC
The kernel's definition of __u64 for x86-64 appears to be unsigned long long, conflicting with the word size test used.

Changing
#if __WORDSIZE == 64 
to
#if __WORDSIZE == 64 && !defined(__x86_64__) 
fixes it for me. And should fix it for all x86-64 users.
Comment 3 james 2005-01-28 19:12:41 UTC
See also: http://bugs.gentoo.org/show_bug.cgi?id=74961
Comment 4 james 2005-03-22 02:16:08 UTC
Can someone apply this, because as of 
Gentoo patch applied to 3.4.0 which works here: 

--- mpeglib/lib/input/cdromAccess.cpp.org       2005-02-02 14:06:28.000000000 +0100
+++ mpeglib/lib/input/cdromAccess.cpp   2005-02-02 14:07:30.000000000 +0100
@@ -27,6 +27,9 @@
   #include <sys/types.h>
   #ifndef __u64
   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,70)
+  #ifdef __x86_64__
+  typedef unsigned long long __u64;
+  #else
   #include <bits/wordsize.h>
   #if __WORDSIZE == 64
   typedef unsigned long __u64;
@@ -35,6 +38,7 @@
   #endif
   #endif
   #endif
+  #endif
   #include "cdromAccess_Linux.cpp"
 #endif
Comment 5 Christoph Feck 2011-09-19 12:30:32 UTC
*** Bug 100476 has been marked as a duplicate of this bug. ***
Comment 6 Christoph Feck 2011-09-19 12:31:51 UTC
This component has been replaced with Phonon in KDE 4. If this issue still needs to be addressed, please add a comment, or report it for Phonon.