summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boosty.h60
-rw-r--r--tests/CMakeLists.txt2
2 files changed, 49 insertions, 13 deletions
diff --git a/src/boosty.h b/src/boosty.h
index a8c57f8..588c2a9 100644
--- a/src/boosty.h
+++ b/src/boosty.h
@@ -1,5 +1,5 @@
-// boosty.h copyright 2012 don bright. released under the GNU General
-// Public License as described in the file named 'COPYING' in the project root.
+// boosty.h copyright 2012 don bright. released under the GPL 2, or later,
+// as described in the file named 'COPYING' in OpenSCAD's project root.
#ifndef boosty_h_
#define boosty_h_
@@ -9,14 +9,15 @@
versions of boost found on popular versions of linux, circa early 2012.
design
- hope that the user is compiling with boost>1.44 + filesystem v3
- if not, fall back to older deprecated functions, and rely on regression
+ hope that the user is compiling with boost>1.46 + filesystem v3
+ if not, fall back to older deprecated functions, and rely on
testing to find bugs. implement the minimum needed by OpenSCAD and no more.
in a few years, this file should be deleted as unnecessary.
see also
http://www.boost.org/doc/libs/1_48_0/libs/filesystem/v3/doc/index.htm
http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/index.htm
+ http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm
include/boost/wave/util/filesystem_compatability.hpp
*/
@@ -27,16 +28,51 @@
namespace fs = boost::filesystem;
namespace boosty {
+
#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
-inline bool is_absolute( fs::path p ) { return p.is_absolute(); }
-inline fs::path absolute( fs::path p ) { return fs::absolute( p ); }
-inline std::string stringy( fs::path p ) { return p.generic_string(); }
-inline std::string extension_str( fs::path p) { return p.extension().generic_string(); }
+
+inline bool is_absolute( fs::path p )
+{
+ return p.is_absolute();
+}
+
+inline fs::path absolute( fs::path p )
+{
+ return fs::absolute( p );
+}
+
+inline std::string stringy( fs::path p )
+{
+ return p.generic_string();
+}
+
+inline std::string extension_str( fs::path p)
+{
+ return p.extension().generic_string();
+}
+
#else
-inline bool is_absolute( fs::path p ) { return p.is_complete(); }
-inline fs::path absolute( fs::path p ) { return fs::complete( p ); }
-inline std::string stringy( fs::path p ) { return p.string(); }
-inline std::string extension_str( fs::path p) { return p.extension(); }
+
+inline bool is_absolute( fs::path p )
+{
+ return p.is_complete();
+}
+
+inline fs::path absolute( fs::path p )
+{
+ return fs::complete( p );
+}
+
+inline std::string stringy( fs::path p )
+{
+ return p.string();
+}
+
+inline std::string extension_str( fs::path p)
+{
+ return p.extension();
+}
+
#endif
} // namespace
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 66958a8..4534b67 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -125,7 +125,7 @@ if (NOT $ENV{BOOSTDIR} STREQUAL "")
message(STATUS "BOOST_ROOT: " ${BOOST_ROOT})
endif()
-find_package( Boost 1.42.0 COMPONENTS thread program_options filesystem system regex REQUIRED)
+find_package( Boost 1.35.0 COMPONENTS thread program_options filesystem system regex REQUIRED)
message(STATUS "Boost includes found: " ${Boost_INCLUDE_DIRS})
message(STATUS "Boost libraries found:")
foreach(boostlib ${Boost_LIBRARIES})
contact: Jan Huwald // Impressum