Boost C++ Libraries: Ticket #5431: compile error in Windows CE 6.0(interlocked) https://svn.boost.org/trac10/ticket/5431 <p> boost/detail/interlocked.hpp is compile error in Windows CE platform. </p> <pre class="wiki">error C2733 : second C linkage of overloaded function 'InterlockedXXX' not allowed </pre><p> I correct follow change: </p> <p> before </p> <pre class="wiki">#elif defined(_WIN32_WCE) // under Windows CE we still have old-style Interlocked* functions extern "C" long __cdecl InterlockedIncrement( long* ); extern "C" long __cdecl InterlockedDecrement( long* ); extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); extern "C" long __cdecl InterlockedExchange( long*, long ); extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd </pre><p> after: </p> <pre class="wiki"># define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5431 Trac 1.4.3 Akira Takahashi <faithandbrave@…> Wed, 06 Apr 2011 10:32:49 GMT <link>https://svn.boost.org/trac10/ticket/5431#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:1</guid> <description> <p> sorry, after code is follow: </p> <pre class="wiki">#elif defined(_WIN32_WCE) # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 11 May 2011 05:08:59 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/5431#comment:2 https://svn.boost.org/trac10/ticket/5431#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> </ul> <p> Which boost library is including the detail/interlocked.hpp file? </p> <p> Could you send the declarations of the InterlockedXXX functions you have on your WindowsCE platform and the version? </p> Ticket faithandbrave@… Wed, 11 May 2011 05:57:09 GMT <link>https://svn.boost.org/trac10/ticket/5431#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:3</guid> <description> <p> detail/interlocked.hpp used by Boost.Thread. include place is boost/thread/win32/interlocked_read.hpp. </p> <p> WindowsCE Version $(CEVER) is defined as 0x600. </p> <pre class="wiki">_WIN32_WCE=$(CEVER) </pre><p> InterlockedXXX function declaration is follow: </p> <p> winbase.h </p> <pre class="wiki">#ifdef __cplusplus extern "C" { #endif ... #ifdef MIPS_R4000 /* or above */ ... #elif defined(_X86_) ... #else // not _X86_ LONG WINAPI InterlockedIncrement( LONG volatile *lpAddend ); LONG WINAPI InterlockedDecrement( LONG volatile *lpAddend ); LONG WINAPI InterlockedExchange( LONG volatile *Target, LONG Value ); LONG WINAPI InterlockedCompareExchange( LONG volatile *Target, LONG Exchange, LONG Comperand ); LONG WINAPI InterlockedExchangeAdd( LONG volatile *lpAddend, LONG Value ); #define InterlockedTestExchange(Target, oldValue, newValue) \ InterlockedCompareExchange((Target), (newValue), (oldValue)) #endif ... #ifdef __cplusplus } #endif </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 11 Dec 2011 15:17:57 GMT</pubDate> <title>keywords set https://svn.boost.org/trac10/ticket/5431#comment:4 https://svn.boost.org/trac10/ticket/5431#comment:4 <ul> <li><strong>keywords</strong> CE interlocked added </li> </ul> Ticket viboes Sat, 07 Jan 2012 23:48:29 GMT owner, status changed https://svn.boost.org/trac10/ticket/5431#comment:5 https://svn.boost.org/trac10/ticket/5431#comment:5 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket anonymous Sat, 04 Feb 2012 11:35:54 GMT keywords changed https://svn.boost.org/trac10/ticket/5431#comment:6 https://svn.boost.org/trac10/ticket/5431#comment:6 <ul> <li><strong>keywords</strong> wince added; CE removed </li> </ul> Ticket viboes Sat, 07 Jul 2012 15:37:45 GMT <link>https://svn.boost.org/trac10/ticket/5431#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:7</guid> <description> <p> Could changing the declarations to </p> <pre class="wiki">extern "C" long __cdecl InterlockedIncrement( long volatile * ); extern "C" long __cdecl InterlockedDecrement( long volatile * ); extern "C" long __cdecl InterlockedCompareExchange( long volatile *, long, long ); extern "C" long __cdecl InterlockedExchange( long volatile *, long ); extern "C" long __cdecl InterlockedExchangeAdd( long volatile *, long ); </pre><p> solve also the issue? </p> </description> <category>Ticket</category> </item> <item> <author>Akira Takahashi <faithandbrave@…></author> <pubDate>Mon, 09 Jul 2012 01:50:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5431#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:8</guid> <description> <p> I think that change is OK. But unfortunately, I have already left from the Windows CE platform. I can't test this change. </p> </description> <category>Ticket</category> </item> <item> <author>mboard182@…</author> <pubDate>Thu, 09 Aug 2012 20:00:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5431#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:9</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5431#comment:7" title="Comment 7">viboes</a>: </p> <blockquote class="citation"> <p> Could changing the declarations to </p> <pre class="wiki">extern "C" long __cdecl InterlockedIncrement( long volatile * ); extern "C" long __cdecl InterlockedDecrement( long volatile * ); extern "C" long __cdecl InterlockedCompareExchange( long volatile *, long, long ); extern "C" long __cdecl InterlockedExchange( long volatile *, long ); extern "C" long __cdecl InterlockedExchangeAdd( long volatile *, long ); </pre><p> solve also the issue? </p> </blockquote> <p> Yes, this appears to solve the link error. Can you help me understand why?? </p> <p> AFAIK with 'extern "C"', the following have the same name (and indeed will not link for me on vc9.0/winCE6 arm) </p> <pre class="wiki">void foo(int *i){...} void foo(volatile int *i){...} </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 15 Aug 2012 10:02:38 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/5431#comment:10 https://svn.boost.org/trac10/ticket/5431#comment:10 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.52.0</span> </li> </ul> <p> Committed in trunk revision 80042. </p> Ticket viboes Sat, 18 Aug 2012 15:10:08 GMT milestone changed https://svn.boost.org/trac10/ticket/5431#comment:11 https://svn.boost.org/trac10/ticket/5431#comment:11 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.52.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket viboes Tue, 21 Aug 2012 05:48:37 GMT <link>https://svn.boost.org/trac10/ticket/5431#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:12</guid> <description> <p> last update rolledback as it make regression test fail. Committed in trunk revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/80067" title="Thread: Rollback last modification as it breaks regression test ...">[80067]</a>. I will try making the modification only when _WIN32_WCE==0x600. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 21 Aug 2012 21:37:03 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/5431#comment:13 https://svn.boost.org/trac10/ticket/5431#comment:13 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.52.0</span> </li> </ul> <p> Committed in trunk revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/80127" title="Thread: Try again to fix 5431">[80127]</a>. </p> Ticket viboes Sun, 09 Sep 2012 18:49:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5431#comment:14 https://svn.boost.org/trac10/ticket/5431#comment:14 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Merged from trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/80473" title="Thread: Updated from trunk 1.52">[80473]</a>. </p> Ticket Martin.problemboost.Maurer@… Mon, 22 Apr 2013 16:57:34 GMT <link>https://svn.boost.org/trac10/ticket/5431#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:15</guid> <description> <p> I got the same error under Windows Vista, Visual Studio Express 2008, using 64 bit compiler and intrin.h my in own program. Same situation with boost 1.51.0 and 1.53.0 Could be because the above bugfix seems to be activated only for Windows CE, but i have Vista not Windows CE. Any idea? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 22 Apr 2013 17:10:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5431#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:16</guid> <description> <p> Please, create a new ticket as even if your problem is related it is for a different platform. Could you tell me which macro characterize your platform? If you could provide a patch this would help a lot. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 25 Apr 2013 06:04:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5431#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:17</guid> <description> <p> Similar error under Vista, VS2008, 64 bit compiler: <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/8485"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/8485</a> </p> </description> <category>Ticket</category> </item> <item> <author>christian.vollmer@…</author> <pubDate>Thu, 15 May 2014 13:30:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5431#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:18</guid> <description> <p> I got the same problem with the same platform but for the current boost version of 1.55. However, commenting out the section that handled the special case for _WIN32_WCE &gt;= 0x600 solved the issue. Now the code looks like this: </p> <pre class="wiki">//#if _WIN32_WCE &gt;= 0x600 // //extern "C" long __cdecl _InterlockedIncrement( long volatile * ); //extern "C" long __cdecl _InterlockedDecrement( long volatile * ); //extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); //extern "C" long __cdecl _InterlockedExchange( long volatile *, long ); //extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long ); // //# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement //# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement //# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange //# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange //# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd // //#else // under Windows CE we still have old-style Interlocked* functions //extern "C" long __cdecl InterlockedIncrement( long* ); //extern "C" long __cdecl InterlockedDecrement( long* ); //extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); //extern "C" long __cdecl InterlockedExchange( long*, long ); //extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); # define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement # define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement # define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd //#endif </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 15 May 2014 13:32:40 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/5431#comment:19 https://svn.boost.org/trac10/ticket/5431#comment:19 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket viboes Thu, 05 Jun 2014 21:48:32 GMT version, milestone changed https://svn.boost.org/trac10/ticket/5431#comment:20 https://svn.boost.org/trac10/ticket/5431#comment:20 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.46.1</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.52.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket viboes Sat, 07 Jun 2014 17:33:36 GMT owner, status, component changed https://svn.boost.org/trac10/ticket/5431#comment:21 https://svn.boost.org/trac10/ticket/5431#comment:21 <ul> <li><strong>owner</strong> changed from <span class="trac-author">viboes</span> to <span class="trac-author">Peter Dimov</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> <li><strong>component</strong> <span class="trac-field-old">thread</span> → <span class="trac-field-new">None</span> </li> </ul> <p> Peter please, could you take a look at this issue? </p> Ticket Peter Dimov Sat, 07 Jun 2014 19:30:42 GMT <link>https://svn.boost.org/trac10/ticket/5431#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:22</guid> <description> <p> I don't have access to any Windows CE platform, so I'm not sure what I can contribute. I don't even understand what problem is being discussed here. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 16 Sep 2014 05:51:46 GMT</pubDate> <title>component changed https://svn.boost.org/trac10/ticket/5431#comment:23 https://svn.boost.org/trac10/ticket/5431#comment:23 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">winapi</span> </li> </ul> Ticket James E. King, III Thu, 21 Sep 2017 23:11:51 GMT owner, milestone changed https://svn.boost.org/trac10/ticket/5431#comment:24 https://svn.boost.org/trac10/ticket/5431#comment:24 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Peter Dimov</span> to <span class="trac-author">James E. King, III</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.66.0</span> </li> </ul> Ticket James E. King, III Fri, 22 Sep 2017 01:04:31 GMT <link>https://svn.boost.org/trac10/ticket/5431#comment:25 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5431#comment:25</guid> <description> <p> PR out for this: <a class="ext-link" href="https://github.com/boostorg/winapi/pull/58"><span class="icon">​</span>https://github.com/boostorg/winapi/pull/58</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 23 Sep 2017 18:33:37 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5431#comment:26 https://svn.boost.org/trac10/ticket/5431#comment:26 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I've committed the fix in <a class="ext-link" href="https://github.com/boostorg/winapi/commit/e5a59445bfe3f8f5f6077d1e7b4d5d91a02a10af"><span class="icon">​</span>https://github.com/boostorg/winapi/commit/e5a59445bfe3f8f5f6077d1e7b4d5d91a02a10af</a>. I'm not able to test the change and would appreciate if anyone here is able to try it. </p> Ticket