[glib: 8/26] gmain: Deprecate g_get_current_time() because it uses GTimeVal
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 8/26] gmain: Deprecate g_get_current_time() because it uses GTimeVal
- Date: Mon, 29 Jul 2019 13:00:58 +0000 (UTC)
commit 626b6f5ea7704af566b59867218bf48282f6dd49
Author: Philip Withnall <withnall endlessm com>
Date: Tue Jun 18 12:35:41 2019 +0100
gmain: Deprecate g_get_current_time() because it uses GTimeVal
GTimeVal is not year-2038-safe.
Signed-off-by: Philip Withnall <withnall endlessm com>
Helps: #1438
glib/gmain.c | 5 +++++
glib/gmain.h | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/glib/gmain.c b/glib/gmain.c
index afaad918d..2b95631d0 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -2631,7 +2631,11 @@ g_source_query_unix_fd (GSource *source,
* Equivalent to the UNIX gettimeofday() function, but portable.
*
* You may find g_get_real_time() to be more convenient.
+ *
+ * Deprecated: 2.62: #GTimeVal is not year-2038-safe. Use g_get_real_time()
+ * instead.
**/
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void
g_get_current_time (GTimeVal *result)
{
@@ -2664,6 +2668,7 @@ g_get_current_time (GTimeVal *result)
result->tv_usec = time64 % 1000000;
#endif
}
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* g_get_real_time:
diff --git a/glib/gmain.h b/glib/gmain.h
index e9cb7d2d4..d6f51533c 100644
--- a/glib/gmain.h
+++ b/glib/gmain.h
@@ -570,8 +570,11 @@ GSource *g_timeout_source_new_seconds (guint interval);
/* Miscellaneous functions
*/
-GLIB_AVAILABLE_IN_ALL
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+GLIB_DEPRECATED_IN_2_62_FOR(g_get_real_time)
void g_get_current_time (GTimeVal *result);
+G_GNUC_END_IGNORE_DEPRECATIONS
+
GLIB_AVAILABLE_IN_ALL
gint64 g_get_monotonic_time (void);
GLIB_AVAILABLE_IN_ALL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]