浏览代码

Merged revisions 10330,10997,11003,11020,11040 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r10330 | florian | 2008-02-15 19:06:23 +0000 (Fri, 15 Feb 2008) | 2 lines

* set default reserved stack size on win32/win64 to 16MB

........
r10997 | florian | 2008-05-18 11:42:32 +0100 (Sun, 18 May 2008) | 2 lines

* don't override IDE switches at compiler startup

........
r11003 | florian | 2008-05-18 14:27:59 +0100 (Sun, 18 May 2008) | 1 line

* enable parsing of default properties when used with objects, resolves #10795
........
r11020 | florian | 2008-05-20 22:06:12 +0100 (Tue, 20 May 2008) | 2 lines

* more reasonable defaults when no dyn. linker is found, resolves #10431

........
r11040 | michael | 2008-05-22 19:12:10 +0100 (Thu, 22 May 2008) | 1 line

* Fixed 8076
........

git-svn-id: branches/fixes_2_2@11690 -

Jonas Maebe 17 年之前
父节点
当前提交
aace29526c
共有 9 个文件被更改,包括 82 次插入13 次删除
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/pexpr.pas
  3. 14 1
      compiler/symdef.pas
  4. 2 2
      compiler/systems/i_win.pas
  5. 11 2
      compiler/systems/t_linux.pas
  6. 12 1
      ide/fp.pas
  7. 2 2
      ide/fpswitch.pas
  8. 21 4
      rtl/unix/crt.pp
  9. 18 0
      tests/webtbs/tw10795.pp

+ 1 - 0
.gitattributes

@@ -8005,6 +8005,7 @@ tests/webtbs/tw1073.pp svneol=native#text/plain
 tests/webtbs/tw10757.pp svneol=native#text/plain
 tests/webtbs/tw10757.pp svneol=native#text/plain
 tests/webtbs/tw10790.pp svneol=native#text/plain
 tests/webtbs/tw10790.pp svneol=native#text/plain
 tests/webtbs/tw10791.pp svneol=native#text/plain
 tests/webtbs/tw10791.pp svneol=native#text/plain
+tests/webtbs/tw10795.pp svneol=native#text/plain
 tests/webtbs/tw10800.pp svneol=native#text/plain
 tests/webtbs/tw10800.pp svneol=native#text/plain
 tests/webtbs/tw1081.pp svneol=native#text/plain
 tests/webtbs/tw1081.pp svneol=native#text/plain
 tests/webtbs/tw10815.pp svneol=native#text/plain
 tests/webtbs/tw10815.pp svneol=native#text/plain

+ 1 - 1
compiler/pexpr.pas

@@ -1938,7 +1938,7 @@ implementation
 
 
                _LECKKLAMMER:
                _LECKKLAMMER:
                   begin
                   begin
-                    if is_class_or_interface(p1.resultdef) then
+                    if is_class_or_interface_or_object(p1.resultdef) then
                       begin
                       begin
                         { default property }
                         { default property }
                         protsym:=search_default_property(tobjectdef(p1.resultdef));
                         protsym:=search_default_property(tobjectdef(p1.resultdef));

+ 14 - 1
compiler/symdef.pas

@@ -669,6 +669,7 @@ interface
     function is_class(def: tdef): boolean;
     function is_class(def: tdef): boolean;
     function is_cppclass(def: tdef): boolean;
     function is_cppclass(def: tdef): boolean;
     function is_class_or_interface(def: tdef): boolean;
     function is_class_or_interface(def: tdef): boolean;
+    function is_class_or_interface_or_object(def: tdef): boolean;
     function is_class_or_interface_or_dispinterface(def: tdef): boolean;
     function is_class_or_interface_or_dispinterface(def: tdef): boolean;
 
 
 
 
@@ -4368,6 +4369,7 @@ implementation
           (tobjectdef(def).objecttype=odt_class);
           (tobjectdef(def).objecttype=odt_class);
       end;
       end;
 
 
+
     function is_object(def: tdef): boolean;
     function is_object(def: tdef): boolean;
       begin
       begin
         is_object:=
         is_object:=
@@ -4376,6 +4378,7 @@ implementation
           (tobjectdef(def).objecttype=odt_object);
           (tobjectdef(def).objecttype=odt_object);
       end;
       end;
 
 
+
     function is_cppclass(def: tdef): boolean;
     function is_cppclass(def: tdef): boolean;
       begin
       begin
         is_cppclass:=
         is_cppclass:=
@@ -4384,15 +4387,25 @@ implementation
           (tobjectdef(def).objecttype=odt_cppclass);
           (tobjectdef(def).objecttype=odt_cppclass);
       end;
       end;
 
 
+
     function is_class_or_interface(def: tdef): boolean;
     function is_class_or_interface(def: tdef): boolean;
       begin
       begin
-        is_class_or_interface:=
+        result:=
           assigned(def) and
           assigned(def) and
           (def.typ=objectdef) and
           (def.typ=objectdef) and
           (tobjectdef(def).objecttype in [odt_class,odt_interfacecom,odt_interfacecorba]);
           (tobjectdef(def).objecttype in [odt_class,odt_interfacecom,odt_interfacecorba]);
       end;
       end;
 
 
 
 
+    function is_class_or_interface_or_object(def: tdef): boolean;
+      begin
+        result:=
+          assigned(def) and
+          (def.typ=objectdef) and
+          (tobjectdef(def).objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_object]);
+      end;
+
+
     function is_class_or_interface_or_dispinterface(def: tdef): boolean;
     function is_class_or_interface_or_dispinterface(def: tdef): boolean;
       begin
       begin
         result:=
         result:=

+ 2 - 2
compiler/systems/i_win.pas

@@ -85,7 +85,7 @@ unit i_win;
                 maxCrecordalign : 16
                 maxCrecordalign : 16
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
-            stacksize    : 262144;
+            stacksize    : 16*1024*1024;
             abi          : abi_default;
             abi          : abi_default;
           );
           );
 
 
@@ -146,7 +146,7 @@ unit i_win;
                 maxCrecordalign : 16
                 maxCrecordalign : 16
               );
               );
             first_parm_offset : 16;
             first_parm_offset : 16;
-            stacksize    : 262144;
+            stacksize    : 16*1024*1024;
             abi          : abi_default;
             abi          : abi_default;
           );
           );
 
 

+ 11 - 2
compiler/systems/t_linux.pas

@@ -211,9 +211,18 @@ begin
        end
        end
      else
      else
        begin
        begin
-         { default is glibc 2.1+ compatible }
-         DynamicLinker:='/lib/ld-linux.so.2';
+         { when no dyn. linker is found, we are probably
+           cross compiling, so use the default dyn. linker }
+         DynamicLinker:=defdynlinker;
+         {
+           the default c startup script is gcrt0.as on all platforms
+           except i386
+         }
+{$ifdef i386}
          libctype:=glibc21;
          libctype:=glibc21;
+{$else i386}
+         libctype:=glibc2;
+{$endif i386}
        end;
        end;
    end;
    end;
 end;
 end;

+ 12 - 1
ide/fp.pas

@@ -76,7 +76,7 @@ uses
   FPTemplt,FPRedir,FPDesk,
   FPTemplt,FPRedir,FPDesk,
   FPCodTmp,FPCodCmp,
   FPCodTmp,FPCodCmp,
 
 
-  systems;
+  systems,globtype,globals;
 
 
 
 
 {$ifdef fpc}
 {$ifdef fpc}
@@ -326,6 +326,15 @@ begin
 {$ENDIF}
 {$ENDIF}
 end;
 end;
 
 
+
+procedure InitCompilerSwitches;
+  begin
+    default_settings.globalswitches:=[cs_check_unit_name];
+    default_settings.moduleswitches:=[cs_extsyntax,cs_implicit_exceptions];
+    default_settings.localswitches:=[cs_typed_const_writable];
+  end;
+
+
 {The square bullet needs an MS-DOS code page. On Unix it is for sure the code
 {The square bullet needs an MS-DOS code page. On Unix it is for sure the code
  page is not available before video is initialized. (And only in certain
  page is not available before video is initialized. (And only in certain
  circumstances after that, so, use a plain ascii character as bullet on Unix.)}
  circumstances after that, so, use a plain ascii character as bullet on Unix.)}
@@ -371,6 +380,8 @@ BEGIN
   if LocateFile(INIFileName)<>'' then
   if LocateFile(INIFileName)<>'' then
     writeln(bullet+' Using configuration files from: ',DirOf(LocateFile(INIFileName)));
     writeln(bullet+' Using configuration files from: ',DirOf(LocateFile(INIFileName)));
 
 
+  InitCompilerSwitches;
+
 {$ifdef VESA}
 {$ifdef VESA}
   InitVESAScreenModes;
   InitVESAScreenModes;
 {$endif}
 {$endif}

+ 2 - 2
ide/fpswitch.pas

@@ -1407,12 +1407,12 @@ begin
   for i:=low(TSwitchMode) to high(TSwitchMode) do
   for i:=low(TSwitchMode) to high(TSwitchMode) do
     begin
     begin
        SwitchesMode:=i;
        SwitchesMode:=i;
-{$ifdef i386}
+
        { default is Pentium }
        { default is Pentium }
        ProcessorOptimizationSwitches^.SetCurrSel(1);
        ProcessorOptimizationSwitches^.SetCurrSel(1);
        { AT&T reader }
        { AT&T reader }
        AsmReaderSwitches^.SetCurrSel(1);
        AsmReaderSwitches^.SetCurrSel(1);
-{$endif i386}
+
        { FPC mode}
        { FPC mode}
        CompilerModeSwitches^.SetCurrSel(0);
        CompilerModeSwitches^.SetCurrSel(0);
 (* Use platform defaults for memory switches. *)
 (* Use platform defaults for memory switches. *)

+ 21 - 4
rtl/unix/crt.pp

@@ -50,11 +50,21 @@ Const
 Var
 Var
   CurrX,CurrY : Byte;
   CurrX,CurrY : Byte;
   OutputRedir, InputRedir : boolean; { is the output/input being redirected (not a TTY) }
   OutputRedir, InputRedir : boolean; { is the output/input being redirected (not a TTY) }
-
+{$ifdef debugcrt}
+  DebugFile : Text;
+{$endif}   
 {*****************************************************************************
 {*****************************************************************************
                     Some Handy Functions Not in the System.PP
                     Some Handy Functions Not in the System.PP
 *****************************************************************************}
 *****************************************************************************}
 
 
+{$ifdef debugcrt}
+Procedure Debug(Msg : string);
+
+begin
+  Writeln(DebugFile,Msg);
+end;
+{$endif}
+
 Function Str(l:longint):string;
 Function Str(l:longint):string;
 {
 {
   Return a String of the longint
   Return a String of the longint
@@ -419,7 +429,7 @@ begin
   ttySendStr(s);
   ttySendStr(s);
 {Update MemCopy}
 {Update MemCopy}
   idx:=(CurrY-1)*ScreenWidth-1;
   idx:=(CurrY-1)*ScreenWidth-1;
-  for i:=1to length(s) do
+  for i:=1 to length(s) do
    if s[i]=#8 then
    if s[i]=#8 then
     begin
     begin
       if CurrX>1 then
       if CurrX>1 then
@@ -430,8 +440,8 @@ begin
       ConsoleBuf^[idx+CurrX].ch:=s[i];
       ConsoleBuf^[idx+CurrX].ch:=s[i];
       ConsoleBuf^[idx+CurrX].attr:=TextAttr;
       ConsoleBuf^[idx+CurrX].attr:=TextAttr;
       inc(CurrX);
       inc(CurrX);
-      if CurrX>ScreenWidth then
-       CurrX:=ScreenWidth;
+      If CurrX>ScreenWidth then
+        CurrX:=$FF; // Mark as invalid.
     end;
     end;
 end;
 end;
 
 
@@ -1575,6 +1585,10 @@ end;
 
 
 
 
 Initialization
 Initialization
+{$ifdef debugcrt}
+  Assign(DebugFile,'debug.txt');
+  ReWrite(DebugFile);
+{$endif}  
 { Redirect the standard output }
 { Redirect the standard output }
   assigncrt(Output);
   assigncrt(Output);
   Rewrite(Output);
   Rewrite(Output);
@@ -1619,6 +1633,9 @@ Initialization
     end;
     end;
 
 
 Finalization
 Finalization
+{$ifdef debugcrt}
+  Close(DebugFile);
+{$endif}  
   ttyFlushOutput;
   ttyFlushOutput;
   if not OutputRedir then
   if not OutputRedir then
     SetRawMode(False);
     SetRawMode(False);

+ 18 - 0
tests/webtbs/tw10795.pp

@@ -0,0 +1,18 @@
+{$mode objfpc}
+type
+  TObj = object
+    function GetItem(const i :Integer) :Integer;
+    property Items[i :Integer] :Integer read GetItem; default;
+  end;
+
+function TObj.GetItem(const i :Integer) :Integer;
+begin
+  Result := i;
+end;
+
+var
+  Obj :TObj;
+
+begin
+  WriteLn(Obj[0],' ',Obj[10]);
+end.