Quellcode durchsuchen

--- Merging r18246 into '.':
U rtl/objpas/types.pp
--- Merging r18255 into '.':
U rtl/inc/dynlibs.pas
--- Merging r18256 into '.':
U rtl/inc/cmem.pp
A tests/webtbs/tw15571.pp
--- Merging r18785 into '.':
U rtl/i386/mmx.pp
U rtl/i386/cpu.pp
U rtl/x86_64/cpu.pp
--- Merging r18853 into '.':
U rtl/win/wininc/func.inc
U rtl/win/wininc/redef.inc
--- Merging r18921 into '.':
U packages/fcl-base/src/win/fileinfo.pp
--- Merging r18924 into '.':
U utils/fpdoc/fpdocxmlopts.pas
U utils/fpdoc/dglobals.pp
U utils/fpdoc/fpdocproj.pas
U utils/fpdoc/fpdoc.pp
--- Merging r18932 into '.':
U rtl/win/wininc/defines.inc

# revisions: 18246,18255,18256,18785,18853,18921,18924,18932
------------------------------------------------------------------------
r18246 | florian | 2011-08-17 14:01:23 +0200 (Wed, 17 Aug 2011) | 1 line
Changed paths:
M /trunk/rtl/objpas/types.pp

* fix Types.UnionRect as proposed by Piotr Karasinski, resolves #20006
------------------------------------------------------------------------
------------------------------------------------------------------------
r18255 | florian | 2011-08-18 10:37:15 +0200 (Thu, 18 Aug 2011) | 1 line
Changed paths:
M /trunk/rtl/inc/dynlibs.pas

* fix SafeLoadLibrary: fixed defines, sse control word should be stored as well
------------------------------------------------------------------------
------------------------------------------------------------------------
r18256 | florian | 2011-08-18 10:47:44 +0200 (Thu, 18 Aug 2011) | 1 line
Changed paths:
M /trunk/rtl/inc/cmem.pp
A /trunk/tests/webtbs/tw15571.pp

* fixes cmem.malloc et al. for windows as proposed by Ludo Brands, resolves #15571
------------------------------------------------------------------------
------------------------------------------------------------------------
r18785 | florian | 2011-08-20 14:01:48 +0200 (Sat, 20 Aug 2011) | 1 line
Changed paths:
M /trunk/rtl/i386/cpu.pp
M /trunk/rtl/i386/mmx.pp
M /trunk/rtl/x86_64/cpu.pp

+ is_sse3_cpu, put into cpu unit, so x86-64 and i386 can share source code
------------------------------------------------------------------------
------------------------------------------------------------------------
r18853 | marco | 2011-08-26 15:16:37 +0200 (Fri, 26 Aug 2011) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/func.inc
M /trunk/rtl/win/wininc/redef.inc

* fix for mantis #20047 ddeconnect VAR Parameter issue that can take NIL.

------------------------------------------------------------------------
------------------------------------------------------------------------
r18921 | michael | 2011-08-31 10:51:35 +0200 (Wed, 31 Aug 2011) | 1 line
Changed paths:
M /trunk/packages/fcl-base/src/win/fileinfo.pp

Patch from Ludo Brands to fix issue #20106
------------------------------------------------------------------------
------------------------------------------------------------------------
r18924 | marco | 2011-08-31 21:33:20 +0200 (Wed, 31 Aug 2011) | 2 lines
Changed paths:
M /trunk/utils/fpdoc/dglobals.pp
M /trunk/utils/fpdoc/fpdoc.pp
M /trunk/utils/fpdoc/fpdocproj.pas
M /trunk/utils/fpdoc/fpdocxmlopts.pas

* --dont-trim avoids trimming while loading XMLs. Mantis #16683

------------------------------------------------------------------------
------------------------------------------------------------------------
r18932 | marco | 2011-09-01 10:40:51 +0200 (Thu, 01 Sep 2011) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/defines.inc

* paper size constants updated, patch by G. Fink, Mantis #20120

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

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

marco vor 14 Jahren
Ursprung
Commit
7bfb72df48

+ 1 - 0
.gitattributes

@@ -11496,6 +11496,7 @@ tests/webtbs/tw15467.pp svneol=native#text/pascal
 tests/webtbs/tw15500.pp svneol=native#text/plain
 tests/webtbs/tw15504.pp svneol=native#text/plain
 tests/webtbs/tw15530.pp svneol=native#text/pascal
+tests/webtbs/tw15571.pp svneol=native#text/pascal
 tests/webtbs/tw15591.pp svneol=native#text/pascal
 tests/webtbs/tw15592.pp svneol=native#text/plain
 tests/webtbs/tw15599.pp svneol=native#text/plain

+ 1 - 1
packages/fcl-base/src/win/fileinfo.pp

@@ -226,7 +226,7 @@ begin
   s:=LowerCase(inp);
   I:=0;
   Result:='';
-  While (Result='') and (i<FmyVersionCategories.Count -1) do
+  While (Result='') and (i<FmyVersionCategories.Count) do
     begin
     V:=FmyVersionCategories[i];
     if (V=S) and ((transid=0) or (transid=dword(pointer(FmyVersionCategories.Objects[i])))) then

+ 26 - 0
rtl/i386/cpu.pp

@@ -25,6 +25,8 @@ unit cpu;
     { returns the contents of the cr0 register }
     function cr0 : longint;
 
+    var
+      is_sse3_cpu : boolean = false;
 
   implementation
 
@@ -72,4 +74,28 @@ unit cpu;
          floating_point_emulation:=(cr0 and $4)<>0;
       end;
 
+
+{$ASMMODE ATT}
+    function sse3_support : boolean;
+      var
+         _ecx : longint;
+      begin
+         if cpuid_support then
+           begin
+              asm
+                 pushl %ebx
+                 movl $1,%eax
+                 cpuid
+                 movl %ecx,_ecx
+                 popl %ebx
+              end;
+              sse3_support:=(_ecx and $1)<>0;
+           end
+         else
+           { a cpu with without cpuid instruction supports never sse3 }
+           sse3_support:=false;
+      end;
+
+begin
+  is_sse3_cpu:=sse3_support;
 end.

+ 2 - 4
rtl/i386/mmx.pp

@@ -199,10 +199,8 @@ unit mmx;
       end;
 
     function sse2_support : boolean;
-
       var
          _edx : longint;
-
       begin
          if cpuid_support then
            begin
@@ -220,14 +218,14 @@ unit mmx;
            sse2_support:=false;
       end;
 
-    procedure emms;assembler;
 
+    procedure emms;assembler;
       asm
          emms
       end;
 
-    procedure femms;assembler;
 
+    procedure femms;assembler;
       asm
         { femms instruction not supported with older as versions }
         .byte 0x0f, 0x0e

+ 4 - 4
rtl/inc/cmem.pp

@@ -48,10 +48,10 @@ Procedure free (P : pointer); cdecl; external;
 function realloc (P : Pointer; Size : ptruint) : pointer;cdecl; external;
 Function calloc (unitSize,UnitCount : ptruint) : pointer;cdecl; external;
 {$else not USE_STATIC_LIBC}
-Function Malloc (Size : ptruint) : Pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'malloc';
-Procedure Free (P : pointer); {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'free';
-function ReAlloc (P : Pointer; Size : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'realloc';
-Function CAlloc (unitSize,UnitCount : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'calloc';
+Function Malloc (Size : ptruint) : Pointer; cdecl; external LibName name 'malloc';
+Procedure Free (P : pointer); cdecl; external LibName name 'free';
+function ReAlloc (P : Pointer; Size : ptruint) : pointer; cdecl; external LibName name 'realloc';
+Function CAlloc (unitSize,UnitCount : ptruint) : pointer; cdecl; external LibName name 'calloc';
 {$endif not USE_STATIC_LIBC}
 
 implementation

+ 27 - 13
rtl/inc/dynlibs.pas

@@ -67,21 +67,35 @@ begin
 end;
 
 Function SafeLoadLibrary(const Name : AnsiString) : TLibHandle;
-
-{$ifdef i386}
- var w : word;
+{$if defined(cpui386) or defined(cpux86_64)}
+  var
+    fpucw : Word;
+    ssecw : DWord;
 {$endif}
-
-
-Begin
-{$ifdef i386}
-  w:=get8087cw;
+  begin
+    try
+{$if defined(cpui386) or defined(cpux86_64)}
+      fpucw:=Get8087CW;
+{$ifdef cpui386}
+      if has_sse_support then
+{$endif cpui386}
+        ssecw:=GetSSECSR;
 {$endif}
- result:=loadlibrary(name);
-
-{$ifdef i386}
-  set8087cw(w);
+{$if defined(windows) or defined(win32)}
+      Result:=LoadLibraryA(PChar(Name));
+{$else}
+      Result:=loadlibrary(Name);
+{$endif}
+      finally
+{$if defined(cpui386) or defined(cpux86_64)}
+      Set8087CW(fpucw);
+{$ifdef cpui386}
+      if has_sse_support then
+{$endif cpui386}
+        SetSSECSR(ssecw);
 {$endif}
-End;
+    end;
+  end;
+
 
 end.

+ 1 - 1
rtl/objpas/types.pp

@@ -386,7 +386,7 @@ begin
   if R2.Bottom>R1.Bottom then
     lRect.Bottom:=R2.Bottom;
 
-  if IsRectEmpty(Rect) then
+  if IsRectEmpty(lRect) then
   begin
     FillChar(Rect,SizeOf(Rect),0);
     UnionRect:=false;

+ 120 - 42
rtl/win/wininc/defines.inc

@@ -3354,49 +3354,127 @@ Type
      DM_ICMINTENT = $1000000;
      DM_MEDIATYPE = $2000000;
      DM_DITHERTYPE = $4000000;
-     DMORIENT_LANDSCAPE = 2;
      DMORIENT_PORTRAIT = 1;
-     DMPAPER_LETTER = 1;
-     DMPAPER_LEGAL = 5;
-     DMPAPER_A4 = 9;
-     DMPAPER_CSHEET = 24;
-     DMPAPER_DSHEET = 25;
-     DMPAPER_ESHEET = 26;
-     DMPAPER_LETTERSMALL = 2;
-     DMPAPER_TABLOID = 3;
-     DMPAPER_LEDGER = 4;
-     DMPAPER_STATEMENT = 6;
-     DMPAPER_EXECUTIVE = 7;
-     DMPAPER_A3 = 8;
-     DMPAPER_A4SMALL = 10;
-     DMPAPER_A5 = 11;
-     DMPAPER_B4 = 12;
-     DMPAPER_B5 = 13;
-     DMPAPER_FOLIO = 14;
-     DMPAPER_QUARTO = 15;
-     DMPAPER_10X14 = 16;
-     DMPAPER_11X17 = 17;
-     DMPAPER_NOTE = 18;
-     DMPAPER_ENV_9 = 19;
-     DMPAPER_ENV_10 = 20;
-     DMPAPER_ENV_11 = 21;
-     DMPAPER_ENV_12 = 22;
-     DMPAPER_ENV_14 = 23;
-     DMPAPER_ENV_DL = 27;
-     DMPAPER_ENV_C5 = 28;
-     DMPAPER_ENV_C3 = 29;
-     DMPAPER_ENV_C4 = 30;
-     DMPAPER_ENV_C6 = 31;
-     DMPAPER_ENV_C65 = 32;
-     DMPAPER_ENV_B4 = 33;
-     DMPAPER_ENV_B5 = 34;
-     DMPAPER_ENV_B6 = 35;
-     DMPAPER_ENV_ITALY = 36;
-     DMPAPER_ENV_MONARCH = 37;
-     DMPAPER_ENV_PERSONAL = 38;
-     DMPAPER_FANFOLD_US = 39;
-     DMPAPER_FANFOLD_STD_GERMAN = 40;
-     DMPAPER_FANFOLD_LGL_GERMAN = 41;
+     DMORIENT_LANDSCAPE = 2;
+     DMPAPER_LETTER                        = 1  ; // US Letter 8 1/2 x 11 in
+     DMPAPER_LETTERSMALL                   = 2  ; // US Letter Small 8 1/2 x 11 in
+     DMPAPER_TABLOID                       = 3  ; // US Tabloid 11 x 17 in
+     DMPAPER_LEDGER                        = 4  ; // US Ledger 17 x 11 in
+     DMPAPER_LEGAL                         = 5  ; // US Legal 8 1/2 x 14 in
+     DMPAPER_STATEMENT                     = 6  ; // US Statement 5 1/2 x 8 1/2 in
+     DMPAPER_EXECUTIVE                     = 7  ; // US Executive 7 1/4 x 10 1/2 in
+     DMPAPER_A3                            = 8  ; // A3 297 x 420 mm
+     DMPAPER_A4                            = 9  ; // A4 210 x 297 mm
+     DMPAPER_A4SMALL                       = 10 ; // A4 Small 210 x 297 mm
+     DMPAPER_A5                            = 11 ; // A5 148 x 210 mm
+     DMPAPER_B4                            = 12 ; // B4 (JIS) 257 x 364 mm
+     DMPAPER_B5                            = 13 ; // B5 (JIS) 182 x 257 mm
+     DMPAPER_FOLIO                         = 14 ; // Folio 8 1/2 x 13 in
+     DMPAPER_QUARTO                        = 15 ; // Quarto 215 x 275 mm
+     DMPAPER_10X14                         = 16 ; // 10 x 14 in
+     DMPAPER_11X17                         = 17 ; // 11 x 17 in
+     DMPAPER_NOTE                          = 18 ; // US Note 8 1/2 x 11 in
+     DMPAPER_ENV_9                         = 19 ; // US Envelope #9 3 7/8 x 8 7/8
+     DMPAPER_ENV_10                        = 20 ; // US Envelope #10 4 1/8 x 9 1/2
+     DMPAPER_ENV_11                        = 21 ; // US Envelope #11 4 1/2 x 10 3/8
+     DMPAPER_ENV_12                        = 22 ; // US Envelope #12 4 3/4 x 11 in
+     DMPAPER_ENV_14                        = 23 ; // US Envelope #14 5 x 11 1/2
+     DMPAPER_CSHEET                        = 24 ; // C size sheet
+     DMPAPER_DSHEET                        = 25 ; // D size sheet
+     DMPAPER_ESHEET                        = 26 ; // E size sheet
+     DMPAPER_ENV_DL                        = 27 ; // Envelope DL 110 x 220mm
+     DMPAPER_ENV_C5                        = 28 ; // Envelope C5 162 x 229 mm
+     DMPAPER_ENV_C3                        = 29 ; // Envelope C3 324 x 458 mm
+     DMPAPER_ENV_C4                        = 30 ; // Envelope C4 229 x 324 mm
+     DMPAPER_ENV_C6                        = 31 ; // Envelope C6 114 x 162 mm
+     DMPAPER_ENV_C65                       = 32 ; // Envelope C65 114 x 229 mm
+     DMPAPER_ENV_B4                        = 33 ; // Envelope B4 250 x 353 mm
+     DMPAPER_ENV_B5                        = 34 ; // Envelope B5 176 x 250 mm
+     DMPAPER_ENV_B6                        = 35 ; // Envelope B6 176 x 125 mm
+     DMPAPER_ENV_ITALY                     = 36 ; // Envelope 110 x 230 mm
+     DMPAPER_ENV_MONARCH                   = 37 ; // US Envelope Monarch 3.875 x 7.5 in
+     DMPAPER_ENV_PERSONAL                  = 38 ; // 6 3/4 US Envelope 3 5/8 x 6 1/2 in
+     DMPAPER_FANFOLD_US                    = 39 ; // US Std Fanfold 14 7/8 x 11 in
+     DMPAPER_FANFOLD_STD_GERMAN            = 40 ; // German Std Fanfold 8 1/2 x 12 in
+     DMPAPER_FANFOLD_LGL_GERMAN            = 41 ; // German Legal Fanfold 8 1/2 x 13 in
+     DMPAPER_ISO_B4                        = 42 ; // B4 (ISO) 250 x 353 mm
+     DMPAPER_JAPANESE_POSTCARD             = 43 ; // Japanese Postcard 100 x 148 mm
+     DMPAPER_9X11                          = 44 ; // 9 x 11 in
+     DMPAPER_10X11                         = 45 ; // 10 x 11 in
+     DMPAPER_15X11                         = 46 ; // 15 x 11 in
+     DMPAPER_ENV_INVITE                    = 47 ; // Envelope Invite 220 x 220 mm
+     DMPAPER_RESERVED_48                   = 48 ; // RESERVED--DO NOT USE
+     DMPAPER_RESERVED_49                   = 49 ; // RESERVED--DO NOT USE
+     DMPAPER_LETTER_EXTRA                  = 50 ; // US Letter Extra 9 1/2 x 12 in
+     DMPAPER_LEGAL_EXTRA                   = 51 ; // US Legal Extra 9 1/2 x 15 in
+     DMPAPER_TABLOID_EXTRA                 = 52 ; // US Tabloid Extra 11.69 x 18 in
+     DMPAPER_A4_EXTRA                      = 53 ; // A4 Extra 9.27 x 12.69 in
+     DMPAPER_LETTER_TRANSVERSE             = 54 ; // Letter Transverse 8 1/2 x 11 in
+     DMPAPER_A4_TRANSVERSE                 = 55 ; // A4 Transverse 210 x 297 mm
+     DMPAPER_LETTER_EXTRA_TRANSVERSE       = 56 ; // Letter Extra Transverse 9 1/2 x 12 in
+     DMPAPER_A_PLUS                        = 57 ; // SuperA/SuperA/A4 227 x 356 mm
+     DMPAPER_B_PLUS                        = 58 ; // SuperB/SuperB/A3 305 x 487 mm
+     DMPAPER_LETTER_PLUS                   = 59 ; // US Letter Plus 8.5 x 12.69 in
+     DMPAPER_A4_PLUS                       = 60 ; // A4 Plus 210 x 330 mm
+     DMPAPER_A5_TRANSVERSE                 = 61 ; // A5 Transverse 148 x 210 mm
+     DMPAPER_B5_TRANSVERSE                 = 62 ; // B5 (JIS) Transverse 182 x 257 mm
+     DMPAPER_A3_EXTRA                      = 63 ; // A3 Extra 322 x 445 mm
+     DMPAPER_A5_EXTRA                      = 64 ; // A5 Extra 174 x 235 mm
+     DMPAPER_B5_EXTRA                      = 65 ; // B5 (ISO) Extra 201 x 276 mm
+     DMPAPER_A2                            = 66 ; // A2 420 x 594 mm
+     DMPAPER_A3_TRANSVERSE                 = 67 ; // A3 Transverse 297 x 420 mm
+     DMPAPER_A3_EXTRA_TRANSVERSE           = 68 ; // A3 Extra Transverse 322 x 445 mm
+     DMPAPER_DBL_JAPANESE_POSTCARD         = 69 ; // Japanese Double Postcard 200 x 148 mm
+     DMPAPER_A6                            = 70 ; // A6 105 x 148 mm
+     DMPAPER_JENV_KAKU2                    = 71 ; // Japanese Envelope Kaku #2
+     DMPAPER_JENV_KAKU3                    = 72 ; // Japanese Envelope Kaku #3
+     DMPAPER_JENV_CHOU3                    = 73 ; // Japanese Envelope Chou #3
+     DMPAPER_JENV_CHOU4                    = 74 ; // Japanese Envelope Chou #4
+     DMPAPER_LETTER_ROTATED                = 75 ; // Letter Rotated 11 x 8 1/2 11 in
+     DMPAPER_A3_ROTATED                    = 76 ; // A3 Rotated 420 x 297 mm
+     DMPAPER_A4_ROTATED                    = 77 ; // A4 Rotated 297 x 210 mm
+     DMPAPER_A5_ROTATED                    = 78 ; // A5 Rotated 210 x 148 mm
+     DMPAPER_B4_JIS_ROTATED                = 79 ; // B4 (JIS) Rotated 364 x 257 mm
+     DMPAPER_B5_JIS_ROTATED                = 80 ; // B5 (JIS) Rotated 257 x 182 mm
+     DMPAPER_JAPANESE_POSTCARD_ROTATED     = 81 ; // Japanese Postcard Rotated 148 x 100 mm
+     DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED = 82 ; // Double Japanese Postcard Rotated 148 x 200 mm
+     DMPAPER_A6_ROTATED                    = 83 ; // A6 Rotated 148 x 105 mm
+     DMPAPER_JENV_KAKU2_ROTATED            = 84 ; // Japanese Envelope Kaku #2 Rotated
+     DMPAPER_JENV_KAKU3_ROTATED            = 85 ; // Japanese Envelope Kaku #3 Rotated
+     DMPAPER_JENV_CHOU3_ROTATED            = 86 ; // Japanese Envelope Chou #3 Rotated
+     DMPAPER_JENV_CHOU4_ROTATED            = 87 ; // Japanese Envelope Chou #4 Rotated
+     DMPAPER_B6_JIS                        = 88 ; // B6 (JIS) 128 x 182 mm
+     DMPAPER_B6_JIS_ROTATED                = 89 ; // B6 (JIS) Rotated 182 x 128 mm
+     DMPAPER_12X11                         = 90 ; // 12 x 11 in
+     DMPAPER_JENV_YOU4                     = 91 ; // Japanese Envelope You #4
+     DMPAPER_JENV_YOU4_ROTATED             = 92 ; // Japanese Envelope You #4 Rotated
+     DMPAPER_P16K                          = 93 ; // PRC 16K 146 x 215 mm
+     DMPAPER_P32K                          = 94 ; // PRC 32K 97 x 151 mm
+     DMPAPER_P32KBIG                       = 95 ; // PRC 32K(Big) 97 x 151 mm
+     DMPAPER_PENV_1                        = 96 ; // PRC Envelope #1 102 x 165 mm
+     DMPAPER_PENV_2                        = 97 ; // PRC Envelope #2 102 x 176 mm
+     DMPAPER_PENV_3                        = 98 ; // PRC Envelope #3 125 x 176 mm
+     DMPAPER_PENV_4                        = 99 ; // PRC Envelope #4 110 x 208 mm
+     DMPAPER_PENV_5                        = 100; // PRC Envelope #5 110 x 220 mm
+     DMPAPER_PENV_6                        = 101; // PRC Envelope #6 120 x 230 mm      {$IFDEF FPC}
+     DMPAPER_PENV_7                        = 102; // PRC Envelope #7 160 x 230 mm
+     DMPAPER_PENV_8                        = 103; // PRC Envelope #8 120 x 309 mm
+     DMPAPER_PENV_9                        = 104; // PRC Envelope #9 229 x 324 mm
+     DMPAPER_PENV_10                       = 105; // PRC Envelope #10 324 x 458 mm
+     DMPAPER_P16K_ROTATED                  = 106; // PRC 16K Rotated
+     DMPAPER_P32K_ROTATED                  = 107; // PRC 32K Rotated
+     DMPAPER_P32KBIG_ROTATED               = 108; // PRC 32K(Big) Rotated
+     DMPAPER_PENV_1_ROTATED                = 109; // PRC Envelope #1 Rotated 165 x 102 mm
+     DMPAPER_PENV_2_ROTATED                = 110; // PRC Envelope #2 Rotated 176 x 102 mm
+     DMPAPER_PENV_3_ROTATED                = 111; // PRC Envelope #3 Rotated 176 x 125 mm
+     DMPAPER_PENV_4_ROTATED                = 112; // PRC Envelope #4 Rotated 208 x 110 mm
+     DMPAPER_PENV_5_ROTATED                = 113; // PRC Envelope #5 Rotated 220 x 110 mm
+     DMPAPER_PENV_6_ROTATED                = 114; // PRC Envelope #6 Rotated 230 x 120 mm
+     DMPAPER_PENV_7_ROTATED                = 115; // PRC Envelope #7 Rotated 230 x 160 mm
+     DMPAPER_PENV_8_ROTATED                = 116; // PRC Envelope #8 Rotated 309 x 120 mm
+     DMPAPER_PENV_9_ROTATED                = 117; // PRC Envelope #9 Rotated 324 x 229 mm
+     DMPAPER_PENV_10_ROTATED               = 118; // PRC Envelope #10 Rotated 458 x 324 mm
+
      DMRES_HIGH = -(4);
      DMRES_MEDIUM = -(3);
      DMRES_LOW = -(2);

+ 1 - 1
rtl/win/wininc/func.inc

@@ -1011,7 +1011,7 @@ function DdeCallback(_para1, _para2:UINT; _para3:HCONV; _para4, _para5:HSZ;_para
 function DdeClientTransaction(_para1:PBYTE; _para2:DWORD; _para3:HCONV; _para4:HSZ; _para5:UINT;
            _para6:UINT; _para7:DWORD; _para8:PDWORD):HDDEDATA;external 'user32' name 'DdeClientTransaction';
 function DdeCmpStringHandles(_para1:HSZ; _para2:HSZ):longint; external 'user32' name 'DdeCmpStringHandles';
-function DdeConnect(_para1:DWORD; _para2:HSZ; _para3:HSZ; var _para4:CONVCONTEXT):HCONV; external 'user32' name 'DdeConnect';
+function DdeConnect(_para1:DWORD; _para2:HSZ; _para3:HSZ; _para4:PCONVCONTEXT):HCONV; external 'user32' name 'DdeConnect';
 function DdeConnectList(_para1:DWORD; _para2:HSZ; _para3:HSZ; _para4:HCONVLIST; _para5:PCONVCONTEXT):HCONVLIST;external 'user32' name 'DdeConnectList';
 function DdeCreateDataHandle(_para1:DWORD; _para2:LPBYTE; _para3:DWORD; _para4:DWORD; _para5:HSZ;_para6:UINT; _para7:UINT):HDDEDATA; external 'user32' name 'DdeCreateDataHandle';
 function DdeDisconnect(_para1:HCONV):WINBOOL; external 'user32' name 'DdeDisconnect';

+ 1 - 0
rtl/win/wininc/redef.inc

@@ -368,6 +368,7 @@ function CreateRemoteThread(hProcess: THandle; lpThreadAttributes: Pointer; dwSt
   external 'kernel32' name 'CreateRemoteThread';
 function CreateThread(lpThreadAttributes: Pointer; dwStackSize: DWORD; lpStartAddress: TFNThreadStartRoutine; lpParameter: Pointer; dwCreationFlags: DWORD; var lpThreadId: DWORD): THandle; external 'kernel32' name 'CreateThread';
 function DdeSetQualityOfService(hWndClient: HWnd; const pqosNew: TSecurityQualityOfService; pqosPrev: PSecurityQualityOfService): BOOL;external 'user32' name 'DdeSetQualityOfService';
+function DdeConnect(_para1:DWORD; _para2:HSZ; _para3:HSZ; var _para4:CONVCONTEXT):HCONV; external 'user32' name 'DdeConnect';
 //function DeleteAce(var pAcl: TACL; dwAceIndex: DWORD): BOOL; external 'advapi32' name 'DeleteAce';
 function DescribePixelFormat(DC: HDC; iPixelFormat: Integer; nBytes: UINT; var pfd: TPixelFormatDescriptor): BOOL; external 'gdi32' name 'DescribePixelFormat';
 //function DestroyPrivateObjectSecurity(var ObjectDescriptor: PSecurityDescriptor): BOOL; external 'advapi32' name 'DestroyPrivateObjectSecurity';

+ 8 - 4
rtl/x86_64/cpu.pp

@@ -22,7 +22,7 @@ unit cpu;
 			           // Unless overridebinutils is defined (for ports usage), use db instead of the instruction
      {$ifndef overridebinutils}
        {$define oldbinutils}
-     {$endif} 
+     {$endif}
   {$endif}
 
     uses
@@ -31,6 +31,9 @@ unit cpu;
     function InterlockedCompareExchange128Support : boolean;inline;
     function AESSupport : boolean;inline;
 
+    var
+      is_sse3_cpu : boolean = false;
+
     function InterlockedCompareExchange128(var Target: Int128Rec; NewValue: Int128Rec; Comperand: Int128Rec): Int128Rec;
 
   implementation
@@ -77,7 +80,7 @@ unit cpu;
         movq 8(%r9),%rdx
 
         {$ifdef oldbinutils}
-           .byte 0xF0,0x49,0x0F,0xC7,0x08 
+           .byte 0xF0,0x49,0x0F,0xC7,0x08
         {$else}
         lock cmpxchg16b (%r8)
         {$endif}
@@ -115,6 +118,7 @@ unit cpu;
       end;
     {$endif win64}
 
+
     procedure SetupSupport;
       var
         _ecx : longint;
@@ -127,10 +131,10 @@ unit cpu;
            popq %rbx
         end;
         _InterlockedCompareExchange128Support:=(_ecx and $2000)<>0;
-        _AESSupport:=(_ecx and $2000000)<>0;        
+        _AESSupport:=(_ecx and $2000000)<>0;
+        is_sse3_cpu:=(_ecx and $1)<>0;
       end;
 
-
 begin
   SetupSupport;
 end.

+ 5 - 0
tests/webtbs/tw15571.pp

@@ -0,0 +1,5 @@
+uses cmem, sysutils;
+begin
+ inttostr(1234);
+ malloc(1000); //crashes here
+end.

+ 35 - 4
utils/fpdoc/dglobals.pp

@@ -23,7 +23,7 @@ unit dGlobals;
 
 interface
 
-uses Classes, DOM, PasTree, PParser, StrUtils;
+uses Classes, DOM, PasTree, PParser, StrUtils,uriparser;
 
 Var
   LEOL : Integer;
@@ -149,6 +149,7 @@ resourcestring
   SUsageOption170  = '--warn-no-node    Warn if no documentation node was found.';
   SUsageOption180  = '--mo-dir=dir      Set directory where language files reside to dir';
   SUsageOption190  = '--parse-impl      (Experimental) try to parse implementation too';
+  SUsageOption200 =  '--dont-trim	Don''t trim XML contents';
   SUsageFormats        = 'The following output formats are supported by this fpdoc:';
   SUsageBackendHelp    = 'Specify an output format, combined with --help to get more help for this backend.';
   SUsageFormatSpecific = 'Output format "%s" supports the following options:';
@@ -300,7 +301,7 @@ type
     function FindLinkedNode(ANode: TDocNode): TDocNode;
 
     // Documentation file support
-    procedure AddDocFile(const AFilename: String);
+    procedure AddDocFile(const AFilename: String;DontTrim:boolean=false);
 
     // Documentation retrieval
     function FindDocNode(AElement: TPasElement): TDocNode;
@@ -1255,7 +1256,34 @@ begin
       end;
 end;
 
-procedure TFPDocEngine.AddDocFile(const AFilename: String);
+procedure ReadXMLFileALT(OUT ADoc:TXMLDocument;const AFileName:ansistring);
+var
+  Parser: TDOMParser;
+  Src: TXMLInputSource;
+  FileStream: TStream;
+begin
+  ADoc := nil;
+  FileStream := TFileStream.Create(AFilename, fmOpenRead+fmShareDenyWrite);
+  try
+    Parser := TDOMParser.Create; // create a parser object
+    try
+      Src := TXMLInputSource.Create(FileStream); // and the input source
+      src.SystemId:=FileNameToUri(AFileName);
+      try
+        Parser.Options.PreserveWhitespace := True;
+        Parser.Parse(Src, ADoc);
+      finally
+        Src.Free; // cleanup
+      end;
+    finally 
+     Parser.Free;
+     end;
+  finally
+    FileStream.Free;
+  end;
+end;
+
+procedure TFPDocEngine.AddDocFile(const AFilename: String;DontTrim:boolean=false);
 
   function ReadNode(OwnerDocNode: TDocNode; Element: TDOMElement): TDocNode;
   var
@@ -1318,7 +1346,10 @@ var
   PackageDocNode, TopicNode,ModuleDocNode: TDocNode;
 
 begin
-  ReadXMLFile(Doc, AFilename);
+  if DontTrim then
+    ReadXMLFileALT(Doc, AFilename)
+  else
+    ReadXMLFile(Doc, AFilename);
   DescrDocs.Add(Doc);
   DescrDocNames.Add(AFilename);
 

+ 4 - 1
utils/fpdoc/fpdoc.pp

@@ -87,6 +87,7 @@ begin
   Writeln(SUsageOption170);
   Writeln(SUsageOption180);
   Writeln(SUsageOption190);
+  Writeln(SUsageOption200);
   L:=TStringList.Create;
   Try
     Backend:=FProject.OPtions.Backend;
@@ -230,6 +231,8 @@ begin
     FProject.Options.ShowPrivate := False
   else if s = '--stop-on-parser-error' then
     FProject.Options.StopOnParseError := True
+  else if s = '--dont-trim' then
+    FProject.Options.donttrim := True
   else
     begin
     i := Pos('=', s);
@@ -316,7 +319,7 @@ begin
       Engine.ReadContentFile(Copy(Arg,1,i-1),Copy(Arg,i+1,Length(Arg)));
       end;
     for i := 0 to APackage.Descriptions.Count - 1 do
-      Engine.AddDocFile(APackage.Descriptions[i]);
+      Engine.AddDocFile(APackage.Descriptions[i],Options.donttrim);
     Engine.SetPackageName(APackage.Name);
     Engine.Output:=APackage.Output;
     Engine.HideProtected:=Options.HideProtected;

+ 2 - 0
utils/fpdoc/fpdocproj.pas

@@ -59,6 +59,7 @@ Type
     FOSTarget: String;
     FSOPE: Boolean;
     FWarnNoNode: Boolean;
+    FDontTrim : Boolean;
     procedure SetBackendOptions(const AValue: TStrings);
   Public
     Constructor Create;
@@ -77,6 +78,7 @@ Type
     Property InterfaceOnly : Boolean Read FIO Write FIO;
     Property MoDir : String Read FMoDir Write FMODir;
     Property DefaultPackageName : String Read FDefaultPackageName Write FDefaultPackageName;
+    Property DontTrim : Boolean Read FDontTrim Write FDontTrim;
   end;
 
   { TFPDocProject }

+ 3 - 2
utils/fpdoc/fpdocxmlopts.pas

@@ -156,12 +156,12 @@ procedure TXMLFPDocOptions.LoadEngineOptions(Options: TEngineOptions;
   end;
 
 Const
-  NCount = 10;
+  NCount = 11;
   ONames : Array[0..NCount] of string
          = ('hide-protected','warn-no-node','show-private',
             'stop-on-parser-error', 'ostarget','cputarget',
             'mo-dir','parse-impl','format', 'language',
-            'package');
+            'package','dont-trim');
 
 Var
   O : TDOMnode;
@@ -187,6 +187,7 @@ begin
         8 : Options.Backend:=V;
         9 : Options.Language:=v;
         10 : Options.DefaultPackageName:=V;
+        11 : Options.DontTrim:=TrueValue(V);
       else
         Options.BackendOptions.add('--'+n);
         Options.BackendOptions.add(v);