summaryrefslogtreecommitdiff
path: root/libsoup
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2020-01-16 13:06:38 +0200
committerPatrick Griffis <tingping@tingping.se>2020-01-17 05:37:28 +0000
commit040593875e0193935a1141bdf21388abb4b5087b (patch)
treef6fdbc849b172c48e0d4f91014adeda80ce1365c /libsoup
parentb9d34b0e9ed6ff68cd265091c5a67dcd88f3a703 (diff)
downloadlibsoup-040593875e0193935a1141bdf21388abb4b5087b.tar.gz
SoupDate: deprecate soup_date_to_timeval()
GTimeVal has been deprecated and shouldn't be used, so deprecate soup_date_to_timeval().
Diffstat (limited to 'libsoup')
-rw-r--r--libsoup/soup-date.c4
-rw-r--r--libsoup/soup-date.h3
-rw-r--r--libsoup/soup-version.h.in7
3 files changed, 14 insertions, 0 deletions
diff --git a/libsoup/soup-date.c b/libsoup/soup-date.c
index 349e8cc0..9602d1f6 100644
--- a/libsoup/soup-date.c
+++ b/libsoup/soup-date.c
@@ -722,6 +722,7 @@ soup_date_to_time_t (SoupDate *date)
return (time_t) (sizeof (time_t) == 4 ? MIN(seconds, G_MAXINT32) : seconds);
}
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* soup_date_to_timeval:
* @date: a #SoupDate
@@ -729,6 +730,8 @@ soup_date_to_time_t (SoupDate *date)
*
* Converts @date to a #GTimeVal.
*
+ * Deprecated: Do not use #GTimeVal, as it's not Y2038-safe.
+ *
* Since: 2.24
*/
void
@@ -743,6 +746,7 @@ soup_date_to_timeval (SoupDate *date, GTimeVal *time)
time->tv_sec = ((((time->tv_sec * 24) + date->hour) * 60) + date->minute) * 60 + date->second;
time->tv_usec = 0;
}
+G_GNUC_END_IGNORE_DEPRECATIONS
/**
* soup_date_is_past:
diff --git a/libsoup/soup-date.h b/libsoup/soup-date.h
index 04d65e8d..631e700d 100644
--- a/libsoup/soup-date.h
+++ b/libsoup/soup-date.h
@@ -59,11 +59,14 @@ char *soup_date_to_string (SoupDate *date,
SOUP_AVAILABLE_IN_2_24
time_t soup_date_to_time_t (SoupDate *date);
+#ifndef SOUP_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
SOUP_AVAILABLE_IN_2_24
+SOUP_DEPRECATED_IN_2_70
void soup_date_to_timeval (SoupDate *date,
GTimeVal *time);
G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
SOUP_AVAILABLE_IN_2_24
gboolean soup_date_is_past (SoupDate *date);
diff --git a/libsoup/soup-version.h.in b/libsoup/soup-version.h.in
index fc24f3cb..149a4ea8 100644
--- a/libsoup/soup-version.h.in
+++ b/libsoup/soup-version.h.in
@@ -68,6 +68,7 @@ G_BEGIN_DECLS
#define SOUP_VERSION_2_62 (G_ENCODE_VERSION (2, 62))
#define SOUP_VERSION_2_66 (G_ENCODE_VERSION (2, 66))
#define SOUP_VERSION_2_68 (G_ENCODE_VERSION (2, 68))
+#define SOUP_VERSION_2_70 (G_ENCODE_VERSION (2, 70))
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
@@ -396,6 +397,12 @@ G_BEGIN_DECLS
# define SOUP_AVAILABLE_IN_2_68 _SOUP_EXTERN
#endif
+#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_70
+# define SOUP_DEPRECATED_IN_2_70 G_DEPRECATED
+#else
+# define SOUP_DEPRECATED_IN_2_70
+#endif
+
SOUP_AVAILABLE_IN_2_42
guint soup_get_major_version (void);