Browse Source

Add units required for wide strings support for go32v2 target

git-svn-id: trunk@38739 -
pierre 7 years ago
parent
commit
f9069b1ec6

+ 25 - 0
tests/test/tcpstr13.pp

@@ -2,13 +2,38 @@ program tcpstr13;
 
 // check that copy operation converts from 866 to DefaultSystemCodePage encoding
 
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 {$mode delphi}
 
 {$ifdef unix}
 uses
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif};
+{$else}
+uses
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+ { The unit strings is not really used here,
+   but simpifies the conditional construction
+   for fpwidestring and unicodeducet use }
+  strings;
 {$endif}
 
+
 type
   ts866 = type ansistring(866);
 

+ 25 - 0
tests/test/tcpstr17.pp

@@ -1,5 +1,15 @@
 // to have correct test result with delphi set codepage option to 65001
 program tcpstr17;
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
+
 {$ifdef FPC}
   {$mode delphi}
   {$codepage utf8}
@@ -9,6 +19,21 @@ program tcpstr17;
 {$ifdef unix}
 uses
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif};
+{$else}
+uses
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+ { The unit strings is not really used here,
+   but simpifies the conditional construction
+   for fpwidestring and unicodeducet use }
+  strings;
 {$endif}
 
 const

+ 23 - 1
tests/test/tcpstr19.pp

@@ -6,14 +6,36 @@ program tcpstr19;
 // this test can be only run with the compiler built right now on the
 // same system
 
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
+
 {$APPTYPE CONSOLE}
 {$ifdef fpc}
   {$MODE DELPHIUNICODE}
 {$endif}
 
 uses
-  {$ifdef unix} {$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$endif}
+{$ifdef unix}
+  {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
+{$endif}
+{$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+{$endif}
+{$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+{$endif}
+{$ifdef USE_CPALL_UNIT}
+  cpall,
+{$endif}
   SysUtils;
+
 var
   S: AnsiString;
   R: RawByteString;

+ 26 - 0
tests/test/tcpstr27.pp

@@ -1,8 +1,34 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
+
 {$ifdef unix}
 uses
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif};
+{$else}
+uses
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+ { The unit strings is not really used here,
+   but simpifies the conditional construction
+   for fpwidestring and unicodeducet use }
+  strings;
 {$endif}
 
+
 var
   data: array[0..3] of widechar;
 

+ 29 - 1
tests/test/tcpstr9.pp

@@ -1,8 +1,36 @@
 { %skiptarget=android }
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 program tcpstr9;
 {$mode delphiunicode}
 {$apptype console}
-{$ifdef unix} uses {$ifdef darwin}iosxwstr{$else}cwstring{$endif}; {$endif}
+{$ifdef unix}
+uses
+  {$ifdef darwin}iosxwstr{$else}cwstring{$endif};
+{$else}
+uses
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+ { The unit strings is not really used here,
+   but simpifies the conditional construction
+   for fpwidestring and unicodeducet use }
+  strings;
+{$endif}
+
 begin
   // this test can be only run with the compiler built right now on the
   // same system

+ 20 - 1
tests/test/tcpstransistr2shortstring.pp

@@ -1,8 +1,27 @@
 {$apptype console}
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
+
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
-{$endif unix}
+{$endif}
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
   sysutils;
   
 type  

+ 19 - 1
tests/test/tcpstransistr2widechararray.pp

@@ -1,7 +1,25 @@
-uses
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
+uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
   sysutils;
   
 type  

+ 25 - 0
tests/test/tcpstransistr2widechararray2.pp

@@ -4,10 +4,35 @@
   DefaultSystemCodePage before calling widestringmanager.ansi2widemoveproc
 }
 
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 {$ifdef unix}
 uses
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif};
+{$else}
+uses
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+ { The unit strings is not really used here,
+   but simpifies the conditional construction
+   for fpwidestring and unicodeducet use }
+  strings;
 {$endif}
+
 {$r+}
 var
   u8: ansistring;

+ 19 - 1
tests/test/tcpstransistrcompare.pp

@@ -1,8 +1,26 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
   
 type
   ts1253 = type AnsiString(1253);

+ 20 - 2
tests/test/tcpstransistrcompareequal.pp

@@ -1,9 +1,27 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
-  
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
+   
 type
   ts1253 = type AnsiString(1253);
   ts1251 = type AnsiString(1251);

+ 18 - 0
tests/test/tcpstransistrcopy.pp

@@ -1,7 +1,25 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
   sysutils;
   
 type  

+ 18 - 0
tests/test/tcpstrchar2ansistr.pp

@@ -1,7 +1,25 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
   sysutils;
   
 type  

+ 19 - 1
tests/test/tcpstrconcat.pp

@@ -1,9 +1,27 @@
 {$APPTYPE CONSOLE}
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
 
 type
   ts866 = type AnsiString(866);

+ 19 - 1
tests/test/tcpstrconcat2.pp

@@ -1,9 +1,27 @@
 {$APPTYPE CONSOLE}
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
 
 type
   ts866 = type AnsiString(866);

+ 19 - 1
tests/test/tcpstrconcat3.pp

@@ -1,9 +1,27 @@
 {$APPTYPE CONSOLE}
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
   
 const
 {$ifdef android}

+ 19 - 1
tests/test/tcpstrconcatmulti.pp

@@ -1,10 +1,28 @@
 {$APPTYPE CONSOLE}
 // test "fpc_AnsiStr_Concat_multi" with a same type(same encoding) 
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
   
 const
 {$ifdef android}

+ 19 - 1
tests/test/tcpstrconcatmulti2.pp

@@ -1,10 +1,28 @@
 {$APPTYPE CONSOLE}
 // test "fpc_AnsiStr_Concat_multi" with a differant types(encodings) 
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
 
 const
 {$ifdef android}

+ 18 - 0
tests/test/tcpstrpchar2ansistr.pp

@@ -1,7 +1,25 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
   sysutils;
   
 type  

+ 19 - 1
tests/test/tcpstrsetlength.pp

@@ -1,8 +1,26 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
 
 type
   ts866 = type AnsiString(866);

+ 19 - 1
tests/test/tcpstrsetlength2.pp

@@ -1,8 +1,26 @@
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
-  SysUtils;
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
+  sysutils;
 
 type
   ts866 = type AnsiString(866);

+ 18 - 0
tests/test/tcpstrshortstr2ansistr.pp

@@ -1,8 +1,26 @@
 {$mode objfpc} {$H+}
+{$ifdef go32v2}
+  {$define USE_INTERNAL_UNICODE}
+{$endif}
+
+{$ifdef USE_INTERNAL_UNICODE}
+  {$define USE_FPWIDESTRING_UNIT}
+  {$define USE_UNICODEDUCET_UNIT}
+  {$define USE_CPALL_UNIT}
+{$endif}
 uses
 {$ifdef unix}
   {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
 {$endif unix}
+ {$ifdef USE_FPWIDESTRING_UNIT}
+  fpwidestring,
+ {$endif}
+ {$ifdef USE_UNICODEDUCET_UNIT}
+  unicodeducet,
+ {$endif}
+ {$ifdef USE_CPALL_UNIT}
+  cpall,
+ {$endif}
   sysutils;
   
 type