1 | // private_config.hpp ----------------------------------------------------------------// |
2 | |
3 | // Copyright 2021 Andrey Semashev |
4 | |
5 | // Distributed under the Boost Software License, Version 1.0. |
6 | // See http://www.boost.org/LICENSE_1_0.txt |
7 | |
8 | // See library home page at http://www.boost.org/libs/filesystem |
9 | |
10 | //--------------------------------------------------------------------------------------// |
11 | |
12 | #ifndef BOOST_FILESYSTEM_SRC_PRIVATE_CONFIG_HPP_ |
13 | #define BOOST_FILESYSTEM_SRC_PRIVATE_CONFIG_HPP_ |
14 | |
15 | #include <boost/filesystem/config.hpp> |
16 | |
17 | #if defined(BOOST_FILESYSTEM_HAS_INIT_PRIORITY) |
18 | #define BOOST_FILESYSTEM_INIT_PRIORITY(n) __attribute__ ((init_priority(n))) |
19 | #else |
20 | #define BOOST_FILESYSTEM_INIT_PRIORITY(n) |
21 | #endif |
22 | |
23 | // According to https://gcc.gnu.org/bugzilla//show_bug.cgi?id=65115, |
24 | // the default C++ object initializers priority is 65535. We would like to |
25 | // initialize function pointers earlier than that (with lower priority values), |
26 | // before the other global objects initializers are run. Other than this, |
27 | // these priority values are arbitrary. |
28 | #define BOOST_FILESYSTEM_FUNC_PTR_INIT_PRIORITY 32767 |
29 | |
30 | // Path globals initialization priority |
31 | #define BOOST_FILESYSTEM_PATH_GLOBALS_INIT_PRIORITY 32768 |
32 | |
33 | #if defined(__has_feature) && defined(__has_attribute) |
34 | #if __has_feature(memory_sanitizer) && __has_attribute(no_sanitize) |
35 | #define BOOST_FILESYSTEM_NO_SANITIZE_MEMORY __attribute__ ((no_sanitize("memory"))) |
36 | #endif |
37 | #endif // defined(__has_feature) && defined(__has_attribute) |
38 | |
39 | #ifndef BOOST_FILESYSTEM_NO_SANITIZE_MEMORY |
40 | #define BOOST_FILESYSTEM_NO_SANITIZE_MEMORY |
41 | #endif |
42 | |
43 | #if defined(_MSC_VER) |
44 | #if _MSC_VER < 1300 || _MSC_VER > 1900 // 1300 == VC++ 7.0, 1900 == VC++ 14.0 |
45 | typedef void (__cdecl* init_func_ptr_t)(); |
46 | #define BOOST_FILESYSTEM_INITRETSUCCESS_V |
47 | #define BOOST_FILESYSTEM_INIT_FUNC void __cdecl |
48 | #else |
49 | typedef int (__cdecl* init_func_ptr_t)(); |
50 | #define BOOST_FILESYSTEM_INITRETSUCCESS_V 0 |
51 | #define BOOST_FILESYSTEM_INIT_FUNC int __cdecl |
52 | #endif |
53 | #else // defined(_MSC_VER) |
54 | typedef void (*init_func_ptr_t)(); |
55 | #define BOOST_FILESYSTEM_INITRETSUCCESS_V |
56 | #define BOOST_FILESYSTEM_INIT_FUNC void |
57 | #endif // defined(_MSC_VER) |
58 | |
59 | #if defined(__has_attribute) |
60 | #if __has_attribute(__used__) |
61 | #define BOOST_FILESYSTEM_ATTRIBUTE_RETAIN __attribute__ ((__used__)) |
62 | #endif |
63 | #endif |
64 | |
65 | #if !defined(BOOST_FILESYSTEM_ATTRIBUTE_RETAIN) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 402 |
66 | #define BOOST_FILESYSTEM_ATTRIBUTE_RETAIN __attribute__ ((__used__)) |
67 | #endif |
68 | |
69 | #if !defined(BOOST_FILESYSTEM_ATTRIBUTE_RETAIN) |
70 | #define BOOST_FILESYSTEM_NO_ATTRIBUTE_RETAIN |
71 | #define BOOST_FILESYSTEM_ATTRIBUTE_RETAIN |
72 | #endif |
73 | |
74 | #endif // BOOST_FILESYSTEM_SRC_PRIVATE_CONFIG_HPP_ |
75 | |