summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Landscheidt <tim@tim-landscheidt.de>2019-01-17 23:35:58 +0000
committerTim Landscheidt <tim@tim-landscheidt.de>2019-01-17 23:43:19 +0000
commitd0269e8c94dca6accba1d60e24ffb7f4b2f35932 (patch)
treeb73d0162dda08d83565007108d9f53c00e991e6e
parent2a8f433c6b8b2a9f2c182de17315bf5eceb2dced (diff)
downloadfork-ledger-d0269e8c94dca6accba1d60e24ffb7f4b2f35932.tar.gz
fork-ledger-d0269e8c94dca6accba1d60e24ffb7f4b2f35932.tar.bz2
fork-ledger-d0269e8c94dca6accba1d60e24ffb7f4b2f35932.zip
Drop conditionals for Boost earlier than 1.49
Ledger requires Boost 1.49 or later and enforces this in CMakeLists.txt. This means BOOST_VERSION will always be 104900 or higher. Also, since Boost 1.46, BOOST_FILESYSTEM_VERSION is 3.
-rw-r--r--src/context.h6
-rw-r--r--src/main.cc3
-rw-r--r--src/pyinterp.cc16
-rw-r--r--src/stream.cc6
-rw-r--r--src/textual.cc23
-rw-r--r--src/value.cc6
-rw-r--r--src/value.h10
7 files changed, 6 insertions, 64 deletions
diff --git a/src/context.h b/src/context.h
index 0af59930..d69df73f 100644
--- a/src/context.h
+++ b/src/context.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -113,11 +113,7 @@ inline parse_context_t open_for_reading(const path& pathname,
const path& cwd)
{
path filename = resolve_path(pathname);
-#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
filename = filesystem::absolute(filename, cwd);
-#else
- filename = filesystem::complete(filename, cwd);
-#endif
if (! exists(filename) || is_directory(filename))
throw_(std::runtime_error,
_f("Cannot read journal file %1%") % filename);
diff --git a/src/main.cc b/src/main.cc
index 4348e8a6..218579cf 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -73,9 +73,6 @@ int main(int argc, char * argv[], char * envp[])
// Initialize global Boost/C++ environment
std::ios::sync_with_stdio(false);
-#if BOOST_VERSION < 104600
- filesystem::path::default_name_check(filesystem::portable_posix_name);
-#endif
std::signal(SIGINT, sigint_handler);
#if !defined(_WIN32) && !defined(__CYGWIN__)
diff --git a/src/pyinterp.cc b/src/pyinterp.cc
index 19430bef..fad0b559 100644
--- a/src/pyinterp.cc
+++ b/src/pyinterp.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -222,27 +222,13 @@ object python_interpreter_t::import_option(const string& str)
python::list paths(sys_dict["path"]);
if (contains(str, ".py")) {
-#if BOOST_VERSION >= 103700
path& cwd(parsing_context.get_current().current_directory);
-#if BOOST_VERSION >= 104600 && BOOST_FILESYSTEM_VERSION >= 3
path parent(filesystem::absolute(file, cwd).parent_path());
-#else
- path parent(filesystem::complete(file, cwd).parent_path());
-#endif
DEBUG("python.interp", "Adding " << parent << " to PYTHONPATH");
paths.insert(0, parent.string());
sys_dict["path"] = paths;
-#if BOOST_VERSION >= 104600
name = file.stem().string();
-#else
- name = file.stem();
-#endif
-#else // BOOST_VERSION >= 103700
- paths.insert(0, file.branch_path().string());
- sys_dict["path"] = paths;
- name = file.leaf();
-#endif // BOOST_VERSION >= 103700
}
try {
diff --git a/src/stream.cc b/src/stream.cc
index c4bbb42e..91a190d8 100644
--- a/src/stream.cc
+++ b/src/stream.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -89,11 +89,7 @@ namespace {
else { // parent
close(pfd[0]);
typedef iostreams::stream<iostreams::file_descriptor_sink> fdstream;
-#if BOOST_VERSION >= 104400
*os = new fdstream(pfd[1], iostreams::never_close_handle);
-#else // BOOST_VERSION >= 104400
- *os = new fdstream(pfd[1]);
-#endif // BOOST_VERSION >= 104400
}
return pfd[1];
#else
diff --git a/src/textual.cc b/src/textual.cc
index 3416073b..33744ec3 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -743,17 +743,8 @@ void instance_t::include_directive(char * line)
DEBUG("textual.include", "resolved path: " << filename.string());
mask_t glob;
-#if BOOST_VERSION >= 103700
path parent_path = filename.parent_path();
-#if BOOST_VERSION >= 104600
glob.assign_glob('^' + filename.filename().string() + '$');
-#else
- glob.assign_glob('^' + filename.filename() + '$');
-#endif
-#else // BOOST_VERSION >= 103700
- path parent_path = filename.branch_path();
- glob.assign_glob('^' + filename.leaf() + '$');
-#endif // BOOST_VERSION >= 103700
bool files_found = false;
if (exists(parent_path)) {
@@ -761,21 +752,9 @@ void instance_t::include_directive(char * line)
for (filesystem::directory_iterator iter(parent_path);
iter != end;
++iter) {
-#if BOOST_VERSION <= 103500
- if (is_regular(*iter))
-#else
if (is_regular_file(*iter))
-#endif
{
-#if BOOST_VERSION >= 103700
-#if BOOST_VERSION >= 104600
string base = (*iter).path().filename().string();
-#else
- string base = (*iter).filename();
-#endif
-#else // BOOST_VERSION >= 103700
- string base = (*iter).leaf();
-#endif // BOOST_VERSION >= 103700
if (glob.match(base)) {
journal_t * journal = context.journal;
account_t * master = top_account();
diff --git a/src/value.cc b/src/value.cc
index 1841505d..5ce30530 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -129,11 +129,7 @@ value_t::operator bool() const
void value_t::set_type(type_t new_type)
{
if (new_type == VOID) {
-#if BOOST_VERSION >= 103700
storage.reset();
-#else
- storage = intrusive_ptr<storage_t>();
-#endif
} else {
if (! storage || storage->refc > 1)
storage = new storage_t;
diff --git a/src/value.h b/src/value.h
index 35581bfb..e44f9354 100644
--- a/src/value.h
+++ b/src/value.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -878,22 +878,14 @@ public:
VERIFY(! is_null());
if (! is_sequence()) {
-#if BOOST_VERSION >= 103700
storage.reset();
-#else
- storage = intrusive_ptr<storage_t>();
-#endif
} else {
as_sequence_lval().pop_back();
const sequence_t& seq(as_sequence());
std::size_t new_size = seq.size();
if (new_size == 0) {
-#if BOOST_VERSION >= 103700
storage.reset();
-#else
- storage = intrusive_ptr<storage_t>();
-#endif
}
else if (new_size == 1) {
*this = seq.front();