Opened 11 years ago

Last modified 11 years ago

#6442 new Feature Requests

Let the user work with a header-only library

Reported by: viboes Owned by: Beman Dawes
Milestone: To Be Determined Component: system
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc: ulrich.eckhardt@…

Description

Many libraries using Boost.System directly or indirectly could find more user if Boost.System were a header-only library.

Attachments (2)

system_header_only_boost.patch (34.1 KB ) - added by viboes 11 years ago.
header part
system_header_only_libs.patch (10.4 KB ) - added by viboes 11 years ago.
libs part

Download all attachments as: .zip

Change History (4)

comment:1 by viboes, 11 years ago

Next follows a patch. The user need to define BOOST_SYSTEM_INLINED to have a header-only lib. By default the windows files are taken from boost/detail/win32. The user needs to define BOOST_USE_WINDOWS_H if he has a preference for the windows files.

I have tested it for Boost.System, Boost.Chrono and Boost.Thread on cygwin gcc-4.3.4 and mingw gcc-4.6.1 (and c++0x) and msvc 10. Boost Chrono uses it as a header only, Boost.Thread as a linked library. I will continue the test with other Boost libraries.

by viboes, 11 years ago

header part

by viboes, 11 years ago

libs part

comment:2 by Ulrich Eckhardt <ulrich.eckhardt@…>, 11 years ago

Cc: ulrich.eckhardt@… added

There is also #3103 which doesn't require a macro but takes the approach that you include a file instead.

Note: See TracTickets for help on using tickets.