Boost logo

Boost :

From: Angus Leeming (angus.leeming_at_[hidden])
Date: 2005-09-27 09:51:18


Angus Leeming wrote:

> Beman,
>
> you use the WinAPI call GetFileAttributesExA only twice in
> Boost.Filesystem, in _is_empty and file_size, but that means that the
> code won't run on Windows 95:
>
> file is linked to missing export KERNEL32.DLL:GetFileAttributesExA
>
> The msdn docs
> http://msdn.microsoft.com/library/en-us/fileio/fs/getfileattributesex.asp
> suggest that Win95 support requires only that you grab NewAPIs.h from the
> SDK Update Site.

Actually, Beman, can I suggest the following patch? This allows the
code to compile unchanged out of the box. If I want to support Win95 I need
to define WANT_GETFILEATTRIBUTESEX_WRAPPER and provide NewAPIs.h.

I can define the WANT_GETFILEATTRIBUTESEX_WRAPPER macro in my own config.h
header file which is already #included by your library through
BOOST_USER_CONFIG

Thereafter, in some source file of my own I need only add

#include <config.h>

#define COMPILE_NEWAPIS_STUBS
#include <NewAPIs.h>
#undef COMPILE_NEWAPIS_STUBS

and all works beautifully.

Regards,
Angus




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk