Browse Source

--- Merging r14567 into '.':
U packages/libc/src/kerneldefs.pp
U packages/libc/src/libc.pp
U packages/libc/src/kernelioctl.pp
--- Merging r14570 into '.':
U rtl/win/sysutils.pp
--- Merging r14645 into '.':
U packages/winunits-base/src/activex.pp
--- Merging r14648 into '.':
U packages/fcl-xml/src/xmlwrite.pp

# revisions: 14567,14570,14645,14648
------------------------------------------------------------------------
r14567 | jonas | 2010-01-07 19:18:20 +0100 (Thu, 07 Jan 2010) | 5 lines
Changed paths:
M /trunk/packages/libc/src/kerneldefs.pp
M /trunk/packages/libc/src/kernelioctl.pp
M /trunk/packages/libc/src/libc.pp

* give a compiler error when attempting to compile these units for any
platform other than Linux/i386, so that people trying to manually
compile them will be informed about the fact that these units
will break in various ways on non-Linux/i386

------------------------------------------------------------------------
------------------------------------------------------------------------
r14570 | florian | 2010-01-07 21:06:24 +0100 (Thu, 07 Jan 2010) | 1 line
Changed paths:
M /trunk/rtl/win/sysutils.pp

* patch by taka_jp to set SysLocale.PriLangID on windows properly, resolves #14872
------------------------------------------------------------------------
------------------------------------------------------------------------
r14645 | marco | 2010-01-14 21:24:26 +0100 (Thu, 14 Jan 2010) | 2 lines
Changed paths:
M /trunk/packages/winunits-base/src/activex.pp

* Delphi compat overload releasestgmedium

------------------------------------------------------------------------
------------------------------------------------------------------------
r14648 | sergei | 2010-01-14 22:38:22 +0100 (Thu, 14 Jan 2010) | 2 lines
Changed paths:
M /trunk/packages/fcl-xml/src/xmlwrite.pp

* Fixed CDATA section splitting which got broken due to excessive optimization in r14194.

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

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

marco 15 years ago
parent
commit
63f33c658c

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

@@ -319,7 +319,7 @@ begin
   EndPos := 1;
   EndPos := 1;
   while EndPos <= Length(s) do
   while EndPos <= Length(s) do
   begin
   begin
-    if (s[EndPos] < 'A') and (Char(ord(s[EndPos])) in SpecialChars) then
+    if (s[EndPos] < #128) and (Char(ord(s[EndPos])) in SpecialChars) then
     begin
     begin
       wrtChars(@s[StartPos], EndPos - StartPos);
       wrtChars(@s[StartPos], EndPos - StartPos);
       SpecialCharCallback(Self, s, EndPos);
       SpecialCharCallback(Self, s, EndPos);

+ 5 - 0
packages/libc/src/kerneldefs.pp

@@ -1,5 +1,10 @@
 {$mode objfpc}
 {$mode objfpc}
 {$h+}
 {$h+}
+
+{$if not defined(linux) or not defined(cpui386)}
+  {$error The KernelDefs unit is a legacy Kylix-compatibility unit that is only supported on Linux/i386. It is known not to work in various ways on other OSes and architectures (including Linux/x86_64). }
+{$endif}
+
 unit kerneldefs;
 unit kerneldefs;
 
 
 interface
 interface

+ 4 - 0
packages/libc/src/kernelioctl.pp

@@ -1,6 +1,10 @@
 {$mode objfpc}
 {$mode objfpc}
 {$h+}
 {$h+}
 
 
+{$if not defined(linux) or not defined(cpui386)}
+  {$error The KernelIoctl unit is a legacy Kylix-compatibility unit that is only supported on Linux/i386. It is known not to work in various ways on other OSes and architectures (including Linux/x86_64). }
+{$endif}
+
 Unit kernelioctl;
 Unit kernelioctl;
 
 
 Interface
 Interface

+ 5 - 0
packages/libc/src/libc.pp

@@ -1,6 +1,11 @@
 {$mode objfpc}
 {$mode objfpc}
 {$inline on}
 {$inline on}
 {$h+}
 {$h+}
+
+{$if not defined(linux) or not defined(cpui386)}
+  {$error The KernelDefs unit is a legacy Kylix-compatibility unit that is only supported on Linux/i386. It is known not to work in various ways on other OSes and architectures (including Linux/x86_64). }
+{$endif}
+
 unit libc;
 unit libc;
 
 
 Interface
 Interface

+ 2 - 0
packages/winunits-base/src/activex.pp

@@ -3566,6 +3566,8 @@ type
   function OleDraw(pUnknown:IUnknown; dwAspect:DWORD; hdcDraw:HDC;const lprcBounds:TRect):WINOLEAPI;stdcall;external 'ole32.dll' name 'OleDraw';
   function OleDraw(pUnknown:IUnknown; dwAspect:DWORD; hdcDraw:HDC;const lprcBounds:TRect):WINOLEAPI;stdcall;external 'ole32.dll' name 'OleDraw';
   function OleRun(pUnknown:IUnknown):WINOLEAPI;stdcall;external 'ole32.dll' name 'OleRun';
   function OleRun(pUnknown:IUnknown):WINOLEAPI;stdcall;external 'ole32.dll' name 'OleRun';
   function OleIsRunning(pObject:IOleObject):BOOL;stdcall;external 'ole32.dll' name 'OleIsRunning';
   function OleIsRunning(pObject:IOleObject):BOOL;stdcall;external 'ole32.dll' name 'OleIsRunning';
+
+  procedure ReleaseStgMedium(var _para1:STGMEDIUM);stdcall;external 'ole32.dll' name 'ReleaseStgMedium';
   procedure ReleaseStgMedium(_para1:LPSTGMEDIUM);stdcall;external 'ole32.dll' name 'ReleaseStgMedium';
   procedure ReleaseStgMedium(_para1:LPSTGMEDIUM);stdcall;external 'ole32.dll' name 'ReleaseStgMedium';
   function CreateOleAdviseHolder(out ppOAHolder:IOleAdviseHolder):WINOLEAPI;stdcall;external 'ole32.dll' name 'CreateOleAdviseHolder';
   function CreateOleAdviseHolder(out ppOAHolder:IOleAdviseHolder):WINOLEAPI;stdcall;external 'ole32.dll' name 'CreateOleAdviseHolder';
 
 

+ 24 - 0
rtl/win/sysutils.pp

@@ -699,6 +699,8 @@ var
   { A call to GetSystemMetrics changes the value of the 8087 Control Word on
   { A call to GetSystemMetrics changes the value of the 8087 Control Word on
     Pentium4 with WinXP SP2 }
     Pentium4 with WinXP SP2 }
   old8087CW: word;
   old8087CW: word;
+  DefaultCustomLocaleID : LCID;   // typedef DWORD LCID;
+  DefaultCustomLanguageID : Word; // typedef WORD LANGID;
 begin
 begin
   InitInternationalGeneric;
   InitInternationalGeneric;
   old8087CW:=Get8087CW;
   old8087CW:=Get8087CW;
@@ -709,6 +711,28 @@ begin
   SysLocale.SubLangID := SUBLANG_ENGLISH_US;
   SysLocale.SubLangID := SUBLANG_ENGLISH_US;
   // probably needs update with getthreadlocale. post 2.0.2
   // probably needs update with getthreadlocale. post 2.0.2
 
 
+  DefaultCustomLocaleID := GetThreadLocale;
+  if DefaultCustomLocaleID <> 0 then
+    begin
+      { Locale Identifiers
+        +-------------+---------+-------------------------+
+        |   Reserved  | Sort ID |      Language ID        |
+        +-------------+---------+-------------------------+
+        31         20 19      16 15                       0   bit }
+      DefaultCustomLanguageID := DefaultCustomLocaleID and $FFFF; // 2^16
+      if DefaultCustomLanguageID <> 0 then
+        begin
+          SysLocale.DefaultLCID := DefaultCustomLocaleID;
+          { Language Identifiers
+            +-------------------------+-------------------------+
+            |     SubLanguage ID      |   Primary Language ID   |
+            +-------------------------+-------------------------+
+            15                      10  9                         0   bit  }
+          SysLocale.PriLangID := DefaultCustomLanguageID and $3ff; // 2^10
+          SysLocale.SubLangID := DefaultCustomLanguageID shr 10;
+        end;
+     end;
+
   Set8087CW(old8087CW);
   Set8087CW(old8087CW);
   GetFormatSettings;
   GetFormatSettings;
 end;
 end;