gtypes: Deprecate GTimeVal in favour of guint64 or GDateTime

GTimeVal is subject to the year 2038 problem, since its `tv_sec` field
is a `glong`, which is 32 bits on 32-bit platforms.

Use `guint64` to represent microsecond-precision time since the Unix
epoch; or use `GDateTime` for full date/time representation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1438
This commit is contained in:
Philip Withnall
2019-06-14 12:30:11 +01:00
parent e357619d24
commit e3f88f311f
4 changed files with 8 additions and 2 deletions

View File

@@ -544,9 +544,11 @@ GLIB_AVAILABLE_IN_ALL
void g_source_remove_child_source (GSource *source,
GSource *child_source);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GLIB_DEPRECATED_IN_2_28_FOR(g_source_get_time)
void g_source_get_current_time (GSource *source,
GTimeVal *timeval);
G_GNUC_END_IGNORE_DEPRECATIONS
GLIB_AVAILABLE_IN_ALL
gint64 g_source_get_time (GSource *source);