]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR modula2/112110: fails to build on freebsd when compiling wrapclock.cc
authorGaius Mulley <gaiusmod2@gmail.com>
Fri, 27 Oct 2023 17:42:09 +0000 (18:42 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Fri, 27 Oct 2023 17:42:09 +0000 (18:42 +0100)
This patch fixes a mangled #if #endif conditional section within
wrapclock.cc.  The conditional section in wrapclock_timezone
should return 0 rather than return timezone.

libgm2/ChangeLog:

PR modula2/112110
* libm2iso/wrapclock.cc (timezone): Return 0 if unable
to get the timezone from the tm struct.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
libgm2/libm2iso/wrapclock.cc

index a4d62b7085c9c4b469d00da1594bb95f680e0c2f..31ddeb573f8a3503b56719c772a287cb369ecfbd 100644 (file)
@@ -235,16 +235,9 @@ EXPORT(timezone) (void)
       localtime_r (&time, &result);
       return result.tm_gmtoff;
     }
-  else
-#endif
 #endif
-    {
-#if defined(HAVE_TIMEZONE)
-      return timezone;
-#else
-      return 0;
 #endif
-    }
+  return 0;
 }
 
 /* istimezone returns 1 if timezone in wrapclock.cc can resolve the