mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Add SIMDJSON_FORCE_IMPLEMENTATION
This commit is contained in:
@@ -122,6 +122,15 @@ const implementation *available_implementation_list::detect_best_supported() con
|
||||
}
|
||||
|
||||
const implementation *detect_best_supported_implementation_on_first_use::set_best() const noexcept {
|
||||
char *force_implementation_name = getenv("SIMDJSON_FORCE_IMPLEMENTATION");
|
||||
if (force_implementation_name) {
|
||||
auto force_implementation = available_implementations[force_implementation_name];
|
||||
if (!force_implementation) {
|
||||
fprintf(stderr, "SIMDJSON_FORCE_IMPLEMENTATION environment variable set to '%s', which is not a supported implementation name!\n", force_implementation_name);
|
||||
abort();
|
||||
}
|
||||
return active_implementation = force_implementation;
|
||||
}
|
||||
return active_implementation = available_implementations.detect_best_supported();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user