gnucash master: Fix compilation error on Windows
Geert Janssens
gjanssens at code.gnucash.org
Tue Feb 18 13:00:38 EST 2014
Updated via https://github.com/Gnucash/gnucash/commit/80cd6d72 (commit)
from https://github.com/Gnucash/gnucash/commit/0c7c3356 (commit)
commit 80cd6d7238694d18923eb58040829d3f34a94f68
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Tue Feb 18 18:59:54 2014 +0100
Fix compilation error on Windows
Not allowed to mix declarations and code in ISO C90...
diff --git a/src/libqof/qof/gnc-date.c b/src/libqof/qof/gnc-date.c
index cd879fa..dae44d1 100644
--- a/src/libqof/qof/gnc-date.c
+++ b/src/libqof/qof/gnc-date.c
@@ -105,19 +105,22 @@ gnc_g_time_zone_new_local (void)
{
static GTimeZone* tz = NULL;
if (tz)
- return tz;
+ return tz;
#ifndef G_OS_WIN32
tz = g_time_zone_new_local();
return tz;
#else
- TIME_ZONE_INFORMATION tzinfo;
- gint64 dst = GetTimeZoneInformation (&tzinfo);
- gint bias = tzinfo.Bias + tzinfo.StandardBias;
- gint hours = -bias / 60; // 60 minutes per hour
- gint minutes = (bias < 0 ? -bias : bias) % 60;
- gchar *tzstr = g_strdup_printf ("%+03d:%02d", hours, minutes);
- tz = g_time_zone_new(tzstr);
- g_free (tzstr); return tz;
+ {
+ TIME_ZONE_INFORMATION tzinfo;
+ gint64 dst = GetTimeZoneInformation (&tzinfo);
+ gint bias = tzinfo.Bias + tzinfo.StandardBias;
+ gint hours = -bias / 60; // 60 minutes per hour
+ gint minutes = (bias < 0 ? -bias : bias) % 60;
+ gchar *tzstr = g_strdup_printf ("%+03d:%02d", hours, minutes);
+ tz = g_time_zone_new(tzstr);
+ g_free (tzstr);
+ }
+ return tz;
#endif
}
Summary of changes:
src/libqof/qof/gnc-date.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
More information about the gnucash-changes
mailing list