Boost logo

Boost :

From: Zbynek Winkler (zwin_at_[hidden])
Date: 2004-01-16 07:24:54


Hello.

I have a few comments about the default build of filesystem lib with cygwin.

There is this preabmble in the source files:

// BOOST_POSIX or BOOST_WINDOWS specify which API to use.
# if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX )
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) ||
defined(__CYGWIN__)
# define BOOST_WINDOWS
# else
# define BOOST_POSIX
# endif
# endif

which results in native winapi being used when compiled under cygwin.
IMO this is not right because the cygwin path translation does not work
then. Apps built under cygwin expect the usual unix namespace with a
single root and such which they do not get by default. IMO the native
implementation should be used only when compiling under mingw.

There is a config file in boost/config/user.hpp. The general build
instructions state that to configure boost one can edit this file. So I
first went there and defined BOOST_DISABLE_WIN32 as I expected that this
  should force the filesystem lib to use posix instead. Well, it didn't.
By inspecting the source I've found out that I have to define
BOOST_POSIX so I've added BOOST_POSIX to the boost/config/user.hpp.
Unfortunatelly this file is not included in path_posix_windows.cpp so
part of the project was compiled for posix and part for win32 which
resulted in various core dumps.

I propose the following chages:
1) include boost/config/user.hpp in all files to allow a single place
for configuration
2) consider the use of BOOST_DISABLE_WIN32 instead of BOOST_POSIX &
BOOST_WINDOWS
3) default to posix calls under cygwin and to win32 under mingw

What do you think?

Zbynek


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