#20 Wince issues

open
nobody
None
5
2008-09-10
2008-09-10
Vincent Richomme
No

Hi,

I am trying to discover smartwin++ and I have downloaded the latest version on Sourceforge.
Since I am a Windows CE developper I tried to compile the project but :

1) include folder is missing from General Include path
2) After adding it I get the following errors with boost :

1>------ Build started: Project: SmartWinDevices, Configuration: Release Windows Mobile 5.0 Pocket PC SDK (ARMV4I) ------
1>Compiling...
1>Application.cpp
1>include\boost/detail/interlocked.hpp(42) : error C2169: '_InterlockedIncrement' : intrinsic function, cannot be defined
1>include\boost/detail/interlocked.hpp(47) : error C2169: '_InterlockedDecrement' : intrinsic function, cannot be defined
1>include\boost/detail/sp_counted_base_w32.hpp(72) : error C3861: '_InterlockedIncrement': identifier not found
1>include\boost/detail/sp_counted_base_w32.hpp(87) : error C3861: '_InterlockedDecrement': identifier not found
1>include\boost/detail/sp_counted_base_w32.hpp(96) : error C3861: '_InterlockedIncrement': identifier not found
1>include\boost/detail/sp_counted_base_w32.hpp(101) : error C3861: '_InterlockedDecrement': identifier not found

Here is what I done to fix it(use non intrinsic functions) :

in c:\program files\smartwin\include\boost\detail\interlocked.hpp

#ifndef WINCE
# pragma intrinsic( _InterlockedIncrement )
# pragma intrinsic( _InterlockedDecrement )
# pragma intrinsic( _InterlockedCompareExchange )
#else

// Fix issues on Wince
#define _InterlockedIncrement InterlockedIncrement
#define _InterlockedDecrement InterlockedDecrement

//inline long __cdecl _InterlockedIncrement( long volatile * tmp )
//{
// *tmp += 1;
// return *tmp;
//}
//inline long __cdecl _InterlockedDecrement( long volatile * tmp )
//{
// *tmp -= 1;
// return *tmp;
//}
#endif

Discussion

  • Actually my proposal doesn't work in all cases.........
    So do not report it