Bläddra i källkod

--- Merging r19537 into '.':
U rtl/unix/timezone.inc

# revisions: 19537
------------------------------------------------------------------------
r19537 | jonas | 2011-10-24 21:24:57 +0200 (Mon, 24 Oct 2011) | 3 lines
Changed paths:
M /trunk/rtl/unix/timezone.inc

* support for iOS-specific location of "localtime" time zone file
(problem reported at http://blogs.embarcadero.com/ao/2011/10/20/39180 )

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@19708 -

marco 13 år sedan
förälder
incheckning
0654b7d02f
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5 0
      rtl/unix/timezone.inc

+ 5 - 0
rtl/unix/timezone.inc

@@ -267,6 +267,7 @@ Const
 
   TimeZoneFile = '/etc/localtime';                      // POSIX
   AltTimeZoneFile = '/usr/lib/zoneinfo/localtime';      // Other
+  iOSTimeZoneFile = '/var/db/timezone/localtime';      // iOS
 {$ifdef BSD}
   BSDTimeZonefile = '/usr/share/zoneinfo';      // BSD usually is POSIX
                                                 // compliant though
@@ -304,6 +305,10 @@ begin
 //       If fpstat(BSDTimeZoneFile,{$ifdef oldlinuxstat}baseunix.stat(info){$else}info{$endif})>=0 then
 // GetTimeZoneFile:=BSDTimeZoneFile
 {$ENDIF}
+{$if (defined(darwin) and defined(arm)) or defined(iphonesim)}
+  else If fpstat(iOSTimeZoneFile,info)>=0 then
+      GetTimeZoneFile:=iOSTimeZoneFile
+{$endif}
 end;
 
 {$endif ndef FPC_HAS_GETTIMEZONEFILE}