Browse Source

* Added NoWideStringSupport runtime error

git-svn-id: trunk@10618 -
joost 17 years ago
parent
commit
1a4ee73146

+ 11 - 1
rtl/inc/wustrings.inc

@@ -1959,10 +1959,20 @@ function UCS4StringToWideString(const s : UCS4String) : WideString;
     setlength(result,resindex-1);
   end;
 
+const
+  SNoWidestrings = 'This binary has no widestrings support compiled in.';
+  SRecompileWithWidestrings = 'Recompile the application with a widestrings-manager in the program uses clause.';
 
 procedure unimplementedwidestring;
   begin
-    HandleErrorFrame(215,get_frame);
+{$ifdef FPC_HAS_FEATURE_CONSOLEIO}
+    If IsConsole then
+      begin
+      Writeln(StdErr,SNoWidestrings);
+      Writeln(StdErr,SRecompileWithWidestrings);
+      end;
+{$endif FPC_HAS_FEATURE_CONSOLEIO}
+    HandleErrorFrame(233,get_frame);
   end;
 
 {$warnings off}

+ 2 - 0
rtl/objpas/sysconst.pp

@@ -75,6 +75,7 @@ resourcestring
   SInvalidVarOpWithHResultWithPrefix = 'Invalid variant operation (%s%.8x)'+LineEnding+'%s';
   SNoError               = 'No error.';
   SNoThreadSupport       = 'Threads not supported. Recompile program with thread driver.';
+  SMissingWStringManager = 'Widestring manager not available. Recompile program with appropiate manager.';
   SOSError               = 'System error, (OS Code %d):'+LineEnding+'%s';
   SOutOfMemory           = 'Out of memory';
   SOverflow              = 'Floating point overflow';
@@ -211,6 +212,7 @@ begin
      230 : Result:=SSafecallException;
      231 : Result:=SExceptionStack;
      232 : Result:=SNoThreadSupport;
+     233 : Result:=SMissingWStringManager;
 
      255 : Result:=SFallbackError;
 

+ 1 - 0
rtl/objpas/sysutils/sysutilh.inc

@@ -159,6 +159,7 @@ type
 
    ESafecallException = class(Exception);
    ENoThreadSupport = Class(Exception);
+   ENoWideStringSupport = Class(Exception);
 
 
    { Exception handling routines }

+ 1 - 0
rtl/objpas/sysutils/sysutils.inc

@@ -312,6 +312,7 @@ begin
   229 : E:=ESafecallException.Create(SSafecallException);
   231 : E:=EConvertError.Create(SiconvError);
   232 : E:=ENoThreadSupport.Create(SNoThreadSupport);
+  233 : E:=ENoWideStringSupport.Create(SMissingWStringManager);
   else
    E:=Exception.CreateFmt (SUnKnownRunTimeError,[Errno]);
   end;