On Tue, May 15, 2012 at 1:08 AM, K. Frank <kfrank2...@gmail.com> wrote:

>
> By the way, a quick semi-related question:  To use native windows
> Sleep I am including windows.h.  It's not a big deal, but it does
> increase the compile time of simple test programs noticeably.
> (Not really a lot, though.)  Would anyone know off-hand if I can
> just put in two or three lines of prototype declarations for Sleep
> instead of including all of windows.h?
>
> Thanks to all.
>
>
>
Yes, as long as you add a __declspec(dllimport) to the function declaration
and also link in the appropriate import library.

Oh, you will also need an 'extern "C"' to prevent name mangling afaik.

Boost for example manually declares and imports all the Windows APIs it
uses unless you define BOOST_USE_WINDOWS_H. If you want to check out what
they're doing as a confirmation what you're doing is correct I believe
their wrappers are in boost/detail/win.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to