diff --git a/kernel/yosys.h b/kernel/yosys.h index 8ddd6f540..700a0603d 100644 --- a/kernel/yosys.h +++ b/kernel/yosys.h @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -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 : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; +namespace hashlib { + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; -template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; + template<> struct hash_ops : hash_obj_ops {}; +} void memhasher_on(); void memhasher_off();