aboutsummaryrefslogtreecommitdiffstats
path: root/examples/common/alhelpers.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-10 21:09:54 -0800
committerChris Robinson <[email protected]>2018-11-10 21:09:54 -0800
commitf3ce7bc7dcf20275d93974755c42486d812d771f (patch)
treee18bb582b09b658ee6e955e8994a2fddf42fa6d4 /examples/common/alhelpers.h
parent2f42f74418f079e2ef8f081a7faf915c5eb131b4 (diff)
Move altimespec_get and al_nssleep to examples' common code
Diffstat (limited to 'examples/common/alhelpers.h')
-rw-r--r--examples/common/alhelpers.h11
1 files changed, 11 insertions, 0 deletions
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 */