Attempt (re)load if not yet successful. Safe after potentials_path inject.
24 {
26 return true;
27
28#ifdef _WIN32
29 const char *candidates[] = {"metatomic_pot.dll", "libmetatomic_pot.dll",
30 nullptr};
31#elif defined(__APPLE__)
32 const char *candidates[] = {"libmetatomic_pot.dylib", "libmetatomic_pot.so",
33 nullptr};
34#else
35 const char *candidates[] = {"libmetatomic_pot.so", nullptr};
36#endif
37
38
39
41#if defined(__linux__)
42 return ::dlopen(name, RTLD_NOW | RTLD_GLOBAL);
43#elif defined(_WIN32)
45#else
46 return ::dlopen(name, RTLD_NOW | RTLD_GLOBAL);
47#endif
48 };
49
50 for (const char **p = candidates; *p; ++p) {
53 break;
54 }
57 for (const char **p = candidates; *p; ++p) {
58 std::string full = dir;
59 if (!full.empty() && full.back() != '/' && full.back() != '\\')
60 full += '/';
61 full += *p;
64 break;
65 }
67 break;
68 }
69 }
71 return false;
72
78
80 std::cerr << "[Metatomic] libmetatomic_pot loaded but missing C ABI "
81 "symbols\n";
88 return false;
89 }
92 std::cerr << "[Metatomic] ABI version mismatch: library=" << ver
100 return false;
101 }
103 return true;
104}
static PluginLoader & instance()
Thread-safe singleton accessor (Meyer's pattern).
Handle open(const char *name) noexcept
Fn loadSym(Handle h, const char *name) noexcept
Load a symbol and cast to a function pointer type.