Browse Source

--- Merging r14573 into '.':
U rtl/inc/systemh.inc
--- Merging r14581 into '.':
G rtl/inc/systemh.inc
--- Merging r14584 into '.':
U rtl/unix/unixtype.pp
U rtl/beos/ptypes.inc
U rtl/openbsd/ptypes.inc
U rtl/haiku/ptypes.inc
U rtl/freebsd/ptypes.inc
U rtl/solaris/ptypes.inc
U rtl/netbsd/ptypes.inc
U rtl/darwin/ptypes.inc
U rtl/linux/ptypes.inc
--- Merging r14586 into '.':
U rtl/unix/oscdeclh.inc
U rtl/linux/ossysc.inc
--- Merging r14601 into '.':
U packages/x11/src/x.pp
--- Merging r14626 into '.':
U packages/fcl-base/src/gettext.pp
--- Merging r14644 into '.':
U packages/fcl-xml/src/dom.pp
--- Merging r14646 into '.':
U rtl/win/wininc/defines.inc
--- Merging r14647 into '.':
U packages/winunits-base/src/shlobj.pp

# revisions: 14573,14581,14584,14586,14601,14626,14644,14656,14646,14647
------------------------------------------------------------------------
r14573 | florian | 2010-01-08 10:56:09 +0100 (Fri, 08 Jan 2010) | 1 line
Changed paths:
M /trunk/rtl/inc/systemh.inc

+ patch by Sven Barth to add TDate and TTime to the system unit, resolves #15474
------------------------------------------------------------------------
------------------------------------------------------------------------
r14581 | florian | 2010-01-08 22:22:25 +0100 (Fri, 08 Jan 2010) | 2 lines
Changed paths:
M /trunk/rtl/inc/systemh.inc

* disabled TTime and TDate for now till a solution for the conflicts on unix is found

------------------------------------------------------------------------
------------------------------------------------------------------------
r14584 | marco | 2010-01-09 17:05:42 +0100 (Sat, 09 Jan 2010) | 5 lines
Changed paths:
M /trunk/rtl/beos/ptypes.inc
M /trunk/rtl/darwin/ptypes.inc
M /trunk/rtl/freebsd/ptypes.inc
M /trunk/rtl/haiku/ptypes.inc
M /trunk/rtl/linux/ptypes.inc
M /trunk/rtl/netbsd/ptypes.inc
M /trunk/rtl/openbsd/ptypes.inc
M /trunk/rtl/solaris/ptypes.inc
M /trunk/rtl/unix/unixtype.pp

* moves the alias "TTime = time_t" from ptypes.inc to unixtype.pp.
This means it is not aliased in the body of the system unit (which causes
trouble with the delphi type of the same name), but baseunix/unix/unixtype
will containue to export the type.

------------------------------------------------------------------------
------------------------------------------------------------------------
r14586 | marco | 2010-01-09 23:02:36 +0100 (Sat, 09 Jan 2010) | 2 lines
Changed paths:
M /trunk/rtl/linux/ossysc.inc
M /trunk/rtl/unix/oscdeclh.inc

* Linux specific time_t fixes. Also tested with -dFPC_USE_LIBC and more problem fixed.

------------------------------------------------------------------------
------------------------------------------------------------------------
r14601 | marco | 2010-01-10 16:23:12 +0100 (Sun, 10 Jan 2010) | 2 lines
Changed paths:
M /trunk/packages/x11/src/x.pp

* inversed the ttime/ptime declaration to be sure, see mantis 15483.

------------------------------------------------------------------------
------------------------------------------------------------------------
r14626 | marco | 2010-01-12 15:05:51 +0100 (Tue, 12 Jan 2010) | 2 lines
Changed paths:
M /trunk/packages/fcl-base/src/gettext.pp

* endianfixes .mo reader.

------------------------------------------------------------------------
------------------------------------------------------------------------
r14644 | sergei | 2010-01-14 17:23:54 +0100 (Thu, 14 Jan 2010) | 1 line
Changed paths:
M /trunk/packages/fcl-xml/src/dom.pp

* A forgotten part of r13824: the condition in assertion must be the same as the condition of calling TNodePool.AddExtent.
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
r14646 | marco | 2010-01-14 21:28:58 +0100 (Thu, 14 Jan 2010) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/defines.inc

* image_file_machine constants

------------------------------------------------------------------------
------------------------------------------------------------------------
r14647 | marco | 2010-01-14 21:44:59 +0100 (Thu, 14 Jan 2010) | 2 lines
Changed paths:
M /trunk/packages/winunits-base/src/shlobj.pp

* ishellextinit

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

git-svn-id: branches/fixes_2_4@14713 -

marco 15 years ago
parent
commit
14afc58997

+ 44 - 2
packages/fcl-base/src/gettext.pp

@@ -26,7 +26,6 @@ const
   MOFileHeaderMagic = $950412de;
   MOFileHeaderMagic = $950412de;
 
 
 type
 type
-
   TMOFileHeader = packed record
   TMOFileHeader = packed record
     magic: LongWord;             // MOFileHeaderMagic
     magic: LongWord;             // MOFileHeaderMagic
     revision: LongWord;          // 0
     revision: LongWord;          // 0
@@ -85,18 +84,55 @@ uses
 {$endif}
 {$endif}
 
 
 
 
+procedure Endianfixmotable(p:PMOStringTable;n:integer);
+var I:integer;
+begin
+  if n>0 then
+    for i:=0 to n-1 do
+      begin 
+        p^[i].length:=swapendian(p^[i].length);
+        p^[i].offset:=swapendian(p^[i].offset);
+      end;
+end;
+
+procedure Endianfixhashtable(p:PLongwordArray;n:integer);
+var I:integer;
+begin
+  if n>0 then
+    for i:=0 to n-1 do
+      begin 
+        p^[i]:=swapendian(p^[i]);
+      end;
+end;
+
 constructor TMOFile.Create(AStream: TStream);
 constructor TMOFile.Create(AStream: TStream);
 var
 var
   header: TMOFileHeader;
   header: TMOFileHeader;
   i: Integer;
   i: Integer;
+  endianswap : boolean;
+
 begin
 begin
   inherited Create;
   inherited Create;
 
 
   AStream.Read(header, Sizeof(header));
   AStream.Read(header, Sizeof(header));
 
 
-  if header.magic <> MOFileHeaderMagic then
+  if (header.magic <> MOFileHeaderMagic) and (swapendian(header.magic)<>MOFileHeaderMagic) then
     raise EMOFileError.Create('Invalid magic - not a MO file?');
     raise EMOFileError.Create('Invalid magic - not a MO file?');
 
 
+  endianswap:=header.magic<>MOFileHeaderMagic;
+  If EndianSwap then 
+    begin
+     with header do
+       begin 
+          revision	:=SwapEndian(revision);
+          nstrings	:=SwapEndian(nstrings);
+          OrigTabOffset :=SwapEndian(OrigTabOffset);
+          TransTabOffset:=SwapEndian(TransTabOffset);
+          HashTabSize   :=SwapEndian(HashTabSize);
+          HashTabOffset :=SwapEndian(HashTabOffset);
+       end;
+    end;
+
   GetMem(OrigTable, header.nstrings * SizeOf(TMOStringInfo));
   GetMem(OrigTable, header.nstrings * SizeOf(TMOStringInfo));
   GetMem(TranslTable, header.nstrings * SizeOf(TMOStringInfo));
   GetMem(TranslTable, header.nstrings * SizeOf(TMOStringInfo));
   GetMem(OrigStrings, header.nstrings * SizeOf(PChar));
   GetMem(OrigStrings, header.nstrings * SizeOf(PChar));
@@ -105,9 +141,13 @@ begin
 
 
   AStream.Position := header.OrigTabOffset;
   AStream.Position := header.OrigTabOffset;
   AStream.Read(OrigTable^, header.nstrings * SizeOf(TMOStringInfo));
   AStream.Read(OrigTable^, header.nstrings * SizeOf(TMOStringInfo));
+  if EndianSwap then 
+    EndianFixmotable(OrigTable,Header.NStrings);
 
 
   AStream.Position := header.TransTabOffset;
   AStream.Position := header.TransTabOffset;
   AStream.Read(TranslTable^, header.nstrings * SizeOf(TMOStringInfo));
   AStream.Read(TranslTable^, header.nstrings * SizeOf(TMOStringInfo));
+  if EndianSwap then 
+    EndianFixmotable(TranslTable,Header.NStrings);
 
 
   StringCount := header.nstrings;
   StringCount := header.nstrings;
 
 
@@ -139,6 +179,8 @@ begin
   GetMem(HashTable, 4 * HashTableSize);
   GetMem(HashTable, 4 * HashTableSize);
   AStream.Position := header.HashTabOffset;
   AStream.Position := header.HashTabOffset;
   AStream.Read(HashTable^, 4 * HashTableSize);
   AStream.Read(HashTable^, 4 * HashTableSize);
+  if EndianSwap then 
+    EndianFixHashTable(hashtable,hashtablesize);
 end;
 end;
 
 
 constructor TMOFile.Create(const AFilename: String);
 constructor TMOFile.Create(const AFilename: String);

+ 1 - 1
packages/fcl-xml/src/dom.pp

@@ -3289,7 +3289,7 @@ var
   ext: PExtent;
   ext: PExtent;
 begin
 begin
   Assert((FCurrExtent = nil) or
   Assert((FCurrExtent = nil) or
-    (PAnsiChar(FCurrBlock) = PAnsiChar(FCurrExtent) + sizeof(TExtent)));
+    (PAnsiChar(FCurrBlock) < PAnsiChar(FCurrExtent) + sizeof(TExtent)));
   Assert(AElemCount > 0);
   Assert(AElemCount > 0);
 
 
   GetMem(ext, sizeof(TExtent) + AElemCount * FElementSize);
   GetMem(ext, sizeof(TExtent) + AElemCount * FElementSize);

+ 7 - 0
packages/winunits-base/src/shlobj.pp

@@ -22,6 +22,7 @@ uses
       windows,activex,shellapi,commctrl;
       windows,activex,shellapi,commctrl;
 
 
 Const 
 Const 
+   IID_IShellExtInit    ='{000214E8-0000-0000-C000-000000000046}';
    IID_IShellFolder    : TGUID ='{000214E6-0000-0000-C000-000000000046}';
    IID_IShellFolder    : TGUID ='{000214E6-0000-0000-C000-000000000046}';
    IID_IEnumList       : TGUID ='{000214F2-0000-0000-C000-000000000046}';
    IID_IEnumList       : TGUID ='{000214F2-0000-0000-C000-000000000046}';
    IID_IAutoComplete   : TGUID ='{00bb2762-6a77-11d0-a535-00c04fd7d062}';
    IID_IAutoComplete   : TGUID ='{00bb2762-6a77-11d0-a535-00c04fd7d062}';
@@ -2121,6 +2122,12 @@ Type
 		  end;
 		  end;
 
 
 
 
+
+    IShellExtInit = Interface(IUnknown)
+          [IID_IShellExtInit]
+         function Initialize(pidlfolder: LPCITEMIDLIST; pdtobj : IDataObject;hkeyProgID : HKEY):HResult; stdcall;
+         end;
+
 function SHGetMalloc(out ppmalloc: IMalloc):HResult;StdCall; external 'shell32' name 'SHGetMalloc';
 function SHGetMalloc(out ppmalloc: IMalloc):HResult;StdCall; external 'shell32' name 'SHGetMalloc';
 function SHGetDesktopFolder(out ppshf:IShellFolder):HResult;StdCall; external 'shell32' name 'SHGetDesktopFolder';
 function SHGetDesktopFolder(out ppshf:IShellFolder):HResult;StdCall; external 'shell32' name 'SHGetDesktopFolder';
 
 

+ 1 - 1
packages/x11/src/x.pp

@@ -39,8 +39,8 @@ type
    PVisualID = ^TVisualID;
    PVisualID = ^TVisualID;
    TVisualID = culong;
    TVisualID = culong;
 
 
-   PTime = ^TTime;
    TTime = culong;
    TTime = culong;
+   PTime = ^TTime;
 
 
    PPWindow = ^PWindow;
    PPWindow = ^PWindow;
    PWindow = ^TWindow;
    PWindow = ^TWindow;

+ 3 - 2
rtl/beos/ptypes.inc

@@ -85,8 +85,9 @@ type
     TClock   = clock_t;
     TClock   = clock_t;
     pClock   = ^clock_t;
     pClock   = ^clock_t;
 
 
-    time_t   = clong;           { used for returning the time  }
-    TTime    = time_t; 
+    time_t   = clong;           { used for returning the time  }/
+
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
     pTime    = ^time_t;
     pTime    = ^time_t;
     ptime_t =  ^time_t;
     ptime_t =  ^time_t;
     
     

+ 2 - 1
rtl/darwin/ptypes.inc

@@ -77,7 +77,8 @@ type
     pClock   = ^clock_t;
     pClock   = ^clock_t;
 
 
     time_t   = clong;           { used for returning the time  }
     time_t   = clong;           { used for returning the time  }
-    TTime    = time_t;
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
+
     pTime    = ^time_t;
     pTime    = ^time_t;
     ptime_t  = ^time_t;
     ptime_t  = ^time_t;
 
 

+ 3 - 1
rtl/freebsd/ptypes.inc

@@ -94,7 +94,9 @@ type
 
 
     time_t   = clong;           { used for returning the time, clong
     time_t   = clong;           { used for returning the time, clong
                                         is 64-bit on AMD64}
                                         is 64-bit on AMD64}
-    TTime    = time_t;
+
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
+
     pTime    = ^time_t;
     pTime    = ^time_t;
     ptime_t =  ^time_t;
     ptime_t =  ^time_t;
 
 

+ 1 - 1
rtl/haiku/ptypes.inc

@@ -86,7 +86,7 @@ type
     pClock   = ^clock_t;
     pClock   = ^clock_t;
 
 
     time_t   = clong;           { used for returning the time  }
     time_t   = clong;           { used for returning the time  }
-    TTime    = time_t; 
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
     pTime    = ^time_t;
     pTime    = ^time_t;
     ptime_t =  ^time_t;
     ptime_t =  ^time_t;
     
     

+ 2 - 0
rtl/inc/systemh.inc

@@ -299,6 +299,8 @@ Type
   HRESULT             = type Longint;
   HRESULT             = type Longint;
 {$ifndef FPUNONE}
 {$ifndef FPUNONE}
   TDateTime           = type Double;
   TDateTime           = type Double;
+//  TDate               = type TDateTime;
+//  TTime               = type TDateTime;
 {$endif}
 {$endif}
   TError               = type Longint;
   TError               = type Longint;
 
 

+ 1 - 1
rtl/linux/ossysc.inc

@@ -19,7 +19,7 @@
                      --- Main:The System Call Self ---
                      --- Main:The System Call Self ---
 *****************************************************************************}
 *****************************************************************************}
 
 
-function Fptime(tloc:pTime): TTime; [public, alias : 'FPC_SYSC_TIME'];
+function Fptime(tloc:pTime_t): Time_t; [public, alias : 'FPC_SYSC_TIME'];
 {$ifdef FPC_USEGETTIMEOFDAY}
 {$ifdef FPC_USEGETTIMEOFDAY}
 VAR tv     : timeval;
 VAR tv     : timeval;
     tz     : timezone;
     tz     : timezone;

+ 2 - 1
rtl/linux/ptypes.inc

@@ -98,7 +98,8 @@ Type
     pSSize    = ^ssize_t;
     pSSize    = ^ssize_t;
     TClock    = clock_t;
     TClock    = clock_t;
     pClock    = ^clock_t;
     pClock    = ^clock_t;
-    TTime     = time_t;
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
+
     pTime     = ^time_t;
     pTime     = ^time_t;
     ptime_t   = ^time_t;
     ptime_t   = ^time_t;
 
 

+ 1 - 1
rtl/netbsd/ptypes.inc

@@ -80,7 +80,7 @@ type
     pClock   = ^clock_t;
     pClock   = ^clock_t;
 
 
     time_t   = clong;           { used for returning the time  }
     time_t   = clong;           { used for returning the time  }
-    TTime    = time_t;
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
     pTime    = ^time_t;
     pTime    = ^time_t;
     ptime_t  = ^time_t;
     ptime_t  = ^time_t;
 
 

+ 1 - 1
rtl/openbsd/ptypes.inc

@@ -70,7 +70,7 @@ type
     pClock   = ^clock_t;
     pClock   = ^clock_t;
 
 
     time_t   = clong;           { used for returning the time  }
     time_t   = clong;           { used for returning the time  }
-    TTime    = time_t;
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
     pTime    = ^time_t;
     pTime    = ^time_t;
     ptime_t  = ^time_t;
     ptime_t  = ^time_t;
 
 

+ 2 - 1
rtl/solaris/ptypes.inc

@@ -93,7 +93,8 @@ Type
     pSSize    = ^ssize_t;
     pSSize    = ^ssize_t;
     TClock    = clock_t;
     TClock    = clock_t;
     pClock    = ^clock_t;
     pClock    = ^clock_t;
-    TTime     = time_t;
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
+
     pTime     = ^time_t;
     pTime     = ^time_t;
     ptime_t   = ^time_t;
     ptime_t   = ^time_t;
     clockid_t = cint;
     clockid_t = cint;

+ 1 - 1
rtl/unix/oscdeclh.inc

@@ -66,7 +66,7 @@ const
     function  FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint;cdecl; external clib name 'sigprocmask';
     function  FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint;cdecl; external clib name 'sigprocmask';
     function  FPSigProcMask(how:cint;const nset : sigset;var oset : sigset):cint;cdecl; external clib name 'sigprocmask';
     function  FPSigProcMask(how:cint;const nset : sigset;var oset : sigset):cint;cdecl; external clib name 'sigprocmask';
     function  FpTime       (tloc:ptime_t): time_t; cdecl; external clib name 'time';
     function  FpTime       (tloc:ptime_t): time_t; cdecl; external clib name 'time';
-    Function  FpTime       (var tloc : TTime): TTime; cdecl; external clib name 'time';
+    Function  FpTime       (var tloc : Time_t): Time_t; cdecl; external clib name 'time';
     function  FpTimes	(var buffer : tms): TClock; cdecl; external clib name 'times';
     function  FpTimes	(var buffer : tms): TClock; cdecl; external clib name 'times';
     function  FpUname   (var name: utsname): cint; cdecl; external clib name 'uname';
     function  FpUname   (var name: utsname): cint; cdecl; external clib name 'uname';
     function  FpUnlink  (path: pchar): cint; cdecl; external clib name 'unlink';
     function  FpUnlink  (path: pchar): cint; cdecl; external clib name 'unlink';

+ 2 - 0
rtl/unix/unixtype.pp

@@ -20,6 +20,8 @@ Interface
 
 
 {$i ptypes.inc}
 {$i ptypes.inc}
 
 
+Type
+  TTime = time_t;
 Implementation
 Implementation
 
 
 End.
 End.

+ 30 - 0
rtl/win/wininc/defines.inc

@@ -5659,6 +5659,36 @@ const
   GPT_BASIC_DATA_ATTRIBUTE_SHADOW_COPY        =qword($2000000000000000);
   GPT_BASIC_DATA_ATTRIBUTE_SHADOW_COPY        =qword($2000000000000000);
   GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY          =qword($1000000000000000);
   GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY          =qword($1000000000000000);
 
 
+    IMAGE_FILE_MACHINE_UNKNOWN           = 0;
+    IMAGE_FILE_MACHINE_I386              = $014c;  // Intel 386.
+    IMAGE_FILE_MACHINE_R3000             = $0162;  // MIPS little-endian, = $160 big-endian
+    IMAGE_FILE_MACHINE_R4000             = $0166;  // MIPS little-endian
+    IMAGE_FILE_MACHINE_R10000            = $0168;  // MIPS little-endian
+    IMAGE_FILE_MACHINE_WCEMIPSV2         = $0169;  // MIPS little-endian WCE v2
+    IMAGE_FILE_MACHINE_ALPHA             = $0184;  // Alpha_AXP
+    IMAGE_FILE_MACHINE_SH3               = $01a2;  // SH3 little-endian
+    IMAGE_FILE_MACHINE_SH3DSP            = $01a3;
+    IMAGE_FILE_MACHINE_SH3E              = $01a4;  // SH3E little-endian
+    IMAGE_FILE_MACHINE_SH4               = $01a6;  // SH4 little-endian
+    IMAGE_FILE_MACHINE_SH5               = $01a8;  // SH5
+    IMAGE_FILE_MACHINE_ARM               = $01c0;  // ARM Little-Endian
+    IMAGE_FILE_MACHINE_THUMB             = $01c2;
+    IMAGE_FILE_MACHINE_AM33              = $01d3;
+    IMAGE_FILE_MACHINE_POWERPC           = $01F0;  // IBM PowerPC Little-Endian
+    IMAGE_FILE_MACHINE_POWERPCFP         = $01f1;
+    IMAGE_FILE_MACHINE_IA64              = $0200;  // Intel 64
+    IMAGE_FILE_MACHINE_MIPS16            = $0266;  // MIPS
+    IMAGE_FILE_MACHINE_ALPHA64           = $0284;  // ALPHA64
+    IMAGE_FILE_MACHINE_MIPSFPU           = $0366;  // MIPS
+    IMAGE_FILE_MACHINE_MIPSFPU16         = $0466;  // MIPS
+    IMAGE_FILE_MACHINE_AXP64             = IMAGE_FILE_MACHINE_ALPHA64;
+    IMAGE_FILE_MACHINE_TRICORE           = $0520;  // Infineon
+    IMAGE_FILE_MACHINE_CEF               = $0CEF;
+    IMAGE_FILE_MACHINE_EBC               = $0EBC;  // EFI Byte Code
+    IMAGE_FILE_MACHINE_AMD64             = $8664;  // AMD64 (K8)
+    IMAGE_FILE_MACHINE_M32R              = $9041;  // M32R little-endian
+    IMAGE_FILE_MACHINE_CEE               = $C0EE;
+
 {$endif read_interface}
 {$endif read_interface}
 
 
 {$ifdef read_implementation}
 {$ifdef read_implementation}