From 36258ede2be3c0f0402d0390cf56aef8fafff5f2 Mon Sep 17 00:00:00 2001 From: g Date: Sun, 31 Aug 2003 13:07:16 +0000 Subject: [PATCH] Added a helper to declare timestamps. git-svn-id: file:///srv/svn/gliv/trunk@31 dbf4865f-1ec6-0310-8412-f61adeb1ccb1 committer: g --- src/include/timestamp.h | 2 ++ src/timestamp.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/include/timestamp.h b/src/include/timestamp.h index 71aec3d..d377e3c 100644 --- a/src/include/timestamp.h +++ b/src/include/timestamp.h @@ -5,6 +5,8 @@ typedef gulong timestamp_t; +#define DECLARE_TIMESTAMP(name) timestamp_t name = 0 + void touch(timestamp_t * ts); void reset_timestamp(timestamp_t * ts); gboolean has_timestamp(timestamp_t ts); diff --git a/src/timestamp.c b/src/timestamp.c index 7ee1e32..5cfec11 100644 --- a/src/timestamp.c +++ b/src/timestamp.c @@ -26,7 +26,7 @@ #include "timestamp.h" /* By maintaining our clock we have an instruction level precision. */ -static timestamp_t global_clock = 0; +static DECLARE_TIMESTAMP(global_clock); G_LOCK_DEFINE_STATIC(global_clock); void touch(timestamp_t * ts) -- 2.11.4.GIT