summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-12-29 02:46:59 +0100
committerClifford Wolf <clifford@clifford.at>2014-12-29 02:46:59 +0100
commit397ae5b697e9923bb9d35df425370efd9357b127 (patch)
treed7e1f971fe1615bc0b0917be3a75004074aa6d17
parentcfe0817697c9e7a656fd3a64e3a9014fa86e78d0 (diff)
gcc build fixes
-rw-r--r--kernel/yosys.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/kernel/yosys.h b/kernel/yosys.h
index 8ddd6f54..700a0603 100644
--- a/kernel/yosys.h
+++ b/kernel/yosys.h
@@ -48,6 +48,7 @@
#include <unordered_map>
#include <unordered_set>
#include <initializer_list>
+#include <stdexcept>
#include <sstream>
#include <fstream>
@@ -124,6 +125,8 @@
YOSYS_NAMESPACE_BEGIN
+// Note: All headers included in hashlib.h must be included
+// outside of YOSYS_NAMESPACE before this or bad things will happen.
#ifdef HASHLIB_H
# undef HASHLIB_H
# include "kernel/hashlib.h"
@@ -165,17 +168,19 @@ using RTLIL::Cell;
using RTLIL::Module;
using RTLIL::Design;
-template<> struct hash_ops<RTLIL::Wire*> : hash_obj_ops {};
-template<> struct hash_ops<RTLIL::Cell*> : hash_obj_ops {};
-template<> struct hash_ops<RTLIL::Module*> : hash_obj_ops {};
-template<> struct hash_ops<RTLIL::Design*> : hash_obj_ops {};
-template<> struct hash_ops<RTLIL::Monitor*> : hash_obj_ops {};
-
-template<> struct hash_ops<const RTLIL::Wire*> : hash_obj_ops {};
-template<> struct hash_ops<const RTLIL::Cell*> : hash_obj_ops {};
-template<> struct hash_ops<const RTLIL::Module*> : hash_obj_ops {};
-template<> struct hash_ops<const RTLIL::Design*> : hash_obj_ops {};
-template<> struct hash_ops<const RTLIL::Monitor*> : hash_obj_ops {};
+namespace hashlib {
+ template<> struct hash_ops<RTLIL::Wire*> : hash_obj_ops {};
+ template<> struct hash_ops<RTLIL::Cell*> : hash_obj_ops {};
+ template<> struct hash_ops<RTLIL::Module*> : hash_obj_ops {};
+ template<> struct hash_ops<RTLIL::Design*> : hash_obj_ops {};
+ template<> struct hash_ops<RTLIL::Monitor*> : hash_obj_ops {};
+
+ template<> struct hash_ops<const RTLIL::Wire*> : hash_obj_ops {};
+ template<> struct hash_ops<const RTLIL::Cell*> : hash_obj_ops {};
+ template<> struct hash_ops<const RTLIL::Module*> : hash_obj_ops {};
+ template<> struct hash_ops<const RTLIL::Design*> : hash_obj_ops {};
+ template<> struct hash_ops<const RTLIL::Monitor*> : hash_obj_ops {};
+}
void memhasher_on();
void memhasher_off();