Menu

#12 Patch for undefined uintptr_t

closed-accepted
None
5
2006-03-17
2006-03-13
No

Bonjour,

Here's a patch proposal to make loki-lib compile under
a RedHat 9 Linux distribution.

There's only one issue. Let's see make results:

make -C src build-static
make[1]: Entering directory
`/usr/src/redhat/BUILD/loki-0.1.4/src'
g++ -Wall -Wold-style-cast -Wundef -Wsign-compare
-Wconversion -Wpointer-arith -pedantic -O2 -I../include
-DNDEBUG -c -o OrderedStatic.o OrderedStatic.cpp
g++ -Wall -Wold-style-cast -Wundef -Wsign-compare
-Wconversion -Wpointer-arith -pedantic -O2 -I../include
-DNDEBUG -c -o SafeFormat.o SafeFormat.cpp
g++ -Wall -Wold-style-cast -Wundef -Wsign-compare
-Wconversion -Wpointer-arith -pedantic -O2 -I../include
-DNDEBUG -c -o Singleton.o Singleton.cpp
g++ -Wall -Wold-style-cast -Wundef -Wsign-compare
-Wconversion -Wpointer-arith -pedantic -O2 -I../include
-DNDEBUG -c -o SmallObj.o SmallObj.cpp
g++ -Wall -Wold-style-cast -Wundef -Wsign-compare
-Wconversion -Wpointer-arith -pedantic -O2 -I../include
-DNDEBUG -c -o SmartPtr.o SmartPtr.cpp
In file included from SmartPtr.cpp:19:
../include/loki/SmartPtr.h:224: syntax error before `*'
token
../include/loki/SmartPtr.h: In constructor
`Loki::RefCounted<P>::RefCounted()':
../include/loki/SmartPtr.h:183: parse error before `;'
token
../include/loki/SmartPtr.h: In copy constructor
`Loki::RefCounted<P>::RefCounted(const
Loki::RefCounted<P>&)':
../include/loki/SmartPtr.h:191: class
`Loki::RefCounted<P>' does not have any
field named `pCount_'
../include/loki/SmartPtr.h: In constructor
`Loki::RefCounted<P>::RefCounted(const
Loki::RefCounted<P1>&)':
../include/loki/SmartPtr.h:197: class
`Loki::RefCounted<P>' does not have any
field named `pCount_'
make[1]: *** [SmartPtr.o] Error 1
make[1]: Leaving directory
`/usr/src/redhat/BUILD/loki-0.1.4/src'
make: *** [build-static] Error 2

OK, looking at line 224:
222 private:
223 // Data
224 uintptr_t* pCount_;
225 };

... uintptr_t seems to be unknown by g++ at this stage.
Let's fix it by including "stdint.h" and re-make... OK.

Do you accept the patch or do you want me to rework it ?
Best regards,
Regis.

Discussion

  • Regis Desgroppes

    TIny patch for SmartPtr.h (uintptr_t).

     
  • Peter Kuemmel

    Peter Kuemmel - 2006-03-15

    Logged In: YES
    user_id=1159765

    Thanks Regis!
    Patch accepted, and we will apply it soon.
    Peter

     
  • Peter Kuemmel

    Peter Kuemmel - 2006-03-17
    • assigned_to: nobody --> syntheticpp
    • status: open --> closed-accepted
     
  • Peter Kuemmel

    Peter Kuemmel - 2006-03-17

    Logged In: YES
    user_id=1159765

    Modified Files:
    SmartPtr.h
    Log Message:
    patch undefined uintptr_t, thx to Regis Desgroppes

    Index: SmartPtr.h

    RCS file: /cvsroot/loki-lib/loki/include/loki/SmartPtr.h,v
    retrieving revision 1.24
    retrieving revision 1.25
    diff -u -d -r1.24 -r1.25
    --- SmartPtr.h 8 Mar 2006 17:07:11 -0000 1.24
    +++ SmartPtr.h 17 Mar 2006 20:22:14 -0000 1.25
    @@ -39,6 +39,7 @@
    #include <functional>
    #include <stdexcept>
    #include <cassert>
    +#include <stdint.h>

    namespace Loki
    {
    @@ -1362,6 +1363,9 @@
    #endif // SMARTPTR_INC_

    // $Log$
    +// Revision 1.25 2006/03/17 20:22:14 syntheticpp
    +// patch undefined uintptr_t, thx to Regis Desgroppes
    +//
    // Revision 1.24 2006/03/08 17:07:11 syntheticpp
    // replace tabs with 4 spaces in all files
    //

     

Log in to post a comment.