3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-12 20:51:27 +00:00

Ensure the ID macro consistently uses YOSYS_NAMESPACE_PREFIX

The previous version of the ID macro used this for everything in the
Yosys namespace, so the new version should continue to do so.
This commit is contained in:
Jannis Harder 2025-09-08 11:34:53 +02:00 committed by Robert O'Callahan
parent 23af52c3c8
commit 2a4a9aedfe

View file

@ -544,10 +544,14 @@ template <> struct IDMacroHelper<-1> {
} }
}; };
#define ID(_id) IDMacroHelper<lookup_well_known_id(#_id)>::eval([]() -> const RTLIL::IdString & { \ #define ID(_id) \
const char *p = "\\" #_id, *q = p[1] == '$' ? p+1 : p; \ YOSYS_NAMESPACE_PREFIX IDMacroHelper< \
static const YOSYS_NAMESPACE_PREFIX RTLIL::IdString id(q); \ YOSYS_NAMESPACE_PREFIX lookup_well_known_id(#_id) \
return id; \ >::eval([]() \
-> const YOSYS_NAMESPACE_PREFIX RTLIL::IdString & { \
const char *p = "\\" #_id, *q = p[1] == '$' ? p+1 : p; \
static const YOSYS_NAMESPACE_PREFIX RTLIL::IdString id(q); \
return id; \
}) })
namespace RTLIL { namespace RTLIL {