diff --git a/Makefile b/Makefile index e8e0f49..1b95a83 100644 --- a/Makefile +++ b/Makefile @@ -27,11 +27,12 @@ LIBS+=-lrt endif ifeq ($(UNAME), Darwin) # TODO: Putting GCC in C11 mode breaks things. -CFLAGS+=-std=c11 +CFLAGS+=-std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP COMPAT+=compat/clock_gettime/clock_gettime.o compat/clock_nanosleep/clock_nanosleep.o endif ifeq ($(UNAME), OpenBSD) +CFLAGS+= -DMISSING_NANOSLEEP COMPAT+= compat/clock_nanosleep/clock_nanosleep.o endif diff --git a/compat/clock_nanosleep/clock_nanosleep.h b/compat/clock_nanosleep/clock_nanosleep.h index f736409..ba0b247 100644 --- a/compat/clock_nanosleep/clock_nanosleep.h +++ b/compat/clock_nanosleep/clock_nanosleep.h @@ -1,8 +1,8 @@ #ifndef CLOCK_NANOSLEEP_H #define CLOCK_NANOSLEEP_H -#ifndef _CLOCK_T_DEFINED_ -#define _CLOCK_T_DEFINED_ +#ifndef CLOCKID_T +#define CLOCKID_T typedef enum { CLOCK_REALTIME, @@ -10,7 +10,8 @@ typedef enum CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID } clockid_t; -#endif // _CLOCK_T_DEFINED_ +#endif // ifndef CLOCKID_T + #ifndef TIMER_ABSTIME #define TIMER_ABSTIME 1 diff --git a/compat/compat.h b/compat/compat.h index 4c5fadb..5905e10 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -7,11 +7,6 @@ #if defined(__APPLE__) -/* implementations of clock_gettime, clock_nanosleep */ - -#define MISSING_NANOSLEEP -#define MISSING_GETTIME - /* * Mach endian conversion */ @@ -29,16 +24,12 @@ #endif -#if defined(__OpenBSD__) -#define MISSING_NANOSLEEP -#endif - #ifdef MISSING_NANOSLEEP #include "clock_nanosleep/clock_nanosleep.h" #endif #ifdef MISSING_GETTIME -#include "clock_nanosleep/clock_gettime.h" +#include "clock_gettime/clock_gettime.h" #endif #endif //COMPAT_UTIL_H