Ticket #4891: config.hpp

File config.hpp, 3.8 KB (added by anonymous, 10 years ago)
Line 
1// boost/filesystem/v3/config.hpp ----------------------------------------------------//
2
3// Copyright Beman Dawes 2003
4
5// Distributed under the Boost Software License, Version 1.0.
6// See http://www.boost.org/LICENSE_1_0.txt
7
8// Library home page: http://www.boost.org/libs/filesystem
9
10//--------------------------------------------------------------------------------------//
11
12#ifndef BOOST_FILESYSTEM3_CONFIG_HPP
13#define BOOST_FILESYSTEM3_CONFIG_HPP
14
15# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3
16//# error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
17# endif
18
19# if !defined(BOOST_FILESYSTEM_VERSION)
20# define BOOST_FILESYSTEM_VERSION 3
21# endif
22
23#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
24
25// This header implements separate compilation features as described in
26// http://www.boost.org/more/separate_compilation.html
27
28#include <boost/config.hpp>
29#include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
30#include <boost/detail/workaround.hpp>
31
32// BOOST_FILESYSTEM_DEPRECATED needed for source compiles -----------------------------//
33
34# ifdef BOOST_FILESYSTEM_SOURCE
35# define BOOST_FILESYSTEM_DEPRECATED
36# endif
37
38// throw an exception ----------------------------------------------------------------//
39//
40// Exceptions were originally thrown via boost::throw_exception().
41// As throw_exception() became more complex, it caused user error reporting
42// to be harder to interpret, since the exception reported became much more complex.
43// The immediate fix was to throw directly, wrapped in a macro to make any later change
44// easier.
45
46#define BOOST_FILESYSTEM_THROW(EX) throw EX
47
48# if defined( BOOST_NO_STD_WSTRING )
49# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
50# endif
51
52// This header implements separate compilation features as described in
53// http://www.boost.org/more/separate_compilation.html
54
55// normalize macros ------------------------------------------------------------------//
56
57#if !defined(BOOST_FILESYSTEM_DYN_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK) \
58 && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
59# define BOOST_FILESYSTEM_STATIC_LINK
60#endif
61
62#if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
63# define BOOST_FILESYSTEM_DYN_LINK
64#elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
65# define BOOST_FILESYSTEM_STATIC_LINK
66#endif
67
68#if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
69# error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
70#endif
71
72#if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
73# define BOOST_FILESYSTEM_NO_LIB
74#endif
75
76// enable dynamic linking ------------------------------------------------------------//
77
78#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
79# if defined(BOOST_FILESYSTEM_SOURCE)
80# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
81# else
82# define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
83# endif
84#else
85# define BOOST_FILESYSTEM_DECL
86#endif
87
88// enable automatic library variant selection ----------------------------------------//
89
90#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
91 && !defined(BOOST_FILESYSTEM_NO_LIB)
92//
93// Set the name of our library, this will get undef'ed by auto_link.hpp
94// once it's done with it:
95//
96#define BOOST_LIB_NAME boost_filesystem
97//
98// If we're importing code from a dll, then tell auto_link.hpp about it:
99//
100#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
101# define BOOST_DYN_LINK
102#endif
103//
104// And include the header that does the work:
105//
106#include <boost/config/auto_link.hpp>
107#endif // auto-linking disabled
108
109#endif // BOOST_FILESYSTEM3_CONFIG_HPP