From f3ce7bc7dcf20275d93974755c42486d812d771f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 10 Nov 2018 21:09:54 -0800 Subject: Move altimespec_get and al_nssleep to examples' common code --- examples/common/alhelpers.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'examples/common/alhelpers.h') diff --git a/examples/common/alhelpers.h b/examples/common/alhelpers.h index 41a7ce58..e3e638ac 100644 --- a/examples/common/alhelpers.h +++ b/examples/common/alhelpers.h @@ -18,6 +18,17 @@ const char *FormatName(ALenum type); int InitAL(char ***argv, int *argc); void CloseAL(void); +/* Cross-platform timeget and sleep functions. */ +#ifndef HAVE_STRUCT_TIMESPEC +struct timespec { + time_t tv_sec; + long tv_nsec; +}; +#endif +#define AL_TIME_UTC 1 +int altimespec_get(struct timespec *ts, int base); +void al_nssleep(unsigned long nsec); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3