aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-23 15:16:37 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-23 15:16:37 +0200
commitb5efe3ecbc1a00714ad6774d7e16b3d22b7cf43a (patch)
treec633d4e43489bc1515cd582b93b13a5fd23b0f5e /common
parent746d63f9fa7ffd7fcc5c460c04b65eccfbb3f205 (diff)
parent550866620acba97407e14dbc95ad5747d64ee3d6 (diff)
downloadnextpnr-b5efe3ecbc1a00714ad6774d7e16b3d22b7cf43a.tar.gz
nextpnr-b5efe3ecbc1a00714ad6774d7e16b3d22b7cf43a.tar.bz2
nextpnr-b5efe3ecbc1a00714ad6774d7e16b3d22b7cf43a.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'common')
-rw-r--r--common/emb.cc3
-rw-r--r--common/handle_error.cc4
-rw-r--r--common/nextpnr.h66
-rw-r--r--common/pybindings.cc4
4 files changed, 11 insertions, 66 deletions
diff --git a/common/emb.cc b/common/emb.cc
index 2e3379d5..27c5d6e1 100644
--- a/common/emb.cc
+++ b/common/emb.cc
@@ -5,6 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// Blog article: http://mateusz.loskot.net/?p=2819
+#ifndef NO_PYTHON
#include "emb.h"
#include <Python.h>
@@ -136,3 +137,5 @@ void reset_stdout()
void append_inittab() { PyImport_AppendInittab("emb", emb::PyInit_emb); }
} // namespace emb
+
+#endif // NO_PYTHON \ No newline at end of file
diff --git a/common/handle_error.cc b/common/handle_error.cc
index 7076c188..a091f07e 100644
--- a/common/handle_error.cc
+++ b/common/handle_error.cc
@@ -1,3 +1,5 @@
+#ifndef NO_PYTHON
+
#include <Python.h>
#include <boost/python.hpp>
#include "nextpnr.h"
@@ -61,3 +63,5 @@ std::string parse_python_exception()
}
NEXTPNR_NAMESPACE_END
+
+#endif // NO_PYTHON \ No newline at end of file
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 8cbead7d..2f3b5b14 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -81,77 +81,11 @@ struct IdString
// --- deprecated old API ---
- IdString(const std::string &s) __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- set(global_ctx, s);
- }
-
- IdString(const char *s) __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- set(global_ctx, s);
- }
-
const std::string &global_str() const __attribute__((deprecated))
{
assert(global_ctx != nullptr);
return str(global_ctx);
}
-
- const std::string &str() const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return str(global_ctx);
- }
-
- const char *c_str() const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return c_str(global_ctx);
- }
-
- operator const char *() const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return c_str(global_ctx);
- }
-
- operator const std::string &() const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return str(global_ctx);
- }
-
- bool operator==(const std::string &s) const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return str(global_ctx) == s;
- }
-
- bool operator==(const char *s) const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return str(global_ctx) == s;
- }
-
- bool operator!=(const std::string &s) const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return str(global_ctx) != s;
- }
-
- bool operator!=(const char *s) const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return str(global_ctx) != s;
- }
-
- size_t size() const __attribute__((deprecated))
- {
- assert(global_ctx != nullptr);
- return str(global_ctx).size();
- }
};
NEXTPNR_NAMESPACE_END
diff --git a/common/pybindings.cc b/common/pybindings.cc
index a9c32c1c..b67320a2 100644
--- a/common/pybindings.cc
+++ b/common/pybindings.cc
@@ -18,6 +18,8 @@
*
*/
+#ifndef NO_PYTHON
+
#include "pybindings.h"
#include "emb.h"
#include "jsonparse.h"
@@ -186,3 +188,5 @@ void execute_python_file(const char *python_file)
}
NEXTPNR_NAMESPACE_END
+
+#endif // NO_PYTHON \ No newline at end of file