Browse Source

fcl-db: ibconnection: adjust TTm structure to match definition in glibc on 64bit architectures (btw: this structure is not used by default). Bug #21656

git-svn-id: trunk@26117 -
lacak 11 years ago
parent
commit
9d1662d977
1 changed files with 21 additions and 19 deletions
  1. 21 19
      packages/fcl-db/src/sqldb/interbase/ibconnection.pp

+ 21 - 19
packages/fcl-db/src/sqldb/interbase/ibconnection.pp

@@ -142,27 +142,13 @@ type
 implementation
 implementation
 
 
 uses
 uses
-  strutils, FmtBCD;
+  StrUtils, FmtBCD;
 
 
 const
 const
   SQL_BOOLEAN_INTERBASE = 590;
   SQL_BOOLEAN_INTERBASE = 590;
   SQL_BOOLEAN_FIREBIRD = 32764;
   SQL_BOOLEAN_FIREBIRD = 32764;
   INVALID_DATA = -1;
   INVALID_DATA = -1;
 
 
-type
-  TTm = packed record
-    tm_sec : longint;
-    tm_min : longint;
-    tm_hour : longint;
-    tm_mday : longint;
-    tm_mon : longint;
-    tm_year : longint;
-    tm_wday : longint;
-    tm_yday : longint;
-    tm_isdst : longint;
-    __tm_gmtoff : longint;
-    __tm_zone : Pchar;
-  end;
 
 
 procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS);
 procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS);
 var
 var
@@ -988,7 +974,6 @@ var
   VSQLVar: ^XSQLVAR;
   VSQLVar: ^XSQLVAR;
   P: TParam;
   P: TParam;
   ft : TFieldType;
   ft : TFieldType;
-  D : TDateTime;
 begin
 begin
   {$push}
   {$push}
   {$R-}
   {$R-}
@@ -1210,9 +1195,26 @@ end;
 
 
 {$DEFINE SUPPORT_MSECS}
 {$DEFINE SUPPORT_MSECS}
 {$IFDEF SUPPORT_MSECS}
 {$IFDEF SUPPORT_MSECS}
-const
-  IBDateOffset = 15018; //an offset from 17 Nov 1858.
-  IBTimeFractionsPerDay  = SecsPerDay * ISC_TIME_SECONDS_PRECISION; //Number of Firebird time fractions per day
+  const
+    IBDateOffset = 15018; //an offset from 17 Nov 1858.
+    IBTimeFractionsPerDay  = SecsPerDay * ISC_TIME_SECONDS_PRECISION; //Number of Firebird time fractions per day
+{$ELSE}
+  {$PACKRECORDS C}
+  type
+    TTm = record
+      tm_sec  : longint;
+      tm_min  : longint;
+      tm_hour : longint;
+      tm_mday : longint;
+      tm_mon  : longint;
+      tm_year : longint;
+      tm_wday : longint;
+      tm_yday : longint;
+      tm_isdst: longint;
+      __tm_gmtoff : PtrInt;    // Seconds east of UTC
+      __tm_zone   : PAnsiChar; // Timezone abbreviation
+    end;
+  {$PACKRECORDS DEFAULT}
 {$ENDIF}
 {$ENDIF}
 
 
 procedure TIBConnection.GetDateTime(CurrBuff, Buffer : pointer; AType : integer);
 procedure TIBConnection.GetDateTime(CurrBuff, Buffer : pointer; AType : integer);