Just to get compilation working. Any use of Timer API will result in an abort() for now.
typedef pthread_cond_t vlc_cond_t;
typedef pthread_key_t vlc_threadvar_t;
typedef struct vlc_timer_t vlc_timer_t;
typedef pthread_cond_t vlc_cond_t;
typedef pthread_key_t vlc_threadvar_t;
typedef struct vlc_timer_t vlc_timer_t;
+
+#ifndef __APPLE__
+/* There is no POSIX timer on Mac OS X. Move that to configure eventually. */
+#define HAVE_POSIX_TIMER 1
+#endif
+
void (*func) (void *);
void *data;
};
void (*func) (void *);
void *data;
};
+#ifndef HAVE_POSIX_TIMER
+/* We have no fallback currently. We'll just crash on timer API usage. */
+static void timer_not_supported(void)
+{
+ fprintf(stderr, "*** Error: Timer API is not supported on this platform.\n");
+ abort();
+}
+#endif
static void vlc_timer_do (union sigval val)
{
static void vlc_timer_do (union sigval val)
{
*/
int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data)
{
*/
int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data)
{
struct sigevent ev;
memset (&ev, 0, sizeof (ev));
struct sigevent ev;
memset (&ev, 0, sizeof (ev));
+#else
+ timer_not_supported();
+ return 0;
+#endif
*/
void vlc_timer_destroy (vlc_timer_t *id)
{
*/
void vlc_timer_destroy (vlc_timer_t *id)
{
int val = timer_delete (id->handle);
VLC_THREAD_ASSERT ("deleting timer");
int val = timer_delete (id->handle);
VLC_THREAD_ASSERT ("deleting timer");
+#else
+ timer_not_supported();
+#endif
void vlc_timer_schedule (vlc_timer_t *id, bool absolute,
mtime_t value, mtime_t interval)
{
void vlc_timer_schedule (vlc_timer_t *id, bool absolute,
mtime_t value, mtime_t interval)
{
lldiv_t vad = lldiv (value, CLOCK_FREQ);
lldiv_t itd = lldiv (interval, CLOCK_FREQ);
struct itimerspec it = {
lldiv_t vad = lldiv (value, CLOCK_FREQ);
lldiv_t itd = lldiv (interval, CLOCK_FREQ);
struct itimerspec it = {
int val = timer_settime (id->handle, flags, &it, NULL);
VLC_THREAD_ASSERT ("scheduling timer");
int val = timer_settime (id->handle, flags, &it, NULL);
VLC_THREAD_ASSERT ("scheduling timer");
+#else
+ timer_not_supported();
+#endif
*/
unsigned vlc_timer_getoverrun (const vlc_timer_t *id)
{
*/
unsigned vlc_timer_getoverrun (const vlc_timer_t *id)
{
int val = timer_getoverrun (id->handle);
#ifndef NDEBUG
if (val == -1)
int val = timer_getoverrun (id->handle);
#ifndef NDEBUG
if (val == -1)
+#else
+ timer_not_supported();
+ return 0;
+#endif