浏览代码

* 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: trunk@19537 -

Jonas Maebe 13 年之前
父节点
当前提交
9ee27c1606
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      rtl/unix/timezone.inc

+ 5 - 0
rtl/unix/timezone.inc

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