Re: [Boost-bugs] [Boost C++ Libraries] #11338: mingw warnings

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11338: mingw warnings
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-06-02 11:28:26


#11338: mingw warnings
--------------------------------------+---------------------
  Reporter: victor bombi <sonoro@…> | Owner: viboes
      Type: Support Requests | Status: new
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+---------------------

Comment (by eldiener):

 My clang bug report at https://llvm.org/bugs/show_bug.cgi?id=23722 came
 back with:

 The problem is that the two function declarations have different parameter
 types. The windows.h version takes ::_FILETIME*, whereas the boost version
 takes boost::detail::winapi::_FILETIME*. Because they're 'extern "C"'
 functions, they are redeclarations of the same function, and are ill-
 formed because they have different types.

 It looks like the only viable solution which will satisfy clang, and the
 C++ standard, is along the lines of what Peter Dimov suggested for all the
 winapi functionality:

 {{{
 /* at global scope */
   struct FILETIME;
   extern "C" __declspec(dllimport) void __stdcall
 GetSystemTimeAsFileTime(FILETIME*);

   namespace winapi
   {
      struct FILETIME { ... };

      inline void GetSystemTimeAsFileTime( FILETIME * p )
      {
          ::GetSystemTimeAsFileTime( (::FILETIME*)p );
      }
   }
 }}}

 and then calling:

 {{{
   boost::winapi::FILETIME ft;
   boost::winapi::GetSystemTimeAsFileTime(&ft);
 }}}

 is no problem for clang and the C++ standard.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11338#comment:7>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC