-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If neither <filesystem> nor <experimental/filesystem> is detected, then require <boost/filesystem.hpp>. If user defines BOOST_GIL_IO_USE_BOOST_FILESYSTEM macro, then <boost/filesystem.hpp> is pre-selected and required, and search for any of the C++ standard implementation is skipped. Remove end-user macro BOOST_GIL_IO_ADD_FS_PATH_SUPPORT Require tests to always build with support of either detected C++ filesystem or pre-selected Boost.Filesystem. Closes ##222
- Loading branch information
Showing
20 changed files
with
100 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// Copyright 2022 Mateusz Loskot <mateusz at loskot dot net> | ||
// | ||
// Distributed under the Boost Software License, Version 1.0 | ||
// See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt | ||
// | ||
#ifndef BOOST_GIL_IO_DETAIL_FILESYSTEM_HPP | ||
#define BOOST_GIL_IO_DETAIL_FILESYSTEM_HPP | ||
|
||
#include <boost/config.hpp> | ||
|
||
#if !defined(BOOST_GIL_IO_USE_BOOST_FILESYSTEM) | ||
#if !defined(BOOST_NO_CXX17_HDR_FILESYSTEM) || defined(__cpp_lib_filesystem) | ||
#include <filesystem> | ||
#define BOOST_GIL_IO_USE_STD_FILESYSTEM | ||
#elif defined(__cpp_lib_experimental_filesystem) | ||
#include <experimental/filesystem> | ||
#define BOOST_GIL_IO_USE_STD_FILESYSTEM | ||
#define BOOST_GIL_IO_USE_STD_EXPERIMENTAL_FILESYSTEM | ||
#endif | ||
#endif // !BOOST_GIL_IO_USE_BOOST_FILESYSTEM | ||
|
||
#if !defined(BOOST_GIL_IO_USE_STD_FILESYSTEM) | ||
// Disable warning: conversion to 'std::atomic<int>::__integral_type {aka int}' from 'long int' may alter its value | ||
#if defined(BOOST_CLANG) | ||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wshorten-64-to-32" | ||
#endif | ||
|
||
#if defined(BOOST_GCC) && (BOOST_GCC >= 40900) | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wconversion" | ||
#endif | ||
|
||
#define BOOST_FILESYSTEM_VERSION 3 | ||
#include <boost/filesystem.hpp> | ||
#define BOOST_GIL_IO_USE_BOOST_FILESYSTEM | ||
|
||
#if defined(BOOST_CLANG) | ||
#pragma clang diagnostic pop | ||
#endif | ||
|
||
#if defined(BOOST_GCC) && (BOOST_GCC >= 40900) | ||
#pragma GCC diagnostic pop | ||
#endif | ||
|
||
#endif | ||
|
||
namespace boost { namespace gil { namespace detail { | ||
|
||
#if defined(BOOST_GIL_IO_USE_STD_EXPERIMENTAL_FILESYSTEM) | ||
namespace filesystem = std::experimental::filesystem; | ||
#elif defined(BOOST_GIL_IO_USE_STD_FILESYSTEM) | ||
namespace filesystem = std::filesystem; | ||
#else | ||
#if !defined(BOOST_GIL_IO_USE_BOOST_FILESYSTEM) | ||
#error "Boost.Filesystem is required if C++17 <filesystem> is not available" | ||
#endif | ||
namespace filesystem = boost::filesystem; | ||
#endif | ||
|
||
}}} // namespace boost::gil::detail | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.