#include <time.h>

#include "clock.h"

#include "clock_type.h"

extern int clock_init(struct SPDR_Clock **clockp, struct SPDR_Allocator *allocator)
{
        struct timespec res;

        if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) {
                /* unknown clock or insufficient resolution */
                return -1;
        }

        return clock_init_base(clockp, allocator, 1, 1000);
}

extern uint64_t clock_ticks(struct SPDR_Clock const *const clock)
{
        struct timespec ts;
        clock_gettime(CLOCK_MONOTONIC, &ts);

        (void)clock;

        return ts.tv_sec * 1000000000LL + ts.tv_nsec;
}

#include <time.h>

#include "clock.h"

#include "clock_type.h"

extern int clock_init(struct Clock **clockp, struct Allocator *allocator)
{
        struct timespec res;

        if (clock_getres(CLOCK_MONOTONIC, &res) != 0 || res.tv_nsec > 1000) {
                /* unknown clock or insufficient resolution */
                return -1;
        }

        return clock_init_base(clockp, allocator, 1, 1000);
}

extern uint64_t clock_ticks(struct Clock const *const clock)
{
        struct timespec ts;
        clock_gettime(CLOCK_MONOTONIC, &ts);

        (void)clock;

        return ts.tv_sec * 1000000000LL + ts.tv_nsec;
}

--- 
+++ 
@@ -4,7 +4,7 @@
 
 #include "clock_type.h"
 
-extern int clock_init(struct Clock **clockp, struct Allocator *allocator)
+extern int clock_init(struct SPDR_Clock **clockp, struct SPDR_Allocator *allocator)
 {
         struct timespec res;
 
@@ -16,7 +16,7 @@
         return clock_init_base(clockp, allocator, 1, 1000);
 }
 
-extern uint64_t clock_ticks(struct Clock const *const clock)
+extern uint64_t clock_ticks(struct SPDR_Clock const *const clock)
 {
         struct timespec ts;
         clock_gettime(CLOCK_MONOTONIC, &ts);
Fix compilation on posix platforms
