aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: uintptr_t (cross-compilation)  (Read 5148 times)

p.r.

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
uintptr_t (cross-compilation)
« on: January 17, 2009, 06:05:26 PM »

I have cross-compilation error with aMule-2.2.3 source code.
But I had no errors with aMule-2.2.2 source code, the problem occurs only with aMule-2.2.3 source code.

I can't understand why "uintptr_t" is undeclared.
I have no knowledge of C/CPP
Please help.

Cross-toolchains:
Code: [Select]
Linux kernel 2.4.21-pre4
uClibc 0.9.26
GCC-3.3.3

powerpc-linux-uclibc/include/stdint.h (fragment):
Code: [Select]
/* Types for `void *' pointers.  */
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
typedef long int                intptr_t;
#  define __intptr_t_defined
# endif
typedef unsigned long int       uintptr_t;
#else
# ifndef __intptr_t_defined
typedef int                     intptr_t;
#  define __intptr_t_defined
# endif
typedef unsigned int            uintptr_t;
#endif

cross-compilation errors
Code: [Select]
...
Compiling Format.cpp
Format.cpp: In member function `CFormat& CFormat::operator%(void*)':
Format.cpp:432: error: `uintptr_t' undeclared (first use this function)
Format.cpp:432: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
Format.cpp:432: error: parse error before `)' token
Format.cpp:434: error: parse error before `)' token
make[4]: *** [Format.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: uintptr_t (cross-compilation)
« Reply #1 on: January 17, 2009, 06:25:35 PM »

Could you please try to include stdint.h in the file Format.cpp (add #include <stdint.h> where the other includes are) and see if it works then?
Logged

p.r.

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
Re: uintptr_t (cross-compilation)
« Reply #2 on: January 17, 2009, 08:02:19 PM »

Could you please try to include stdint.h in the file Format.cpp (add #include <stdint.h> where the other includes are) and see if it works then?
Thank you, it works.
Simple insertion of
Code: [Select]
#include <stdint.h> into Format.cpp has corrected the error:
Code: [Select]
...
Building libec.a
Compiling Format.cpp
Compiling MD5Sum.cpp
Compiling MuleDebug.cpp
Compiling StringFunctions.cpp
Compiling FileFunctions.cpp
Compiling TextFile.cpp
Compiling Path.cpp
...

There was no need to add stdint.h with full path.
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: uintptr_t (cross-compilation)
« Reply #3 on: January 17, 2009, 08:35:57 PM »

Thanks a lot for this report, this problem will not occur with the next version of aMule. :)
Logged