From 4ef9902ea95ef9d99d0e98dd85dc6a124d4c3894 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 4 Dec 2018 12:11:15 +0000 Subject: util.time: Bump POSIX_C_SOURCE to ensure visibility of CLOCK_MONOTONIC on FreeBSD (fixes #1253) --- util-src/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util-src/time.c') diff --git a/util-src/time.c b/util-src/time.c index bfad52ee..bc6b5b1c 100644 --- a/util-src/time.c +++ b/util-src/time.c @@ -1,5 +1,5 @@ #ifndef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200809L #endif #include -- cgit v1.2.3 From a149dda0e3b1c4a37ba1e6019930952374a3992c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 1 Dec 2019 20:25:20 +0100 Subject: util.*.c: Add static qualifiers everywhere --- util-src/time.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util-src/time.c') diff --git a/util-src/time.c b/util-src/time.c index bc6b5b1c..afef3df5 100644 --- a/util-src/time.c +++ b/util-src/time.c @@ -5,18 +5,18 @@ #include #include -lua_Number tv2number(struct timespec *tv) { +static lua_Number tv2number(struct timespec *tv) { return tv->tv_sec + tv->tv_nsec * 1e-9; } -int lc_time_realtime(lua_State *L) { +static int lc_time_realtime(lua_State *L) { struct timespec t; clock_gettime(CLOCK_REALTIME, &t); lua_pushnumber(L, tv2number(&t)); return 1; } -int lc_time_monotonic(lua_State *L) { +static int lc_time_monotonic(lua_State *L) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); lua_pushnumber(L, tv2number(&t)); -- cgit v1.2.3