Source: nim
Version: 0.20.0-1
Severity: important
Tags: patch

Hi!

The attached patch is an updated version of the patch in [1].

It should fix the build on the big-endian targets mips, powerpc, ppc64
and sparc64. The build on m68k is affected by another bug that needs
to be investigated.

Cheers,
Adrian

> [1] https://github.com/nim-lang/Nim/issues/9690

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Fix build on big-endian targets
Author: John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de>
Forwarded: https://github.com/nim-lang/Nim/pull/11437

--- nim-0.20.0.orig/lib/pure/times.nim
+++ nim-0.20.0/lib/pure/times.nim
@@ -1899,15 +1899,15 @@ proc initTimeFormat*(format: string): Ti
     of tkLiteral:
       case token
       else:
-        result.patterns.add(FormatPattern.Lit.byte)
+        result.patterns.add(ord(FormatPattern.Lit).byte)
         if token.len > 255:
           raise newException(TimeFormatParseError,
                              "Format literal is to long:" & token)
         result.patterns.add(token.len.byte)
         for c in token:
-          result.patterns.add(c.byte)
+          result.patterns.add(ord(c).byte)
     of tkPattern:
-      result.patterns.add(stringToPattern(token).byte)
+      result.patterns.add(ord(stringToPattern(token)).byte)
 
 proc formatPattern(dt: DateTime, pattern: FormatPattern, result: var string, 
loc: DateTimeLocale) =
   template yearOfEra(dt: DateTime): int =

Reply via email to