| 1 | /* cpu_features.c -- CPU architecture feature check |
| 2 | * Copyright (C) 2017 Hans Kristian Rosbach |
| 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
| 4 | */ |
| 5 | |
| 6 | #include "zbuild.h" |
| 7 | |
| 8 | #include "cpu_features.h" |
| 9 | |
| 10 | Z_INTERNAL void cpu_check_features(void) { |
| 11 | static int features_checked = 0; |
| 12 | if (features_checked) |
| 13 | return; |
| 14 | #if defined(X86_FEATURES) |
| 15 | x86_check_features(); |
| 16 | #elif defined(ARM_FEATURES) |
| 17 | arm_check_features(); |
| 18 | #elif defined(PPC_FEATURES) || defined(POWER_FEATURES) |
| 19 | power_check_features(); |
| 20 | #elif defined(S390_FEATURES) |
| 21 | PREFIX(s390_check_features)(); |
| 22 | #endif |
| 23 | features_checked = 1; |
| 24 | } |