Use USE_INTERNAL_UNICODE to be able to test fpwidestrings on different targets

git-svn-id: trunk@38756 -
This commit is contained in:
pierre 2018-04-12 20:36:31 +00:00
parent bbc364b245
commit 95e609cc56
14 changed files with 234 additions and 125 deletions

View File

@ -3,19 +3,27 @@ program fpctest4;
{$mode delphi} {$mode delphi}
{$endif fpc} {$endif fpc}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef unix} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif} {$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
Classes,sysutils,variants,typinfo; Classes,sysutils,variants,typinfo;
type type

View File

@ -1,23 +1,28 @@
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef unix} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin} {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
iosxwstr, {$endif ndef USE_INTERNAL_UNICODE}
{$else} {$ifdef USE_FPWIDESTRING_UNIT}
cwstring,
{$endif}
{$endif}
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
Classes, SysUtils; Classes, SysUtils;

View File

@ -1,20 +1,35 @@
{$codepage cp866} {$codepage cp866}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif}
{$ifndef USE_INTERNAL_UNICODE}
{$ifdef unix}
uses
{$ifdef darwin}
iosxwstr
{$else}
cwstring
{$endif};
{$else def USE_INTERNAL_UNICODE}
uses uses
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet; unicodeducet,
{$endif} {$endif}
{$endif} {$ifdef USE_CPALL_UNIT}
{$ifdef unix} cpall,
uses {$endif}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}; strings;
{$endif} {$endif ndef USE_INTERNAL_UNICODE}
var var
s: ansistring; s: ansistring;
ws, ws3: widestring; ws, ws3: widestring;

View File

@ -8,20 +8,28 @@ program test;
{$endif} {$endif}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef unix} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif} {$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
Classes,SysUtils,uw13015; Classes,SysUtils,uw13015;
procedure writefile(const fn: string); procedure writefile(const fn: string);

View File

@ -1,20 +1,29 @@
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_FPWIDESTRING_UNIT} {$define USE_INTERNAL_UNICODE}
{$define USE_UNICODEDUCET_UNIT}
{$endif} {$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif}
uses uses
{$ifdef unix} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif} {$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
Classes, SysUtils; Classes, SysUtils;
function localUnicodeToUTF8(u: cardinal; Buf: PChar): integer; function localUnicodeToUTF8(u: cardinal; Buf: PChar): integer;

View File

@ -2,21 +2,29 @@ program comparetext;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif} {$ifdef FPC}{$mode objfpc}{$h+}{$endif}
{$ifdef mswindows}{$apptype console}{$endif} {$ifdef mswindows}{$apptype console}{$endif}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef USE_FPWIDESTRING_UNIT} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
sysutils {$ifdef USE_CPALL_UNIT}
{$ifdef unix} cpall,
,{$ifdef darwin}iosxwstr{$else}cwstring{$endif} {$endif}
{$endif} sysutils;
;
var var
int1: integer; int1: integer;
ustr1,ustr2: unicodestring; ustr1,ustr2: unicodestring;

View File

@ -2,23 +2,27 @@ program concatenate_resourestrings_delphiunicode;
{$mode delphiunicode} {$mode delphiunicode}
{$codepage cp1250} {$codepage cp1250}
{$ifdef go32v2} {$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
uses {$define USE_CPALL_UNIT}
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring,
{$endif}
{$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet;
{$endif} {$endif}
{$endif} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef unix}
uses uses
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}; {$ifdef darwin}iosxwstr{$else}cwstring{$endif};
{$endif} {$else USE_INTERNAL_UNICODE}a
uses
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring,
{$endif}
{$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet,
{$endif}
{$ifdef USE_CPALL_UNIT}
cpall;
{$endif}
{$endif def USE_FPWIDESTRING_UNIT}
resourcestring resourcestring
res2 = 'žlu<6C>ouèký ' + 'koníèek'; res2 = 'žlu<6C>ouèký ' + 'koníèek';

View File

@ -1,19 +1,28 @@
program TestStrIComp; program TestStrIComp;
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_FPWIDESTRING_UNIT} {$define USE_INTERNAL_UNICODE}
{$define USE_UNICODEDUCET_UNIT}
{$endif} {$endif}
uses {$ifdef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif}
uses
{$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef unix}{$ifdef darwin}iosxwstr{$else}cwstring{$endif},{$endif} {$ifdef USE_CPALL_UNIT}
SysUtils; cpall,
{$endif}
SysUtils;
var l: longint; var l: longint;
begin begin

View File

@ -2,17 +2,27 @@
{ Submitted by "Matthias Hryniszak" on 2005-02-26 } { Submitted by "Matthias Hryniszak" on 2005-02-26 }
{ e-mail: matthias@hryniszak.de } { e-mail: matthias@hryniszak.de }
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef unix}{$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$endif} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
SysUtils; SysUtils;
var var

View File

@ -1,21 +1,28 @@
program tw4080; program tw4080;
{$i+} {$i+}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_FPWIDESTRING_UNIT} {$define USE_INTERNAL_UNICODE}
{$define USE_UNICODEDUCET_UNIT}
uses
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring,
{$endif}
{$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet;
{$endif}
{$endif} {$endif}
{$ifdef unix} {$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif}
uses uses
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}; {$ifndef USE_INTERNAL_UNICODE}
{$endif unix} {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring,
{$endif}
{$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet,
{$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
strings;
var var
S, S2 : array [1..15] of char; S, S2 : array [1..15] of char;

View File

@ -2,26 +2,30 @@ program av;
{$ifdef FPC}{$mode objfpc}{$h+}{$INTERFACES CORBA}{$endif} {$ifdef FPC}{$mode objfpc}{$h+}{$INTERFACES CORBA}{$endif}
{$ifdef mswindows}{$apptype console}{$endif} {$ifdef mswindows}{$apptype console}{$endif}
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef FPC} {$ifdef unix}
{$ifdef unix}
cthreads, cthreads,
{$ifdef darwin} {$endif unix}
iosxwstr {$ifndef USE_INTERNAL_UNICODE}
{$else} {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
cwstring {$endif ndef USE_INTERNAL_UNICODE}
{$endif} {$ifdef USE_FPWIDESTRING_UNIT}
,{$endif} fpwidestring,
{$ifdef USE_FPWIDESTRING_UNIT} {$endif}
fpwidestring, {$ifdef USE_UNICODEDUCET_UNIT}
{$endif} unicodeducet,
{$ifdef USE_UNICODEDUCET_UNIT} {$endif}
unicodeducet, {$ifdef USE_CPALL_UNIT}
{$endif} cpall,
{$endif} {$endif}
sysutils; sysutils;
type type
testrecty = record testrecty = record

View File

@ -1,19 +1,25 @@
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
{$codepage utf8}
uses uses
{$ifdef unix} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif} {$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
sysutils; sysutils;
const const

View File

@ -1,19 +1,27 @@
{ %norun } { %norun }
{$ifdef go32v2} {$ifdef go32v2}
{$define use_fpwidestring_unit} {$define USE_INTERNAL_UNICODE}
{$define use_unicodeducet_unit} {$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef unix} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif} {$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
sysutils; sysutils;
{ just to make sure that no all wide->shortstring compile time conversions } { just to make sure that no all wide->shortstring compile time conversions }

View File

@ -1,17 +1,25 @@
{$ifdef go32v2} {$ifdef go32v2}
{$define USE_INTERNAL_UNICODE}
{$endif}
{$ifdef USE_INTERNAL_UNICODE}
{$define USE_FPWIDESTRING_UNIT} {$define USE_FPWIDESTRING_UNIT}
{$define USE_UNICODEDUCET_UNIT} {$define USE_UNICODEDUCET_UNIT}
{$define USE_CPALL_UNIT}
{$endif} {$endif}
uses uses
{$ifdef unix} {$ifndef USE_INTERNAL_UNICODE}
{$ifdef darwin}iosxwstr{$else}cwstring{$endif}, {$ifdef darwin}iosxwstr{$else}cwstring{$endif},
{$endif} {$endif ndef USE_INTERNAL_UNICODE}
{$ifdef USE_FPWIDESTRING_UNIT} {$ifdef USE_FPWIDESTRING_UNIT}
fpwidestring, fpwidestring,
{$endif} {$endif}
{$ifdef USE_UNICODEDUCET_UNIT} {$ifdef USE_UNICODEDUCET_UNIT}
unicodeducet, unicodeducet,
{$endif} {$endif}
{$ifdef USE_CPALL_UNIT}
cpall,
{$endif}
variants,sysutils; variants,sysutils;
var a:variant; var a:variant;
x,y: array of byte; x,y: array of byte;