diff options
Diffstat (limited to 'src/zlib-ng/cpu_features.c')
-rw-r--r-- | src/zlib-ng/cpu_features.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/zlib-ng/cpu_features.c b/src/zlib-ng/cpu_features.c new file mode 100644 index 0000000..b5e7257 --- /dev/null +++ b/src/zlib-ng/cpu_features.c @@ -0,0 +1,24 @@ +/* cpu_features.c -- CPU architecture feature check + * Copyright (C) 2017 Hans Kristian Rosbach + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zbuild.h" + +#include "cpu_features.h" + +Z_INTERNAL void cpu_check_features(void) { + static int features_checked = 0; + if (features_checked) + return; +#if defined(X86_FEATURES) + x86_check_features(); +#elif defined(ARM_FEATURES) + arm_check_features(); +#elif defined(PPC_FEATURES) || defined(POWER_FEATURES) + power_check_features(); +#elif defined(S390_FEATURES) + PREFIX(s390_check_features)(); +#endif + features_checked = 1; +} |