-#if 1
-inline ident *id_from_str (const char *str, int len) {
- assert (len > 0);
- return (const set_entry *) set_hinsert (id_set,
- (str),
- (len),
- ID_HASH ((str), (len)));
+ if (! impl.new_id_from_str)
+ impl.new_id_from_str = def_new_id_from_str;
+ if (! impl.get_id_strlen)
+ impl.get_id_strlen = def_get_id_strlen;
+
+#ifdef FIRM_ENABLE_WCHAR
+ if (! impl.new_id_from_wcs)
+ impl.new_id_from_wcs = def_new_id_from_wcs;
+ if (! impl.new_id_from_wchars)
+ impl.new_id_from_wchars = def_new_id_from_wchars;
+ if (! impl.get_id_wcs)
+ impl.get_id_wcs = def_get_id_wcs;
+ if (! impl.get_id_wcslen)
+ impl.get_id_wcslen = def_get_id_wcslen;
+#endif /* FIRM_ENABLE_WCHAR */
+ }
+ else {
+ impl.new_id_from_str = set_new_id_from_str;
+ impl.new_id_from_chars = set_new_id_from_chars;
+ impl.get_id_str = set_get_id_str;
+ impl.get_id_strlen = set_get_id_strlen;
+ impl.finish_ident = set_finish_ident;
+#ifdef FIRM_ENABLE_WCHAR
+ impl.new_id_from_wcs = set_new_id_from_wcs;
+ impl.new_id_from_wchars = set_new_id_from_wchars;
+ impl.get_id_wcs = set_get_id_wcs;
+ impl.get_id_wcslen = set_get_id_wcslen;
+#endif /* FIRM_ENABLE_WCHAR */
+
+ /* it's ok to use memcmp here, we check only strings */
+ impl.handle = new_set(memcmp, initial_n_idents);
+ }