[gtk/master.msvc] demos: Fix builds against Visual Studio headers
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/master.msvc] demos: Fix builds against Visual Studio headers
- Date: Mon, 22 Jun 2020 09:10:43 +0000 (UTC)
commit 293f2e6b1c1a01efcd040f54711e614c0850bfa1
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Jun 22 17:04:18 2020 +0800
demos: Fix builds against Visual Studio headers
According to [1], '_timezone' is already used for a global variable in the
time.h system header that is supplied by Microsoft, so using that for our
variable name when we are including time.h either directly or indirectly
will cause trouble.
This renames such variables to '_tz' to avoid that
[1]: https://docs.microsoft.com/en-us/cpp/c-runtime-library/daylight-dstbias-timezone-and-tzname
demos/gtk-demo/listview_clocks.c | 6 +++---
demos/gtk-demo/listview_weather.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/demos/gtk-demo/listview_clocks.c b/demos/gtk-demo/listview_clocks.c
index 28bff1e645..6ba1ec5377 100644
--- a/demos/gtk-demo/listview_clocks.c
+++ b/demos/gtk-demo/listview_clocks.c
@@ -323,16 +323,16 @@ gtk_clock_init (GtkClock *self)
static GtkClock *
gtk_clock_new (const char *location,
- GTimeZone *_timezone)
+ GTimeZone *_tz)
{
GtkClock *result;
result = g_object_new (GTK_TYPE_CLOCK,
"location", location,
- "timezone", _timezone,
+ "timezone", _tz,
NULL);
- g_clear_pointer (&_timezone, g_time_zone_unref);
+ g_clear_pointer (&_tz, g_time_zone_unref);
return result;
}
diff --git a/demos/gtk-demo/listview_weather.c b/demos/gtk-demo/listview_weather.c
index 4fa83721f4..e87304d1aa 100644
--- a/demos/gtk-demo/listview_weather.c
+++ b/demos/gtk-demo/listview_weather.c
@@ -77,13 +77,13 @@ gtk_weather_info_new (GDateTime *timestamp,
static GDateTime *
parse_timestamp (const char *string,
- GTimeZone *_timezone)
+ GTimeZone *_tz)
{
char *with_seconds;
GDateTime *result;
with_seconds = g_strconcat (string, ":00", NULL);
- result = g_date_time_new_from_iso8601 (with_seconds, _timezone);
+ result = g_date_time_new_from_iso8601 (with_seconds, _tz);
g_free (with_seconds);
return result;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]