Use #if HAVE_* instead of #ifdef HAVE_*

This commit is contained in:
Michael Bradshaw
2024-09-10 10:54:55 -06:00
committed by Ronald S. Bultje
parent 82e9155c75
commit dd32cd5027
18 changed files with 131 additions and 122 deletions
+4 -4
View File
@@ -45,12 +45,12 @@
#endif
#else
#include <time.h>
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_PTHREAD_SETAFFINITY_NP
#if HAVE_PTHREAD_SETAFFINITY_NP
#include <pthread.h>
#ifdef HAVE_PTHREAD_NP_H
#if HAVE_PTHREAD_NP_H
#include <pthread_np.h>
#endif
#endif
@@ -736,7 +736,7 @@ int main(int argc, char *argv[]) {
} else {
fprintf(stderr, "checkasm: running on cpu %lu\n", affinity);
}
#elif defined(HAVE_PTHREAD_SETAFFINITY_NP) && defined(CPU_SET)
#elif HAVE_PTHREAD_SETAFFINITY_NP && defined(CPU_SET)
cpu_set_t set;
CPU_ZERO(&set);
CPU_SET(affinity, &set);
+1 -1
View File
@@ -254,7 +254,7 @@ void checkasm_simd_warmup(void);
* handled orthogonally from integer parameters passed in GPR registers. */
#define IGNORED_FP_ARGS 8
#endif
#ifdef HAVE_C11_GENERIC
#if HAVE_C11_GENERIC
#define clobber_type(arg) _Generic((void (*)(void*, arg))NULL,\
void (*)(void*, int32_t ): clobber_mask |= 1 << mpos++,\
void (*)(void*, uint32_t): clobber_mask |= 1 << mpos++,\
+1 -1
View File
@@ -60,7 +60,7 @@ static unsigned get_seed(void) {
static unsigned get_seed(void) {
#ifdef __APPLE__
return (unsigned) mach_absolute_time();
#elif defined(HAVE_CLOCK_GETTIME)
#elif HAVE_CLOCK_GETTIME
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (unsigned) (1000000000ULL * ts.tv_sec + ts.tv_nsec);