Explorar el Código

compiler: write a warning if unit should be compiled with built-in system codepage for ansistring constants but this codepage is not known by the compiler

git-svn-id: trunk@21269 -
paul hace 13 años
padre
commit
d79eee8ed1
Se han modificado 4 ficheros con 518 adiciones y 504 borrados
  1. 7 2
      compiler/msg/errore.msg
  2. 3 2
      compiler/msgidx.inc
  3. 504 499
      compiler/msgtxt.inc
  4. 4 1
      compiler/scanner.pas

+ 7 - 2
compiler/msg/errore.msg

@@ -136,7 +136,7 @@ general_f_oserror=01025_F_Operating system error: $1
 #
 # Scanner
 #
-# 02090 is the last used one
+# 02091 is the last used one
 #
 % \section{Scanner messages.}
 % This section lists the messages that the scanner emits. The scanner takes
@@ -381,6 +381,11 @@ scanner_f_illegal_utf8_bom=02089_F_It is not possible to include a file that sta
 scanner_w_directive_ignored_on_target=02090_W_Directive "$1" is ignored for the the current target platform
 % Some directives are ignored for certain targets, such as changing the
 % packrecords and packenum settings on managed platforms.
+scan_w_unavailable_system_codepage=02091_W_Current system codepage "$1" is not available for the compiler. Switching default codepage back to "$2".
+% The current system codepage is not known by the compiler.
+% The compiler is compiled with support for several codepages built-in.
+% The codepage of the operation system is not in that list. You will need to recompile
+% the compiler with support for this codepage.
 % \end{description}
 #
 # Parser
@@ -3041,7 +3046,7 @@ option_read_config_file=11034_D_Reading config file "$1"
 option_found_file=11035_D_found source file name "$1"
 % Additional information about options.
 % Displayed when you have the debug option turned on.
-option_code_page_not_available=11039_E_Unknown codepage
+option_code_page_not_available=11039_E_Unknown codepage "$1"
 % An unknown codepage for the source files was requested.
 % The compiler is compiled with support for several codepages built-in.
 % The requested codepage is not in that list. You will need to recompile

+ 3 - 2
compiler/msgidx.inc

@@ -112,6 +112,7 @@ const
   scanner_e_illegal_alignment_directive=02088;
   scanner_f_illegal_utf8_bom=02089;
   scanner_w_directive_ignored_on_target=02090;
+  scan_w_unavailable_system_codepage=02091;
   parser_e_syntax_error=03000;
   parser_e_dont_nest_interrupt=03004;
   parser_w_proc_directive_ignored=03005;
@@ -941,9 +942,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 65655;
+  MsgTxtSize = 65773;
 
   MsgIdxMax : array[1..20] of longint=(
-    26,91,322,118,87,55,116,26,202,63,
+    26,92,322,118,87,55,116,26,202,63,
     53,20,1,1,1,1,1,1,1,1
   );

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 504 - 499
compiler/msgtxt.inc


+ 4 - 1
compiler/scanner.pas

@@ -373,7 +373,10 @@ implementation
               begin
                 current_settings.sourcecodepage:=DefaultSystemCodePage;
                 if not cpavailable(current_settings.sourcecodepage) then
-                  current_settings.sourcecodepage:=default_settings.sourcecodepage;
+                  begin
+                    Message2(scan_w_unavailable_system_codepage,IntToStr(current_settings.sourcecodepage),IntToStr(default_settings.sourcecodepage));
+                    current_settings.sourcecodepage:=default_settings.sourcecodepage;
+                  end;
                 include(current_settings.moduleswitches,cs_explicit_codepage);
                 if changeinit then
                 begin

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio