shared: struct timespec is in time.h
authorYann E. MORIN <yann.morin.1998@free.fr>
Sun, 1 Oct 2017 12:31:10 +0000 (14:31 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 2 Oct 2017 09:19:18 +0000 (12:19 +0300)
On the musl C library, tests/timespec-text.c does not build, with the
following error:

    In file included from tests/timespec-test.c:36:0:
    ./shared/timespec-util.h:41:21: warning: â€˜struct timespec’ declared
    inside parameter list will not be visible outside of this definition
    or declaration
     timespec_sub(struct timespec *r,
                         ^~~~~~~~
   [...]

Indeed, struct timespec is defined in time.h, so we must include it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
shared/timespec-util.h

index 576b3e8f08e7e77af109c454385c8d27500a2a06..34a120ae659e163355af0c0110818927d2832024 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <stdint.h>
 #include <assert.h>
+#include <time.h>
 
 #define NSEC_PER_SEC 1000000000