Browse Source

Remove most of the VER3_0 conditionals.

Rika Ichinose 11 tháng trước cách đây
mục cha
commit
d7352e7b66

+ 2 - 2
rtl/i386/cpuh.inc

@@ -44,10 +44,10 @@ function fpc_x86_get_fs:longint;[internproc:fpc_in_x86_get_fs];
 function fpc_x86_get_gs:longint;[internproc:fpc_in_x86_get_gs];
 
 { include automatically generated procs }
-{$if not defined(VER3_0) and not defined(VER3_2)}
+{$if not defined(VER3_2)}
 { do not active yet, they are not usable yet neither is the naming fixed }
 { $i cpummprocs.inc}
-{$endif not VER3_0 and not VER3_2}
+{$endif not VER3_2}
 
 type
   TNativeFPUControlWord = record

+ 2 - 2
rtl/i386/i386.inc

@@ -14,9 +14,9 @@
 
  **********************************************************************}
 
-{$if not(defined(VER3_0)) and defined(linux)}
+{$if defined(linux)}
   {$define FPC_SYSTEM_STACKALIGNMENT16}
-{$endif not(defined(VER3_0)) and defined(linux)}
+{$endif defined(linux)}
 
 {****************************************************************************
                                Primitives

+ 0 - 2
rtl/i386/int64p.inc

@@ -346,7 +346,6 @@
             pop %ebx
       end;
 
-{$ifndef VER3_0}
 {$define FPC_SYSTEM_HAS_MUL_QWORD}
     function fpc_mul_qword(f1,f2 : qword) : qword;[public,alias: 'FPC_MUL_QWORD']; compilerproc;
       begin
@@ -425,4 +424,3 @@
         addl %ecx,%edx
         jc  .Loverflowed
       end;
-{$endif VER3_0}

+ 0 - 46
rtl/i386/ports.inc

@@ -18,51 +18,6 @@
 
 { to give easy port access like tp with port[] }
 
-{$ifdef VER3_0}
-procedure tport.writeport(p : word;data : byte);assembler;stdcall;
-asm
-        movw    p,%dx
-        movb    data,%al
-        outb    %al,%dx
-end;
-
-
-function tport.readport(p : word) : byte;assembler;stdcall;
-asm
-        movw    p,%dx
-        inb     %dx,%al
-end;
-
-
-procedure tportw.writeport(p : word;data : word);assembler;stdcall;
-asm
-        movw    p,%dx
-        movw    data,%ax
-        outw    %ax,%dx
-end;
-
-
-function tportw.readport(p : word) : word;assembler;stdcall;
-asm
-        movw    p,%dx
-        inw     %dx,%ax
-end;
-
-
-procedure tportl.writeport(p : word;data : longint);assembler;stdcall;
-asm
-        movw    p,%dx
-        movl    data,%eax
-        outl    %eax,%dx
-end;
-
-
-function tportl.readport(p : word) : longint;assembler;stdcall;
-asm
-        movw    p,%dx
-        inl     %dx,%eax
-end;
-{$else VER3_0}
 procedure tport.writeport(p : word;data : byte);inline;
 begin
   fpc_x86_outportb(p,data);
@@ -97,4 +52,3 @@ function tportl.readport(p : word) : longint;inline;
 begin
   readport:=fpc_x86_inportl(p);
 end;
-{$endif VER3_0}

+ 1 - 20
rtl/i386/portsh.inc

@@ -15,25 +15,6 @@
  **********************************************************************}
 
 type
-{$ifdef VER3_0}
-   tport = object
-      procedure writeport(p : word;data : byte);stdcall;
-      function  readport(p : word) : byte;stdcall;
-      property pp[w : word] : byte read readport write writeport;default;
-   end;
-
-   tportw = object
-      procedure writeport(p : word;data : word);stdcall;
-      function  readport(p : word) : word;stdcall;
-      property pp[w : word] : word read readport write writeport;default;
-   end;
-
-   tportl = object
-      procedure writeport(p : word;data : longint);stdcall;
-      function  readport(p : word) : longint;stdcall;
-      property pp[w : word] : longint read readport write writeport;default;
-   end;
-{$else VER3_0}
    tport = object
    private
       procedure writeport(p : word;data : byte);inline;
@@ -57,7 +38,7 @@ type
    public
       property pp[w : word] : longint read readport write writeport;default;
    end;
-{$endif VER3_0}
+
 var
 { we don't need to initialize port, because neither member
   variables nor virtual methods are accessed }

+ 3 - 3
rtl/inc/astrings.inc

@@ -43,7 +43,7 @@ Type
   TAnsiRec = Record
     CodePage    : TSystemCodePage;
     ElementSize : Word;
-{$if not defined(VER3_0) and not defined(VER3_2)}
+{$if not defined(VER3_2)}
   {$ifdef CPU64}	
     Ref         : Longint;
   {$else}
@@ -1310,7 +1310,7 @@ begin
 end;
 {$endif CPU16 or CPU8}
 
-Procedure {$ifdef VER3_0}Delete{$else}fpc_ansistr_delete{$endif}(Var S : RawByteString; Index,Size: SizeInt);
+Procedure fpc_ansistr_delete(Var S : RawByteString; Index,Size: SizeInt);
 Var
   LS : SizeInt;
 begin
@@ -1329,7 +1329,7 @@ begin
 end;
 
 
-Procedure {$ifdef VER3_0}Insert{$else}fpc_ansistr_insert{$endif}(Const Source : RawByteString; Var S : RawByteString; Index : SizeInt);
+Procedure fpc_ansistr_insert(Const Source : RawByteString; Var S : RawByteString; Index : SizeInt);
 var
   LS,LSource : SizeInt;
 {$ifdef jvm}

+ 7 - 30
rtl/inc/compproc.inc

@@ -58,19 +58,17 @@ function fpc_pwidechar_length(p:pwidechar):sizeint; compilerproc;
 procedure fpc_chararray_to_shortstr(out res : shortstring;const arr: array of AnsiChar; zerobased: boolean = true); compilerproc;
 procedure fpc_shortstr_to_chararray(out res: array of AnsiChar; const src: ShortString); compilerproc;
 
-Function  fpc_shortstr_Copy(const s:shortstring;index:SizeInt;count:SizeInt):shortstring;compilerproc{$ifndef VER3_0}:fpc_in_copy_x{$endif VER3_0};
-function  fpc_char_copy(c:AnsiChar;index : SizeInt;count : SizeInt): shortstring;compilerproc{$ifndef VER3_0}:fpc_in_copy_x{$endif VER3_0};
-{$ifndef VER3_0}
+Function  fpc_shortstr_Copy(const s:shortstring;index:SizeInt;count:SizeInt):shortstring;compilerproc:fpc_in_copy_x;
+function  fpc_char_copy(c:AnsiChar;index : SizeInt;count : SizeInt): shortstring;compilerproc:fpc_in_copy_x;
 Procedure fpc_shortstr_delete(var s:shortstring;index:SizeInt;count:SizeInt); compilerproc:fpc_in_delete_x_y_z;
 Procedure fpc_shortstr_insert(const source:shortstring;var s:shortstring;index:SizeInt); compilerproc:fpc_in_insert_x_y_z;
 Procedure fpc_shortstr_insert_char(source:AnsiChar;var s:shortstring;index:SizeInt); compilerproc:fpc_in_insert_x_y_z;
-{$endif VER3_0}
 
 {$ifdef FPC_HAS_FEATURE_DYNARRAYS}
-{$if defined(VER3_0) or defined(VER3_2)}
+{$if defined(VER3_2)}
 function fpc_dynarray_copy(psrc : pointer;ti : pointer;
     lowidx,count:tdynarrayindex) : fpc_stub_dynarray;compilerproc;
-{$endif VER3_0 or VER3_2}
+{$endif VER3_2}
 function fpc_array_to_dynarray_copy(psrc : pointer;ti : pointer;
     lowidx,count,maxcount:tdynarrayindex;
     elesize : sizeint;
@@ -83,13 +81,11 @@ procedure fpc_dynarray_decr_ref(var p : pointer;ti : pointer); compilerproc;
 procedure fpc_dynarray_incr_ref(p : pointer); compilerproc;
 procedure fpc_dynarray_setlength(var p : pointer;pti : pointer; dimcount : sizeint;dims : pdynarrayindex); compilerproc;
 procedure fpc_dynarray_assign(var dest : pointer; src : pointer; ti: pointer); compilerproc;
-{$ifndef VER3_0}
 { no reference to the Delete()/Insert() intrinsic, due to typeinfo parameter }
 procedure fpc_dynarray_delete(var p : pointer;source,count : SizeInt;pti : pointer);compilerproc;
 procedure fpc_dynarray_insert(var p : pointer;source : SizeInt;data : pointer;count : SizeInt;pti : pointer);compilerproc;
 procedure fpc_dynarray_concat_multi(var dest : pointer; pti: pointer; const sarr:array of pointer); compilerproc;
 procedure fpc_dynarray_concat(var dest : pointer; pti: pointer; const src1,src2 : pointer); compilerproc;
-{$endif VER3_0}
 {$endif FPC_HAS_FEATURE_DYNARRAYS}
 
 { Str() support }
@@ -328,11 +324,9 @@ Procedure fpc_AnsiStr_RangeCheck(p : Pointer; index : SizeInt); compilerproc;
 Procedure fpc_AnsiStr_ZeroBased_RangeCheck(p : Pointer; index : SizeInt); compilerproc;
 
 Procedure fpc_AnsiStr_SetLength (Var S : RawByteString; l : SizeInt{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
-Function  fpc_ansistr_Copy (Const S : RawByteString; Index,Size : SizeInt): RawByteString;compilerproc{$ifndef VER3_0}:fpc_in_copy_x{$endif VER3_0};
-{$ifndef VER3_0}
+Function  fpc_ansistr_Copy (Const S : RawByteString; Index,Size : SizeInt): RawByteString;compilerproc:fpc_in_copy_x;
 Procedure fpc_ansistr_insert (const Source : RawByteString; var S : RawByteString; Index : SizeInt); compilerproc:fpc_in_insert_x_y_z; rtlproc;
 Procedure fpc_ansistr_delete (var S : RawByteString; Index,Size: SizeInt); compilerproc:fpc_in_delete_x_y_z; rtlproc;
-{$endif VER3_0}
 {$ifdef EXTRAANSISHORT}
 Function fpc_AnsiStr_ShortStr_Compare (Var S1 : Pointer; Var S2 : ShortString): SizeInt; compilerproc;
 {$endif EXTRAANSISHORT}
@@ -368,11 +362,9 @@ Procedure fpc_WideStr_RangeCheck(p: Pointer; index : SizeInt); compilerproc;
 Procedure fpc_WideStr_ZeroBased_RangeCheck(p: Pointer; index : SizeInt); compilerproc;
 
 Procedure fpc_WideStr_SetLength (Var S : WideString; l : SizeInt); compilerproc;
-Function  fpc_widestr_Copy (Const S : WideString; Index,Size : SizeInt) : WideString;compilerproc{$ifndef VER3_0}:fpc_in_copy_x{$endif VER3_0};
-{$ifndef VER3_0}
+Function  fpc_widestr_Copy (Const S : WideString; Index,Size : SizeInt) : WideString;compilerproc:fpc_in_copy_x;
 Procedure fpc_widestr_insert (Const Source : WideString; Var S : WideString; Index : SizeInt); compilerproc:fpc_in_insert_x_y_z;
 Procedure fpc_widestr_delete (Var S : WideString; Index,Size: SizeInt); compilerproc:fpc_in_delete_x_y_z;
-{$endif VER3_0}
 {$ifndef FPC_WINLIKEWIDESTRING}
 function fpc_widestr_Unique(Var S : Pointer): Pointer; compilerproc;
 {$endif FPC_WINLIKEWIDESTRING}
@@ -417,11 +409,9 @@ Procedure fpc_UnicodeStr_RangeCheck(p: Pointer; index : SizeInt); compilerproc;
 Procedure fpc_UnicodeStr_ZeroBased_RangeCheck(p: Pointer; index : SizeInt); compilerproc;
 
 Procedure fpc_UnicodeStr_SetLength (Var S : UnicodeString; l : SizeInt); compilerproc;
-Function  fpc_unicodestr_Copy (Const S : UnicodeString; Index,Size : SizeInt) : UnicodeString;compilerproc{$ifndef VER3_0}:fpc_in_copy_x{$endif VER3_0};
-{$ifndef VER3_0}
+Function  fpc_unicodestr_Copy (Const S : UnicodeString; Index,Size : SizeInt) : UnicodeString;compilerproc:fpc_in_copy_x;
 Procedure fpc_unicodestr_insert (Const Source : UnicodeString; Var S : UnicodeString; Index : SizeInt); compilerproc:fpc_in_insert_x_y_z;
 Procedure fpc_unicodestr_delete (Var S : UnicodeString; Index,Size: SizeInt); compilerproc:fpc_in_delete_x_y_z;
-{$endif VER3_0}
 function fpc_unicodestr_Unique(Var S : Pointer): Pointer; compilerproc;
 Function fpc_Char_To_UChar(const c : AnsiChar): UnicodeChar; compilerproc;
 Function fpc_UChar_To_Char(const c : UnicodeChar): AnsiChar; compilerproc;
@@ -608,13 +598,6 @@ function fpc_mod_shortint(n,z : shortint) : shortint; compilerproc;
 {$endif FPC_INCLUDE_SOFTWARE_MOD_DIV}
 
 {$ifdef FPC_INCLUDE_SOFTWARE_MUL}
-{$ifdef VER3_0}
-function fpc_mul_integer(f1,f2 : integer;checkoverflow : boolean) : integer; compilerproc;
-function fpc_mul_word(f1,f2 : word;checkoverflow : boolean) : word; compilerproc;
-function fpc_mul_longint(f1,f2 : longint;checkoverflow : boolean) : longint; compilerproc;
-function fpc_mul_dword(f1,f2 : dword;checkoverflow : boolean) : dword; compilerproc;
-{$else VER3_0}
-
 function fpc_mul_shortint(f1,f2 : shortint) : shortint; compilerproc;
 function fpc_mul_shortint_checkoverflow(f1,f2 : shortint) : shortint; compilerproc;
 function fpc_mul_byte(f1,f2 : byte) : byte; compilerproc;
@@ -627,7 +610,6 @@ function fpc_mul_longint(f1,f2 : longint) : longint; compilerproc;
 function fpc_mul_longint_checkoverflow(f1,f2 : longint) : longint; compilerproc;
 function fpc_mul_dword(f1,f2 : dword) : dword; compilerproc;
 function fpc_mul_dword_checkoverflow(f1,f2 : dword) : dword; compilerproc;
-{$endif VER3_0}
 {$endif FPC_INCLUDE_SOFTWARE_MUL}
 
 { from int64.inc }
@@ -635,15 +617,10 @@ function fpc_div_qword(n,z : qword) : qword; compilerproc;
 function fpc_mod_qword(n,z : qword) : qword; compilerproc;
 function fpc_div_int64(n,z : int64) : int64; compilerproc;
 function fpc_mod_int64(n,z : int64) : int64; compilerproc;
-{$ifdef VER3_0}
-function fpc_mul_qword(f1,f2 : qword;checkoverflow : longbool) : qword; compilerproc;
-function fpc_mul_int64(f1,f2 : int64;checkoverflow : longbool) : int64; compilerproc;
-{$else VER3_0}
 function fpc_mul_qword(f1,f2 : qword) : qword; compilerproc;
 function fpc_mul_qword_checkoverflow(f1,f2 : qword) : qword; compilerproc;
 function fpc_mul_int64(f1,f2 : int64) : int64; compilerproc;
 function fpc_mul_int64_checkoverflow(f1,f2 : int64) : int64; compilerproc;
-{$endif VER3_0}
 function fpc_mul_dword_to_qword(f1,f2 : dword) : qword; compilerproc;
 function fpc_mul_longint_to_int64(f1,f2 : longint) : int64; compilerproc;
 

+ 3 - 71
rtl/inc/dynarr.inc

@@ -35,15 +35,6 @@ type
    tdynarraytypedata =
 {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
    packed
-{$else}
-  {$ifdef powerpc64}
-    { 3.0.0 does not align elType field on a 8-byte boundary,
-      thus use packed also in this case }
-    {$ifdef VER3_0_0}
-      packed
-    {$endif VER3_0_0}
-  {$endif powerpc64}
-
 {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
    record
      {$if declared(TRttiDataCommon)}
@@ -52,17 +43,9 @@ type
      case TTypeKind of
        tkArray: (
          elSize : SizeUInt;
-         {$ifdef VER3_0}
-         elType2 : Pointer;
-         {$else}
          elType2 : PPointer;
-         {$endif}
          varType : Longint;
-         {$ifdef VER3_0}
-         elType : Pointer;
-         {$else}
          elType : PPointer;
-         {$endif}
        );
        { include for proper alignment }
        tkInt64: (
@@ -107,13 +90,9 @@ procedure fpc_dynarray_clear(var p : pointer;ti : pointer); [Public,Alias:'FPC_D
 
     if (realp^.refcount>0) and declocked(realp^.refcount) then
       begin
-{$ifdef VER3_0}
-        ti:=aligntoptr(ti+2+PByte(ti)[1]);
-{$else VER3_0}
         ti:=aligntoqword(ti+2+PByte(ti)[1]);
-{$endif VER3_0}
         if assigned(pdynarraytypedata(ti)^.elType) then
-          int_finalizearray(p,pdynarraytypedata(ti)^.elType{$ifndef VER3_0}^{$endif},realp^.high+1);
+          int_finalizearray(p,pdynarraytypedata(ti)^.elType^,realp^.high+1);
         freemem(realp);
       end;
     p:=nil;
@@ -183,27 +162,15 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
          end;
 
      { skip kind and name }
-{$ifdef VER3_0}
-     ti:=aligntoptr(Pointer(pti)+2+PByte(pti)[1]);
-{$else VER3_0}
      ti:=aligntoqword(Pointer(pti)+2+PByte(pti)[1]);
-{$endif VER3_0}
 
      elesize:=pdynarraytypedata(ti)^.elSize;
-     {$ifdef VER3_0}
-     eletype:=pdynarraytypedata(ti)^.elType2;
-     {$else}
      eletype:=pdynarraytypedata(ti)^.elType2^;
-     {$endif}
      { only set if type needs finalization }
-     {$ifdef VER3_0}
-     eletypemngd:=pdynarraytypedata(ti)^.elType;
-     {$else}
      if assigned(pdynarraytypedata(ti)^.elType) then
        eletypemngd:=pdynarraytypedata(ti)^.elType^
      else
        eletypemngd:=nil;
-     {$endif}
 
      { determine new memory size, throw a runtime error on overflow }
 {$push} {$q+,r+}
@@ -214,11 +181,9 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
      if not(assigned(p)) then
        begin
           newp:=AllocMem(size);
-{$ifndef VER3_0}
           { call int_InitializeArray for management operators }
           if assigned(eletypemngd) and (PTypeKind(eletype)^ in [tkRecord, tkObject]) then
             int_InitializeArray(pointer(newp)+sizeof(tdynarray), eletype, dims[0]);
-{$endif VER3_0}
        end
      else
        begin
@@ -239,10 +204,8 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
                if size-sizeof(tdynarray)>movsize then
                  begin
                    fillchar((pointer(newp)+sizeof(tdynarray)+movsize)^,size-sizeof(tdynarray)-movsize,0);
-{$ifndef VER3_0}
                    if assigned(eletypemngd) and (PTypeKind(eletype)^ in [tkRecord, tkObject]) then
                      int_InitializeArray(pointer(newp)+sizeof(tdynarray)+movsize, eletype, dims[0]-movelen);
-{$endif VER3_0}
                  end;
 
                { increment ref. count of managed members }
@@ -275,12 +238,10 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
                newp := realp;
                fillchar((pointer(newp)+sizeof(tdynarray)+elesize*(newp^.high+1))^,
                  (dims[0]-newp^.high-1)*elesize,0);
-{$ifndef VER3_0}
                { call int_InitializeArray for management operators }
                if assigned(eletypemngd) and (PTypeKind(eletype)^ in [tkRecord, tkObject]) then
                  int_InitializeArray(pointer(newp)+sizeof(tdynarray)+elesize*(newp^.high+1),
                    eletype, dims[0]-newp^.high-1);
-{$endif VER3_0}
             end;
        end;
     p:=pointer(newp)+sizeof(tdynarray);
@@ -304,7 +265,7 @@ function int_array_to_dynarray_copy(psrc : pointer;ti : pointer;
     ) : fpc_stub_dynarray;[external name 'FPC_ARR_TO_DYNARR_COPY'];
 
 
-{$if defined(VER3_0) or defined(VER3_2)}
+{$if defined(VER3_2)}
 function fpc_dynarray_copy(psrc : pointer;ti : pointer;
     lowidx,count:tdynarrayindex) : fpc_stub_dynarray;[Public,Alias:'FPC_DYNARR_COPY'];compilerproc;
   var
@@ -315,29 +276,19 @@ function fpc_dynarray_copy(psrc : pointer;ti : pointer;
      fpc_dynarray_clear(pointer(result),ti);
      if psrc=nil then
        exit;
-
      realpsrc:=pdynarray(psrc-sizeof(tdynarray));
 
-{$ifdef VER3_0}
-     tti:=aligntoptr(ti+2+PByte(ti)[1]);
-{$else VER3_0}
      tti:=aligntoqword(ti+2+PByte(ti)[1]);
-{$endif VER3_0}
-
      elesize:=pdynarraytypedata(tti)^.elSize;
-{$ifdef VER3_0}
-     eletype:=pdynarraytypedata(tti)^.elType;
-{$else VER3_0}
      { only set if type needs finalization }
      if assigned(pdynarraytypedata(tti)^.elType) then
        eletype:=pdynarraytypedata(tti)^.elType^
      else
        eletype:=nil;
-{$endif VER3_0}
 
      fpc_array_to_dynarray_copy(psrc,ti,lowidx,count,realpsrc^.high+1,elesize,eletype);
   end;
-{$endif VER3_0 or VER3_2}
+{$endif VER3_2}
 
 { copy a custom array (open/dynamic/static) to dynamic array }
 function fpc_array_to_dynarray_copy(psrc : pointer;ti : pointer;
@@ -388,7 +339,6 @@ function fpc_array_to_dynarray_copy(psrc : pointer;ti : pointer;
   end;
 
 
-{$ifndef VER3_0}
 procedure fpc_dynarray_delete(var p : pointer;source,count : SizeInt;pti : pointer);
    var
       newlen : tdynarrayindex;
@@ -713,8 +663,6 @@ procedure fpc_dynarray_concat(var dest : pointer; pti: pointer; const src1,src2
     newp^.high:=totallen-1;
     dest:=newp+1;
   end;
-{$endif VER3_0}
-
 
 procedure DynArraySetLength(var a: Pointer; typeInfo: Pointer; dimCnt: SizeInt; lengthVec: PSizeInt);
   external name 'FPC_DYNARR_SETLENGTH';
@@ -734,18 +682,10 @@ function DynArrayDim(typeInfo: Pointer): Integer;
     while (typeInfo <> nil) and (pdynarraytypeinfo(typeInfo)^.kind = tkDynArray) do
     begin
       { skip kind and name }
-{$ifdef VER3_0}
-      typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
-{$else VER3_0}
       typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
 
       { element type info}
-      {$ifdef VER3_0}
-      typeInfo:=pdynarraytypedata(typeInfo)^.elType2;
-      {$else VER3_0}
       typeInfo:=pdynarraytypedata(typeInfo)^.elType2^;
-      {$endif VER3_0}
 
       Inc(result);
     end;
@@ -795,20 +735,12 @@ function DynArrayIndex(a: Pointer; const indices: array of SizeInt; typeInfo: Po
     for i:=0 to h do
     begin
       { skip kind and name }
-{$ifdef VER3_0}
-      typeInfo:=aligntoptr(Pointer(typeInfo)+2+PByte(typeInfo)[1]);
-{$else VER3_0}
       typeInfo:=aligntoqword(Pointer(typeInfo)+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
       if i=h then
         break;
       a := PPointerArray(a)^[indices[i]];
       { element type info}
-      {$ifdef VER3_0}
-      typeInfo:=pdynarraytypedata(typeInfo)^.elType2;
-      {$else VER3_0}
       typeInfo:=pdynarraytypedata(typeInfo)^.elType2^;
-      {$endif VER3_0}
     end;
     result:=a+SizeUint(indices[h])*pdynarraytypedata(typeInfo)^.elSize;
   end;

+ 0 - 4
rtl/inc/dynarrh.inc

@@ -26,11 +26,7 @@ type
     namelen : byte;
     { here the chars follow, we've to skip them }
     elesize : sizeint;
-    {$ifdef VER3_0}
-    eletype : pdynarraytypeinfo;
-    {$else}
     eletype : ppdynarraytypeinfo;
-    {$endif}
     vartype : longint;
   end;
   

+ 1 - 177
rtl/inc/generic.inc

@@ -680,7 +680,7 @@ type
   pobjectvmt=^tobjectvmt;
   tobjectvmt=record
     size,msize:sizeuint;
-    parent:{$ifdef VER3_0}pointer{$else}ppointer{$endif};
+    parent:ppointer;
   end;
 
 {$ifndef FPC_SYSTEM_HAS_FPC_HELP_CONSTRUCTOR}
@@ -785,14 +785,10 @@ begin
      if vmt=expvmt then
        exit
      else
-       {$ifdef VER3_0}
-       vmt:=pobjectvmt(vmt)^.parent;
-       {$else VER3_0}
        if assigned(pobjectvmt(vmt)^.parent) then
          vmt:=pobjectvmt(vmt)^.parent^
        else
          vmt:=nil;
-       {$endif}
    HandleErrorAddrFrameInd(219,get_pc_addr,get_frame);
 end;
 {$endif not FPC_SYSTEM_HAS_FPC_CHECK_OBJECT_EXT}
@@ -1324,176 +1320,6 @@ end;
 ****************************************************************************}
 {$ifdef FPC_INCLUDE_SOFTWARE_MUL}
 
-{$ifdef VER3_0}
-
-{$ifndef FPC_SYSTEM_HAS_MUL_INTEGER}
-    function fpc_mul_integer(f1,f2 : integer;checkoverflow : boolean) : integer;[public,alias: 'FPC_MUL_INTEGER']; compilerproc;
-      var
-        sign : boolean;
-        q1,q2,q3 : word;
-      begin
-        { there's no difference between signed and unsigned multiplication,
-          when the destination size is equal to the source size and overflow
-          checking is off }
-        if not checkoverflow then
-          { word(f1)*word(f2) is coded as a call to mulword }
-          fpc_mul_integer:=integer(word(f1)*word(f2))
-        else
-          begin
-            sign:=false;
-            if f1<0 then
-              begin
-                sign:=not(sign);
-                q1:=word(-f1);
-              end
-            else
-              q1:=f1;
-            if f2<0 then
-              begin
-                sign:=not(sign);
-                q2:=word(-f2);
-              end
-            else
-              q2:=f2;
-            { the q1*q2 is coded as call to mulword }
-            q3:=q1*q2;
-
-            if (q1 <> 0) and (q2 <>0) and
-              ((q1>q3) or (q2>q3) or
-              { the bit 63 can be only set if we have $8000 }
-              { and sign is true                            }
-              (q3 shr 15<>0) and
-               ((q3<>word(word(1) shl 15)) or not(sign))
-              ) then
-              HandleErrorAddrFrameInd(215,get_pc_addr,get_frame);
-
-            if sign then
-              fpc_mul_integer:=-q3
-            else
-              fpc_mul_integer:=q3;
-          end;
-      end;
-{$endif FPC_SYSTEM_HAS_MUL_INTEGER}
-
-
-{$ifndef FPC_SYSTEM_HAS_MUL_WORD}
-    function fpc_mul_word(f1,f2 : word;checkoverflow : boolean) : word;[public,alias: 'FPC_MUL_WORD']; compilerproc;
-      var
-        _f1,bitpos : word;
-        f1overflowed : boolean;
-      begin
-        fpc_mul_word:=0;
-        bitpos:=1;
-        f1overflowed:=false;
-
-        while f1<>0 do
-          begin
-            if (f2 and bitpos)<>0 then
-              begin
-                _f1:=fpc_mul_word;
-                fpc_mul_word:=fpc_mul_word+f1;
-
-                { if one of the operands is greater than the result an
-                  overflow occurs                                      }
-                if checkoverflow and (f1overflowed or ((_f1<>0) and (f1<>0) and
-                  ((_f1>fpc_mul_word) or (f1>fpc_mul_word)))) then
-                  HandleErrorAddrFrameInd(215,get_pc_addr,get_frame);
-              end;
-            { when bootstrapping, we forget about overflow checking for qword :) }
-            f1overflowed:=f1overflowed or ((f1 and (1 shl 15))<>0);
-            f1:=f1 shl 1;
-            bitpos:=bitpos shl 1;
-          end;
-      end;
-{$endif FPC_SYSTEM_HAS_MUL_WORD}
-
-
-{$ifndef FPC_SYSTEM_HAS_MUL_LONGINT}
-    function fpc_mul_longint(f1,f2 : longint;checkoverflow : boolean) : longint;[public,alias: 'FPC_MUL_LONGINT']; compilerproc;
-      var
-        sign : boolean;
-        q1,q2,q3 : dword;
-      begin
-        { there's no difference between signed and unsigned multiplication,
-          when the destination size is equal to the source size and overflow
-          checking is off }
-        if not checkoverflow then
-          { dword(f1)*dword(f2) is coded as a call to muldword }
-          fpc_mul_longint:=longint(dword(f1)*dword(f2))
-        else
-          begin
-            sign:=false;
-            if f1<0 then
-              begin
-                sign:=not(sign);
-                q1:=dword(-f1);
-              end
-            else
-              q1:=f1;
-            if f2<0 then
-              begin
-                sign:=not(sign);
-                q2:=dword(-f2);
-              end
-            else
-              q2:=f2;
-            { the q1*q2 is coded as call to muldword }
-            q3:=q1*q2;
-
-            if (q1 <> 0) and (q2 <>0) and
-              ((q1>q3) or (q2>q3) or
-              { the bit 31 can be only set if we have $8000 0000 }
-              { and sign is true                                 }
-              (q3 shr 15<>0) and
-               ((q3<>dword(dword(1) shl 31)) or not(sign))
-              ) then
-              HandleErrorAddrFrameInd(215,get_pc_addr,get_frame);
-
-            if sign then
-              fpc_mul_longint:=-q3
-            else
-              fpc_mul_longint:=q3;
-          end;
-      end;
-{$endif FPC_SYSTEM_HAS_MUL_INTEGER}
-
-
-{$ifndef FPC_SYSTEM_HAS_MUL_DWORD}
-    { multiplies two dwords
-      the longbool for checkoverflow avoids a misaligned stack
-    }
-    function fpc_mul_dword(f1,f2 : dword;checkoverflow : boolean) : dword;[public,alias: 'FPC_MUL_DWORD']; compilerproc;
-      var
-        _f1,bitpos : dword;
-        f1overflowed : boolean;
-      begin
-        fpc_mul_dword:=0;
-        bitpos:=1;
-        f1overflowed:=false;
-
-        while f1<>0 do
-          begin
-            if (f2 and bitpos)<>0 then
-              begin
-                _f1:=fpc_mul_dword;
-                fpc_mul_dword:=fpc_mul_dword+f1;
-
-                { if one of the operands is greater than the result an
-                  overflow occurs                                      }
-                if checkoverflow and (f1overflowed or ((_f1<>0) and (f1<>0) and
-                  ((_f1>fpc_mul_dword) or (f1>fpc_mul_dword)))) then
-                  HandleErrorAddrFrameInd(215,get_pc_addr,get_frame);
-              end;
-            { when bootstrapping, we forget about overflow checking for qword :) }
-            f1overflowed:=f1overflowed or ((f1 and (dword(1) shl 31))<>0);
-            f1:=f1 shl 1;
-            bitpos:=bitpos shl 1;
-          end;
-      end;
-{$endif FPC_SYSTEM_HAS_MUL_DWORD}
-
-{$else VER3_0}
-
 {$ifndef FPC_SYSTEM_HAS_MUL_SHORTINT}
     function fpc_mul_shortint(f1,f2 : shortint) : shortint;[public,alias: 'FPC_MUL_SHORTINT']; compilerproc;
       begin
@@ -1821,8 +1647,6 @@ end;
       end;
 {$endif FPC_SYSTEM_HAS_MUL_DWORD}
 
-{$endif VER3_0}
-
 {$endif FPC_INCLUDE_SOFTWARE_MUL}
 
 {****************************************************************************

+ 0 - 101
rtl/inc/int64.inc

@@ -352,46 +352,6 @@
       end;
 {$endif FPC_SYSTEM_HAS_MOD_INT64}
 
-{$ifdef VER3_0}
-
-{$ifndef FPC_SYSTEM_HAS_MUL_QWORD}
-    { multiplies two qwords
-      the longbool for checkoverflow avoids a misaligned stack
-    }
-    function fpc_mul_qword(f1,f2 : qword;checkoverflow : longbool) : qword;[public,alias: 'FPC_MUL_QWORD']; compilerproc;
-
-      var
-         _f1,bitpos : qword;
-         l : longint;
-         f1overflowed : boolean;
-      begin
-        fpc_mul_qword:=0;
-        bitpos:=1;
-        f1overflowed:=false;
-
-        for l:=0 to 63 do
-          begin
-            if (f2 and bitpos)<>0 then
-              begin
-                _f1:=fpc_mul_qword;
-                fpc_mul_qword:=fpc_mul_qword+f1;
-
-                { if one of the operands is greater than the result an
-                  overflow occurs                                      }
-                if checkoverflow and (f1overflowed or ((_f1<>0) and (f1<>0) and
-                  ((_f1>fpc_mul_qword) or (f1>fpc_mul_qword)))) then
-                  HandleErrorAddrFrameInd(215,get_pc_addr,get_frame);
-              end;
-            { when bootstrapping, we forget about overflow checking for qword :) }
-            f1overflowed:=f1overflowed or ((f1 and (qword(1) shl 63))<>0);
-            f1:=f1 shl 1;
-            bitpos:=bitpos shl 1;
-          end;
-      end;
-{$endif FPC_SYSTEM_HAS_MUL_QWORD}
-
-{$else VER3_0}
-
 {$ifndef FPC_SYSTEM_HAS_MUL_QWORD}
     function fpc_mul_qword(f1,f2 : qword) : qword;[public,alias: 'FPC_MUL_QWORD']; compilerproc;
       var
@@ -440,8 +400,6 @@
       end;
 {$endif FPC_SYSTEM_HAS_MUL_QWORD}
 
-{$endif VER3_0}
-
 {$ifndef FPC_SYSTEM_HAS_MUL_DWORD_TO_QWORD}
     function fpc_mul_qword_compilerproc(f1,f2 : qword) : qword; external name 'FPC_MUL_QWORD';
 
@@ -452,63 +410,6 @@
 {$endif FPC_SYSTEM_HAS_MUL_DWORD_TO_QWORD}
 
 
-{$ifdef VER3_0}
-
-{$ifndef FPC_SYSTEM_HAS_MUL_INT64}
-    function fpc_mul_int64(f1,f2 : int64;checkoverflow : longbool) : int64;[public,alias: 'FPC_MUL_INT64']; compilerproc;
-      var
-         sign : boolean;
-         q1,q2,q3 : qword;
-      begin
-{$ifdef EXCLUDE_COMPLEX_PROCS}
-         runerror(219);
-{$else EXCLUDE_COMPLEX_PROCS}
-        { there's no difference between signed and unsigned multiplication,
-          when the destination size is equal to the source size and overflow
-          checking is off }
-        if not checkoverflow then
-          { qword(f1)*qword(f2) is coded as a call to mulqword }
-          fpc_mul_int64:=int64(qword(f1)*qword(f2))
-        else
-          begin
-            sign:=false;
-            if f1<0 then
-              begin
-                sign:=not(sign);
-                q1:=qword(-f1);
-              end
-            else
-              q1:=f1;
-            if f2<0 then
-              begin
-                sign:=not(sign);
-                q2:=qword(-f2);
-              end
-            else
-              q2:=f2;
-            { the q1*q2 is coded as call to mulqword }
-            q3:=q1*q2;
-
-            if (q1 <> 0) and (q2 <>0) and
-              ((q1>q3) or (q2>q3) or
-                { the bit 63 can be only set if we have $80000000 00000000 }
-                { and sign is true                                         }
-                (q3 shr 63<>0) and
-                 ((q3<>qword(qword(1) shl 63)) or not(sign))
-                ) then
-              HandleErrorAddrFrameInd(215,get_pc_addr,get_frame);
-
-            if sign then
-              fpc_mul_int64:=-q3
-            else
-              fpc_mul_int64:=q3;
-          end;
-{$endif EXCLUDE_COMPLEX_PROCS}
-      end;
-{$endif FPC_SYSTEM_HAS_MUL_INT64}
-
-{$else VER3_0}
-
 {$ifndef FPC_SYSTEM_HAS_MUL_INT64}
     function fpc_mul_int64(f1,f2 : int64) : int64;[public,alias: 'FPC_MUL_INT64']; compilerproc;
       begin
@@ -567,8 +468,6 @@
 {$endif EXCLUDE_COMPLEX_PROCS}
 {$endif FPC_SYSTEM_HAS_MUL_INT64}
 
-{$endif VER3_0}
-
 {$ifndef FPC_SYSTEM_HAS_MUL_LONGINT_TO_INT64}
     function fpc_mul_int64_compilerproc(f1,f2 : int64) : int64; external name 'FPC_MUL_INT64';
 

+ 20 - 56
rtl/inc/objpas.inc

@@ -274,14 +274,10 @@
 
     function TVmt.GetvParent: PVmt;
       begin
-        {$ifdef VER3_0}
-        GetvParent:=vParentRef;
-        {$else VER3_0}
         if Assigned(vParentRef) then
           GetvParent:=vParentRef^
         else
           GetvParent:=Nil;
-        {$endif VER3_0}
       end;
 
 
@@ -363,27 +359,19 @@ end;
 
     function tinterfaceentry.GetIID: pguid;
       begin
-        {$ifdef VER3_0}
-        GetIID:=IIDRef;
-        {$else VER3_0}
         if Assigned(IIDRef) then
           GetIID:=IIDRef^
         else
           GetIID:=Nil;
-        {$endif VER3_0}
       end;
 
 
     function tinterfaceentry.GetIIDStr: pshortstring;
       begin
-        {$ifdef VER3_0}
-        GetIIDStr:=IIDStrRef;
-        {$else VER3_0}
         if Assigned(IIDStrRef) then
           GetIIDStr:=IIDStrRef^
         else
           GetIIDStr:=Nil;
-        {$endif VER3_0}
       end;
 
 
@@ -413,11 +401,6 @@ end;
            InstanceSize := PVmt(Self)^.vInstanceSize;
         end;
 
-      {$ifdef VER3_0}
-      var
-        emptyintf: ptruint; public name 'FPC_EMPTYINTF';
-      {$endif VER3_0}
-
       procedure InitInterfacePointers(objclass: tclass;instance : pointer);
 
         var
@@ -427,22 +410,17 @@ end;
           Res: pinterfaceentry;
         begin
           ovmt := PVmt(objclass);
-          while assigned(ovmt) and {$ifdef VER3_0}(ovmt^.vIntfTable <> @emptyintf){$else}assigned(ovmt^.vIntfTable){$endif} do
+          while assigned(ovmt) and assigned(ovmt^.vIntfTable) do
             begin
               intftable:=ovmt^.vIntfTable;
-              {$ifdef VER3_0}
-              if assigned(intftable) then
-              {$endif VER3_0}
-              begin
-                i:=intftable^.EntryCount;
-                Res:=@intftable^.Entries[0];
-                while i>0 do begin
-                  if Res^.IType = etStandard then
-                    ppointer(@(pbyte(instance)[Res^.IOffset]))^:=
-                      pointer(Res^.VTable);
-                  inc(Res);
-                  dec(i);
-                end;
+              i:=intftable^.EntryCount;
+              Res:=@intftable^.Entries[0];
+              while i>0 do begin
+                if Res^.IType = etStandard then
+                  ppointer(@(pbyte(instance)[Res^.IOffset]))^:=
+                    pointer(Res^.VTable);
+                inc(Res);
+                dec(i);
               end;
               ovmt:=ovmt^.vParent;
             end;
@@ -450,7 +428,6 @@ end;
 
       class function TObject.InitInstance(instance : pointer) : tobject;
 
-{$ifndef VER3_0}
         var
            vmt  : PVmt;
            inittable : pointer;
@@ -458,7 +435,6 @@ end;
            mopinittable : PRTTIRecordOpOffsetTable;
 {$endif def FPC_HAS_FEATURE_RTTI}
            i : longint;
-{$endif VER3_0}
         begin
            I:=instancesize;
            { the size is saved at offset 0 }
@@ -477,10 +453,9 @@ end;
              {$ENDIF}
           {$ENDIF}
 
-           if {$ifdef VER3_0}PVmt(self)^.vIntfTable <> @emptyintf{$else}assigned(PVmt(self)^.vIntfTable){$endif} then
+           if assigned(PVmt(self)^.vIntfTable) then
              InitInterfacePointers(self,instance);
 
-{$ifndef VER3_0}
 {$ifdef FPC_HAS_FEATURE_RTTI}
            { for management operators like initialize call int_initialize }
            vmt := PVmt(self);
@@ -502,7 +477,6 @@ end;
                  end;
              end;
 {$endif def FPC_HAS_FEATURE_RTTI}
-{$endif VER3_0}
 
            InitInstance:=TObject(Instance);
         end;
@@ -1039,19 +1013,14 @@ end;
           ovmt: PVmt;
         begin
           ovmt := PVmt(Self);
-          while Assigned(ovmt) and {$ifdef VER3_0}(ovmt^.vIntfTable <> @emptyintf){$else}Assigned(ovmt^.vIntftable){$endif} do
+          while Assigned(ovmt) and Assigned(ovmt^.vIntftable) do
           begin
             intftable:=ovmt^.vIntfTable;
-            {$ifdef VER3_0}
-            if assigned(intftable) then
-            {$endif VER3_0}
+            for i:=0 to intftable^.EntryCount-1 do
             begin
-              for i:=0 to intftable^.EntryCount-1 do
-              begin
-                result:=@intftable^.Entries[i];
-                if assigned(Result^.iid) and IsGUIDEqual(Result^.iid^,iid) then
-                  Exit;
-              end;
+              result:=@intftable^.Entries[i];
+              if assigned(Result^.iid) and IsGUIDEqual(Result^.iid^,iid) then
+                Exit;
             end;
             ovmt := ovmt^.vParent;
           end;
@@ -1065,19 +1034,14 @@ end;
           ovmt: PVmt;
         begin
           ovmt := PVmt(Self);
-          while Assigned(ovmt) and {$ifdef VER3_0}(ovmt^.vIntfTable <> @emptyintf){$else}Assigned(ovmt^.vIntfTable){$endif} do
+          while Assigned(ovmt) and Assigned(ovmt^.vIntfTable) do
           begin
             intftable:=ovmt^.vIntfTable;
-            {$ifdef VER3_0}
-            if assigned(intftable) then
-            {$endif VER3_0}
+            for i:=0 to intftable^.EntryCount-1 do
             begin
-              for i:=0 to intftable^.EntryCount-1 do
-              begin
-                result:=@intftable^.Entries[i];
-                if assigned(result^.iidstr) and (result^.iidstr^ = iidstr) then
-                  Exit;
-              end;
+              result:=@intftable^.Entries[i];
+              if assigned(result^.iidstr) and (result^.iidstr^ = iidstr) then
+                Exit;
             end;
             ovmt := ovmt^.vParent;
           end;

+ 3 - 3
rtl/inc/objpash.inc

@@ -140,7 +140,7 @@
        TVmt = record
          vInstanceSize: SizeInt;
          vInstanceSize2: SizeInt;
-         vParentRef: {$ifdef VER3_0}PVmt{$else}PPVmt{$endif};
+         vParentRef: PPVmt;
          vClassName: PShortString;
          vDynamicTable: Pointer;
          vMethodTable: Pointer;
@@ -188,7 +188,7 @@
          property IID: pguid read GetIID;
          property IIDStr: pshortstring read GetIIDStr;
        public
-         IIDRef      : {$IFNDEF VER3_0}^{$ENDIF}pguid; { if assigned(IID) then Com else Corba}
+         IIDRef      : ^pguid; { if assigned(IID) then Com else Corba}
          VTable      : Pointer;
          case integer of
            1 : (
@@ -196,7 +196,7 @@
                );
            2 : (
                 IOffsetAsCodePtr: CodePointer;
-                IIDStrRef   : {$IFNDEF VER3_0}^{$ENDIF}pshortstring; { never nil. Com: upper(GuidToString(IID^)) }
+                IIDStrRef   : ^pshortstring; { never nil. Com: upper(GuidToString(IID^)) }
                 IType       : tinterfaceentrytype;
                );
        end;

+ 4 - 115
rtl/inc/rtti.inc

@@ -16,26 +16,17 @@
 
 function RTTIArraySize(typeInfo: Pointer): SizeInt;
 begin
-{$ifdef VER3_0}
-  typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
-{$else VER3_0}
   typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
   result:=PArrayInfo(typeInfo)^.Size;
 end;
 
 function RTTIRecordSize(typeInfo: Pointer): SizeInt;
 begin
-{$ifdef VER3_0}
-  typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
-{$else VER3_0}
   typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
   { for size field init table is compatible with rtti table }
   result:=PRecordInfoFull(typeInfo)^.Size;
 end;
 
-{$ifndef VER3_0}
 function RTTIRecordOp(typeInfo: Pointer; var initrtti: Pointer): PRecordInfoInit; inline;
 begin
   { find init table and management operators }
@@ -51,31 +42,11 @@ begin
     result:=aligntoqword(initrtti+2+PByte(initrtti)[1]);
   end
 end;
-{$else VER3_0}
-function RTTIRecordRttiInfoToInitInfo(typeInfo: Pointer): Pointer; inline;
-begin
-  result:=typeInfo;
-{$ifndef VER3_0}
-  { find init table }
-  typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-
-  { check terminator, maybe we are already in init table }
-  if Assigned(PRecordInfoInit(typeInfo)^.Terminator) then
-    { point to more optimal initrtti }
-    result:=PRecordInfoFull(typeInfo)^.InitTable;
-{$endif VER3_0}
-end;
-{$endif VER3_0}
 
-{$ifndef VER3_0}
 function RTTISizeAndOp(typeInfo: Pointer;
   const expectedManagementOp: TRTTIRecOpType; out hasManagementOp: boolean): SizeInt;
 begin
   hasManagementOp:=false;
-{$else VER3_0}
-function RTTISize(typeInfo: Pointer): SizeInt;
-begin
-{$endif VER3_0}
   case PTypeKind(typeinfo)^ of
     tkAString,tkWString,tkUString,
     tkInterface,tkDynarray:
@@ -86,7 +57,6 @@ begin
 {$endif FPC_HAS_FEATURE_VARIANTS}
     tkArray:
       result:=RTTIArraySize(typeinfo);
-{$ifndef VER3_0}
     tkObject:
       result:=RTTIRecordSize(typeinfo);
     tkRecord:
@@ -102,10 +72,6 @@ begin
               rotCopy: hasManagementOp:=Assigned(RecordOp^.Copy);
             end;
         end;
-{$else VER3_0}
-    tkObject,tkRecord:
-      result:=RTTIRecordSize(typeinfo);
-{$endif VER3_0}
   else
     result:=-1;
   end;
@@ -117,31 +83,23 @@ var
   count,
   i : longint;
 begin
-{$ifdef VER3_0}
-  typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
-{$else VER3_0}
   typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
   Count:=PRecordInfoInit(typeInfo)^.Count;
   { Get element info, hacky, but what else can we do? }
   typeInfo:=AlignTypeData(Pointer(@PRecordInfoInit(typeInfo)^.Count)+SizeOf(PRecordInfoInit(typeInfo)^.Count));
   { Process elements }
   for i:=1 to count Do
     begin
-      rttiproc(Data+PRecordElement(typeInfo)^.Offset,PRecordElement(typeInfo)^.TypeInfo{$ifndef VER3_0}^{$endif});
+      rttiproc(Data+PRecordElement(typeInfo)^.Offset,PRecordElement(typeInfo)^.TypeInfo^);
       Inc(PRecordElement(typeInfo));
     end;
 end;
 
-
-{$ifndef VER3_0}
 function RTTIRecordMopInitTable(ti: Pointer): PRTTIRecordOpOffsetTable;
 begin
   ti:=aligntoqword(ti+2+PByte(ti)[1]);
   Result:=PRecordInfoInit(ti)^.InitRecordOpTable;
 end;
-{$endif VER3_0}
-
 
 { if you modify this procedure, fpc_copy must be probably modified as well }
 procedure ArrayRTTI(Data,TypeInfo:Pointer;rttiproc:TRTTIProc);
@@ -149,17 +107,13 @@ var
   i,Count,ElSize: SizeInt;
   Info: Pointer;
 begin
-{$ifdef VER3_0}
-  typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
-{$else VER3_0}
   typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
   Count:=PArrayInfo(typeInfo)^.ElCount;
   { no elements to process => exit }
   if Count = 0 then
     Exit;
   ElSize:=PArrayInfo(typeInfo)^.Size div Count;
-  Info:=PArrayInfo(typeInfo)^.ElInfo{$ifndef VER3_0}^{$endif};
+  Info:=PArrayInfo(typeInfo)^.ElInfo^;
   { Process elements }
   for I:=0 to Count-1 do
     rttiproc(Data+(I*ElSize),Info);
@@ -185,7 +139,6 @@ begin
     tkObject,
 {$endif FPC_HAS_FEATURE_OBJECTS}
     tkRecord:
-{$ifndef VER3_0}
       { if possible try to use more optimal initrtti }
       with RTTIRecordOp(typeinfo, typeinfo)^ do
       begin
@@ -193,12 +146,6 @@ begin
         if Assigned(recordop) and Assigned(recordop^.Initialize) then
           recordop^.Initialize(data);
       end;
-{$else VER3_0}
-      begin
-        typeinfo:=RTTIRecordRttiInfoToInitInfo(typeinfo);
-        recordrtti(data,typeinfo,@int_initialize);
-      end;
-{$endif VER3_0}
 {$ifdef FPC_HAS_FEATURE_VARIANTS}
     tkVariant:
       variant_init(PVarData(Data)^);
@@ -228,7 +175,6 @@ begin
     tkObject,
 {$endif FPC_HAS_FEATURE_OBJECTS}
     tkRecord:
-{$ifndef VER3_0}
       { if possible try to use more optimal initrtti }
       with RTTIRecordOp(typeinfo, typeinfo)^ do
       begin
@@ -236,12 +182,6 @@ begin
           recordop^.Finalize(data);
         recordrtti(data,typeinfo,@int_finalize);
       end;
-{$else VER3_0}
-      begin
-        typeinfo:=RTTIRecordRttiInfoToInitInfo(typeinfo);
-        recordrtti(data,typeinfo,@int_finalize);
-      end;
-{$endif VER3_0}
 {$ifdef FPC_HAS_FEATURE_CLASSES}
     tkInterface:
       Intf_Decr_Ref(PPointer(Data)^);
@@ -279,7 +219,6 @@ begin
     tkobject,
 {$endif FPC_HAS_FEATURE_OBJECTS}
     tkrecord :
-{$ifndef VER3_0}
       { find init table }
       with RTTIRecordOp(typeinfo, typeinfo)^ do
       begin
@@ -287,12 +226,6 @@ begin
         if Assigned(recordop) and Assigned(recordop^.AddRef) then
           recordop^.AddRef(Data);
       end;
-{$else VER3_0}
-      begin
-        typeinfo:=RTTIRecordRttiInfoToInitInfo(typeinfo);
-        recordrtti(data,typeinfo,@int_addref);
-      end;
-{$endif VER3_0}
 {$ifdef FPC_HAS_FEATURE_DYNARRAYS}
     tkDynArray:
       fpc_dynarray_incr_ref(PPointer(Data)^);
@@ -338,17 +271,13 @@ begin
 {$endif FPC_HAS_FEATURE_WIDESTRINGS}
     tkArray:
       begin
-{$ifdef VER3_0}
-        Temp:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
-{$else VER3_0}
         Temp:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
         Result:=PArrayInfo(Temp)^.Size;
         EleCount:=PArrayInfo(Temp)^.ElCount;
         { no elements to process => exit }
         if EleCount = 0 then
           Exit;
-        Info:=PArrayInfo(Temp)^.ElInfo{$ifndef VER3_0}^{$endif};
+        Info:=PArrayInfo(Temp)^.ElInfo^;
         copiedsize:=Result div EleCount;
         Offset:=0;
         { Process elements }
@@ -362,18 +291,10 @@ begin
     tkobject,
 {$endif FPC_HAS_FEATURE_OBJECTS}
     tkrecord:
-{$ifndef VER3_0}
       { find init table }
       with RTTIRecordOp(typeinfo, typeinfo)^ do
-{$endif VER3_0}
       begin
-{$ifdef VER3_0}
-        typeInfo:=RTTIRecordRttiInfoToInitInfo(typeInfo);
-        Temp:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
-{$else VER3_0}
         Temp:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
-{$endif VER3_0}
-{$ifndef VER3_0}
         if Assigned(recordop) and Assigned(recordop^.Copy) then
           begin
             recordop^.Copy(Src,Dest);
@@ -385,17 +306,11 @@ begin
             EleCount:=PRecordInfoInit(Temp)^.Count;
             { Get element info, hacky, but what else can we do? }
             Temp:=AlignTypeData(Pointer(@PRecordInfoInit(Temp)^.Count)+SizeOf(PRecordInfoInit(Temp)^.Count));
-{$else VER3_0}
-            Result:=PRecordInfoFull(Temp)^.Size;
-            EleCount:=PRecordInfoFull(Temp)^.Count;
-            { Get element info, hacky, but what else can we do? }
-            Temp:=Pointer(@PRecordInfoFull(Temp)^.Count)+SizeOf(PRecordInfoFull(Temp)^.Count);
-{$endif VER3_0}
             expectedoffset:=0;
             { Process elements with rtti }
             for i:=1 to EleCount Do
               begin
-                Info:=PRecordElement(Temp)^.TypeInfo{$ifndef VER3_0}^{$endif};
+                Info:=PRecordElement(Temp)^.TypeInfo^;
                 Offset:=PRecordElement(Temp)^.Offset;
                 Inc(PRecordElement(Temp));
                 if Offset>expectedoffset then
@@ -406,9 +321,7 @@ begin
             { elements remaining? }
             if result>expectedoffset then
               move((Src+expectedoffset)^,(Dest+expectedoffset)^,Result-expectedoffset);
-{$ifndef VER3_0}
           end;
-{$endif VER3_0}
       end;
 {$ifdef FPC_HAS_FEATURE_DYNARRAYS}
     tkDynArray:
@@ -441,16 +354,10 @@ end;
 procedure fpc_initialize_array(data,typeinfo : pointer;count : SizeInt); [public,alias:'FPC_INITIALIZE_ARRAY']; compilerproc;
   var
     i, size : SizeInt;
-{$ifndef VER3_0}
     hasManagementOp: boolean;
   begin
     size:=RTTISizeAndOp(typeinfo, rotInitialize, hasManagementOp);
     if (size>0) or hasManagementOp then
-{$else VER3_0}
-  begin
-    size:=RTTISize(typeInfo);
-    if size>0 then
-{$endif VER3_0}
       for i:=0 to count-1 do
         int_initialize(data+size*i,typeinfo);
   end;
@@ -459,16 +366,10 @@ procedure fpc_initialize_array(data,typeinfo : pointer;count : SizeInt); [public
 procedure fpc_finalize_array(data,typeinfo : pointer;count : SizeInt); [Public,Alias:'FPC_FINALIZE_ARRAY'];  compilerproc;
   var
      i, size: SizeInt;
-{$ifndef VER3_0}
     hasManagementOp: boolean;
   begin
     size:=RTTISizeAndOp(typeinfo, rotFinalize, hasManagementOp);
     if (size>0) or hasManagementOp then
-{$else VER3_0}
-  begin
-    size:=RTTISize(typeInfo);
-    if size>0 then
-{$endif VER3_0}
       for i:=0 to count-1 do
         int_finalize(data+size*i,typeinfo);
   end;
@@ -477,16 +378,10 @@ procedure fpc_finalize_array(data,typeinfo : pointer;count : SizeInt); [Public,A
 procedure fpc_addref_array(data,typeinfo: pointer; count: SizeInt); [public,alias:'FPC_ADDREF_ARRAY']; compilerproc;
   var
     i, size: SizeInt;
-{$ifndef VER3_0}
     hasManagementOp: boolean;
   begin
     size:=RTTISizeAndOp(typeinfo, rotAddRef, hasManagementOp);
     if (size>0) or hasManagementOp then
-{$else VER3_0}
-  begin
-    size:=RTTISize(typeInfo);
-    if size>0 then
-{$endif VER3_0}
       for i:=0 to count-1 do
         int_addref(data+size*i,typeinfo);
   end;
@@ -511,16 +406,10 @@ procedure FinalizeArray(p, typeInfo: Pointer; count: SizeInt);
 procedure CopyArray(dest, source, typeInfo: Pointer; count: SizeInt);
   var
     i, size: SizeInt;
-{$ifndef VER3_0}
     hasManagementOp: boolean;
   begin
     size:=RTTISizeAndOp(typeinfo, rotCopy, hasManagementOp);
     if (size>0) or hasManagementOp then
-{$else VER3_0}
-  begin
-    size:=RTTISize(typeInfo);
-    if size>0 then
-{$endif VER3_0}
       for i:=0 to count-1 do
         fpc_Copy_internal(source+size*i, dest+size*i, typeInfo);
   end;

+ 0 - 26
rtl/inc/rttidecl.inc

@@ -20,10 +20,8 @@
   {$define USE_PACKED}
 {$endif}
 
-{$ifndef VER3_0}
 { 3.1.1 and newer also (re)stores $MinEnumSize and $PackSet upon $Push/$Pop }
 {$push}
-{$endif}
 
 {$MINENUMSIZE 1   this saves a lot of memory }
 {$ifdef FPC_RTTI_PACKSET1}
@@ -46,11 +44,7 @@ type
   packed
 {$endif USE_PACKED}
   record
-    {$ifdef VER3_0}
-    TypeInfo: Pointer;
-    {$else}
     TypeInfo: PPointer;
-    {$endif}
     Offset: SizeInt;
   end;
 
@@ -65,9 +59,7 @@ type
 {$endif declared TRttiDataCommon}
     case TTypeKind of
       tkRecord: (
-{$ifndef VER3_0}
         InitTable: Pointer;
-{$endif VER3_0}
         Size: Longint;
         Count: Longint;
         { Elements: array[count] of TRecordElement }
@@ -79,7 +71,6 @@ type
   end;
 
   PRecordInfoInit=^TRecordInfoInit;
-{$ifndef VER3_0}
   TRTTIRecVarOp=procedure(ARec: Pointer);
   TRTTIRecCopyOp=procedure(ASrc, ADest: Pointer);
   TRTTIRecOpType=(rotAny, rotInitialize, rotFinalize, rotAddRef, rotCopy);
@@ -126,10 +117,8 @@ type
       tkRecord: (
         Terminator: Pointer;
         Size: Longint;
-{$ifndef VER3_0}
         InitRecordOpTable: PRTTIRecordOpOffsetTable;
         RecordOp: PRTTIRecordOpVMT;
-{$endif VER3_0}
         Count: Longint;
         { Elements: array[count] of TRecordElement }
       );
@@ -138,9 +127,6 @@ type
         dummy : Int64
       );
   end;
-{$else VER3_0}
-  TRecordInfoInit=TRecordInfoFull;
-{$endif VER3_0}
 
   PArrayInfo=^TArrayInfo;
   TArrayInfo=
@@ -155,11 +141,7 @@ type
       tkArray: (
         Size: SizeInt;
         ElCount: SizeInt;
-{$ifdef VER3_0}
-        ElInfo: Pointer;
-{$else}
         ElInfo: PPointer;
-{$endif}
         DimCount: Byte;
         Dims:array[0..255] of Pointer;
       );
@@ -169,14 +151,6 @@ type
       );
   end;
 
-
-{$ifndef VER3_0}
 function RTTIRecordMopInitTable(ti: Pointer): PRTTIRecordOpOffsetTable; forward;
-{$endif VER3_0}
 
-{$ifdef VER3_0}
-{$MINENUMSIZE DEFAULT}
-{$PACKSET DEFAULT}
-{$else}
 {$pop}
-{$endif}

+ 4 - 13
rtl/inc/sstrings.inc

@@ -51,7 +51,7 @@ end;
 
 {$ifndef FPC_HAS_SHORTSTR_DELETE}
 {$define FPC_HAS_SHORTSTR_DELETE}
-procedure {$ifdef VER3_0}delete{$else}fpc_shortstr_delete{$endif}(var s : shortstring;index : SizeInt;count : SizeInt);
+procedure fpc_shortstr_delete(var s : shortstring;index : SizeInt;count : SizeInt);
 begin
   if index<=0 then
      exit;
@@ -69,7 +69,7 @@ end;
 
 {$ifndef FPC_HAS_SHORTSTR_INSERT}
 {$define FPC_HAS_SHORTSTR_INSERT}
-procedure {$ifdef ver3_0}insert{$else}fpc_shortstr_insert{$endif}(const source : shortstring;var s : shortstring;index : SizeInt);
+procedure fpc_shortstr_insert(const source : shortstring;var s : shortstring;index : SizeInt);
 var
   cut,srclen,indexlen : SizeInt;
 begin
@@ -103,7 +103,7 @@ end;
 
 {$ifndef FPC_HAS_SHORTSTR_INSERT_CHAR}
 {$define FPC_HAS_SHORTSTR_INSERT_CHAR}
-procedure {$ifdef ver3_0}insert{$else}fpc_shortstr_insert_char{$endif}(source : AnsiChar;var s : shortstring;index : SizeInt);
+procedure fpc_shortstr_insert_char(source : AnsiChar;var s : shortstring;index : SizeInt);
 var
   indexlen : SizeInt;
 begin
@@ -518,10 +518,7 @@ type
     Common: TRttiDataCommon;
 {$endif}
     case TTypeKind of
-{$ifndef VER3_0}
-      tkInt64,tkQWord,
-{$endif VER3_0}
-      tkInteger,tkChar,tkEnumeration,tkBool,tkWChar: (
+      tkInt64,tkQWord,tkInteger,tkChar,tkEnumeration,tkBool,tkWChar: (
          OrdType : Byte;
          case TTypeKind of
             tkInteger,tkChar,tkEnumeration,tkBool,tkWChar: (
@@ -530,14 +527,12 @@ type
                 tkEnumeration: (
                   BaseTypeRef : pointer
                   );
-{$ifndef VER3_0}
             {tkBool with OrdType=otSQWord }
             tkInt64:
               (MinInt64Value, MaxInt64Value: Int64);
             {tkBool with OrdType=otUQWord }
             tkQWord:
               (MinQWordValue, MaxQWordValue: QWord);
-{$endif VER3_0}
          );
     );
     { more data here, but not needed }
@@ -587,11 +582,7 @@ begin
         does nothing) in case FPC_REQUIRES_PROPER_ALIGNMENT is not set
         to avoid the need for an if in this situation }
 
-{$ifdef VER3_0}
-      body:=Penum_typedata(aligntoptr(pointer(header) + 2 * sizeof(byte) { kind, num_chars } + header^.num_chars));
-{$else VER3_0}
       body:=Penum_typedata(aligntoqword(pointer(header) + 2 * sizeof(byte) { kind, num_chars } + header^.num_chars));
-{$endif VER3_0}
 
       with body^ do
         begin

+ 6 - 8
rtl/inc/system.inc

@@ -534,15 +534,15 @@ function aligntoqword(p : pointer) : pointer;inline;
 
 function AlignTypeData(p : pointer) : pointer; inline;
   begin
-{$if defined(CPUM68K) and not defined(VER3_0)}
+{$if defined(CPUM68K)}
     result := aligntoqword(p);
-{$else CPUM68K and not VER3_0}
+{$else CPUM68K}
     result := aligntoptr(p);
-{$endif CPUM68K and not VER3_0}
+{$endif CPUM68K}
   end;
 
 
-{$if not defined(VER3_0) and not defined(VER3_2)}
+{$if not defined(VER3_2)}
 type
   TRttiDataCommon =
 {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
@@ -551,7 +551,7 @@ type
   record
     Attrs: Pointer;
   end;
-{$endif not VER3_0 and not VER3_2}
+{$endif not VER3_2}
 
 
 {****************************************************************************
@@ -1131,9 +1131,7 @@ type
   end;
   TInitFinalTable = record
     TableCount,
-    InitCount  : {$if defined(VER3_0)}sizeint
-                 {$else}ALUUInt{$endif}
-                 ;
+    InitCount  : ALUUInt;
     Procs      : array[1..maxunits] of TInitFinalRec;
   end;
   PInitFinalTable = ^TInitFinalTable;

+ 2 - 23
rtl/inc/systemh.inc

@@ -495,16 +495,6 @@ Type
   TExitCode = Word;
 {$endif CPU16}
 
-{$if defined(VER3_0)}
-{$if defined(CPU16)}
-{$define CPUINT16}
-{$elseif defined(CPU32)}
-{$define CPUINT32}
-{$elseif defined(CPU64)}
-{$define CPUINT64}
-{$endif defined(CPU64)}
-{$endif defined(VER3_0)}
-
 {$if defined(CPUINT8)}
   ALUSInt = ShortInt;
   ALUUInt = Byte;
@@ -643,9 +633,7 @@ Type
 
   PBoolean            = ^Boolean;
 
-{$IFNDEF VER3_0}
   PBoolean8           = ^Boolean8;
-{$ENDIF VER3_0}
   PBoolean16          = ^Boolean16;
   PBoolean32          = ^Boolean32;
   PBoolean64          = ^Boolean64;
@@ -1302,11 +1290,6 @@ function StrLen(p:PAnsiChar):sizeint;external name 'FPC_PCHAR_LENGTH';
 function Utf8CodePointLen(P: PAnsiChar; MaxLookAhead: SizeInt; IncludeCombiningDiacriticalMarks: Boolean): SizeInt;
 
 { Shortstring functions }
-{$ifdef VER3_0}
-Procedure Delete(var s:shortstring;index:SizeInt;count:SizeInt);
-Procedure Insert(const source:shortstring;var s:shortstring;index:SizeInt);
-Procedure Insert(source:AnsiChar;var s:shortstring;index:SizeInt);
-{$endif VER3_0}
 Function  Pos(const substr:shortstring;const s:shortstring; Offset: Sizeint = 1):SizeInt;
 Function  Pos(C:AnsiChar;const s:shortstring; Offset: Sizeint = 1):SizeInt;
 {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
@@ -1349,9 +1332,9 @@ Function  HexStr(Val:Pointer):shortstring;
 {$endif CPUI8086}
 
 { AnsiChar functions }
-{$if defined(VER3_2) or defined(VER3_0)}
+{$if defined(VER3_2)}
 Function Chr(b : byte) : AnsiChar;      [INTERNPROC: fpc_in_chr_byte];
-{$endif defined(VER3_2) or defined(VER3_0)}
+{$endif defined(VER3_2)}
 Function  UpCase(c:AnsiChar):AnsiChar;
 Function  LowerCase(c:AnsiChar):AnsiChar; overload;
 function  Pos(const substr : shortstring;c:Ansichar; Offset: Sizeint = 1): SizeInt;
@@ -1365,10 +1348,6 @@ function  Pos(const substr : shortstring;c:Ansichar; Offset: Sizeint = 1): SizeI
 Procedure UniqueString(var S : RawByteString);{$ifdef FPC_HAS_CPSTRING}rtlproc;{$endif FPC_HAS_CPSTRING}{$ifdef SYSTEMINLINE}inline;{$endif}
 Function  Pos (const Substr : RawByteString; const Source : RawByteString; Offset: Sizeint = 1) : SizeInt;
 Function  Pos (c : AnsiChar; const s : RawByteString; Offset: Sizeint = 1) : SizeInt;
-{$ifdef VER3_0}
-Procedure Insert (const Source : RawByteString; var S : RawByteString; Index : SizeInt);{$ifdef FPC_HAS_CPSTRING}rtlproc;{$endif FPC_HAS_CPSTRING}
-Procedure Delete (var S : RawByteString; Index,Size: SizeInt);{$ifdef FPC_HAS_CPSTRING}rtlproc;{$endif FPC_HAS_CPSTRING}
-{$endif VER3_0}
 Function  StringOfChar(c : Ansichar;l : SizeInt) : AnsiString;
 function  UpCase(const s : ansistring) : ansistring;
 function  LowerCase(const s : ansistring) : ansistring;

+ 3 - 3
rtl/inc/threadvr.inc

@@ -30,7 +30,7 @@ type
 
   TltvInitTablesTable = {$ifndef FPC_ALIGNED_THREADVARTABLES}packed{$endif} record
     count  : dword;
-    tables : {$ifndef FPC_ALIGNED_THREADVARTABLES}packed{$endif} array [1..{$ifdef cpu16}16{$else}32767{$endif}] of {$ifdef ver3_0}pltvInitEntry{$else}ppltvInitEntry{$endif};
+    tables : {$ifndef FPC_ALIGNED_THREADVARTABLES}packed{$endif} array [1..{$ifdef cpu16}16{$else}32767{$endif}] of ppltvInitEntry;
   end;
   PltvInitTablesTable = ^TltvInitTablesTable;
 
@@ -63,7 +63,7 @@ begin
     WriteLn ('init_all_unit_threadvars (',count,') units');
 {$endif}
     for i := 1 to count do
-      init_unit_threadvars (tables[i]{$ifndef ver3_0}^{$endif});
+      init_unit_threadvars (tables[i]^);
   end;
 end;
 
@@ -97,7 +97,7 @@ begin
     WriteLn ('copy_all_unit_threadvars (',count,') units');
 {$endif}
     for i := 1 to count do
-      copy_unit_threadvars (tables[i]{$ifndef ver3_0}^{$endif});
+      copy_unit_threadvars (tables[i]^);
   end;
 end;
 {$endif FPC_SECTION_THREADVARS}

+ 1 - 5
rtl/inc/ustringh.inc

@@ -28,10 +28,6 @@ Function  UpCase(c:UnicodeChar):UnicodeChar;
 Function LowerCase(const s : UnicodeString) : UnicodeString;
 Function  LowerCase(c:UnicodeChar):UnicodeChar;
 
-{$ifdef VER3_0}
-Procedure Insert (Const Source : UnicodeString; Var S : UnicodeString; Index : SizeInt);
-Procedure Delete (Var S : UnicodeString; Index,Size: SizeInt);
-{$endif VER3_0}
 Procedure {$ifdef FPC_HAS_CPSTRING}fpc_setstring_unicodestr_pwidechar{$else}SetString{$endif}(Out S : UnicodeString; Buf : PUnicodeChar; Len : SizeInt); {$ifdef FPC_HAS_CPSTRING} compilerproc; {$endif FPC_HAS_CPSTRING}
 Procedure {$ifdef FPC_HAS_CPSTRING}fpc_setstring_unicodestr_pansichar{$else}SetString{$endif}(Out S : UnicodeString; Buf : PAnsiChar; Len : SizeInt); {$ifdef FPC_HAS_CPSTRING} compilerproc; {$endif FPC_HAS_CPSTRING}
 
@@ -193,4 +189,4 @@ Type
 Var
   LocaleNameToCodePageCallBack : TLocaleNameToCodePageCallBack;
   
-Function LocaleNameToCodePage(const localename : shortstring; out codepage : TSystemCodePage) : Boolean;
+Function LocaleNameToCodePage(const localename : shortstring; out codepage : TSystemCodePage) : Boolean;

+ 3 - 3
rtl/inc/ustrings.inc

@@ -39,7 +39,7 @@ Type
   TUnicodeRec = Record
     CodePage    : TSystemCodePage;
     ElementSize : Word;
-{$if not defined(VER3_0) and not defined(VER3_2)}
+{$if not defined(VER3_2)}
   {$ifdef CPU64}	
     Ref         : Longint;
   {$else}
@@ -1301,7 +1301,7 @@ end;
 
 {$ifndef FPC_HAS_DELETE_UNICODESTR}
 {$define FPC_HAS_DELETE_UNICODESTR}
-Procedure {$ifdef VER3_0}Delete{$else}fpc_unicodestr_delete{$endif}(Var S : UnicodeString; Index,Size: SizeInt);
+Procedure fpc_unicodestr_delete(Var S : UnicodeString; Index,Size: SizeInt);
 Var
   LS : SizeInt;
 begin
@@ -1325,7 +1325,7 @@ end;
 
 {$ifndef FPC_HAS_INSERT_UNICODESTR}
 {$define FPC_HAS_INSERT_UNICODESTR}
-Procedure {$ifdef VER3_0}Insert{$else}fpc_unicodestr_insert{$endif}(Const Source : UnicodeString; Var S : UnicodeString; Index : SizeInt);
+Procedure fpc_unicodestr_insert(Const Source : UnicodeString; Var S : UnicodeString; Index : SizeInt);
 var
   LS,LSource : SizeInt;
   selfinsert : boolean;

+ 0 - 4
rtl/inc/wstringh.inc

@@ -26,10 +26,6 @@ Function Pos (const c : ShortString; Const s : WideString; Offset : SizeInt = 1)
 
 Function UpCase(const s : WideString) : WideString;
 
-{$ifdef VER3_0}
-Procedure Insert (Const Source : WideString; Var S : WideString; Index : SizeInt);
-Procedure Delete (Var S : WideString; Index,Size: SizeInt);
-{$endif VER3_0}
 Procedure {$ifdef FPC_HAS_CPSTRING}fpc_setstring_widestr_pwidechar{$else}SetString{$endif}(Out S : WideString; Buf : PWideChar; Len : SizeInt); {$ifdef FPC_HAS_CPSTRING} compilerproc; {$endif FPC_HAS_CPSTRING}
 Procedure {$ifdef FPC_HAS_CPSTRING}fpc_setstring_widestr_pansichar{$else}SetString{$endif}(Out S : WideString; Buf : PAnsiChar; Len : SizeInt); {$ifdef FPC_HAS_CPSTRING} compilerproc; {$endif FPC_HAS_CPSTRING}
 

+ 2 - 2
rtl/inc/wstrings.inc

@@ -694,7 +694,7 @@ end;
 
 
 
-Procedure {$ifdef VER3_0}Delete{$else}fpc_widestr_delete{$endif}(Var S : WideString; Index,Size: SizeInt);
+Procedure fpc_widestr_delete(Var S : WideString; Index,Size: SizeInt);
 Var
   LS : SizeInt;
 begin
@@ -714,7 +714,7 @@ begin
 end;
 
 
-Procedure {$ifdef VER3_0}Insert{$else}fpc_widestr_insert{$endif}(Const Source : WideString; Var S : WideString; Index : SizeInt);
+Procedure fpc_widestr_insert(Const Source : WideString; Var S : WideString; Index : SizeInt);
 var
   Temp : WideString;
   LS : SizeInt;

+ 1 - 1
rtl/objpas/classes/reader.inc

@@ -672,7 +672,7 @@ begin
       ClassTable := FieldTable^.ClassTable;
       for i := 0 to ClassTable^.Count - 1 do
       begin
-        Result := ClassTable^.Entries[i]{$ifndef VER3_0}^{$endif};
+        Result := ClassTable^.Entries[i]^;
         if Result.ClassNameIs(ShortClassName) then
           exit;
       end;

+ 0 - 4
rtl/objpas/fgl.pp

@@ -985,11 +985,7 @@ end;
 
 class function TFPGList.ItemIsManaged: Boolean;
 begin
-{$IFNDEF VER3_0}
   Result:=IsManagedType(T);
-{$ELSE}
-  Result:=True; // Fallback to old behaviour  
-{$ENDIF}
 end;
 
 function TFPGList.GetEnumerator: TFPGListEnumeratorSpec;

+ 9 - 9
rtl/objpas/objpas.pp

@@ -365,7 +365,7 @@ Type
      Count : sizeint;
      Tables : Array[{$ifdef cpu16}Byte{$else cpu16}Word{$endif cpu16}] of record
        TableStart,
-       TableEnd   : {$ifdef ver3_0}PResourceStringRecord{$else}PPResourceStringRecord{$endif};
+       TableEnd   : PPResourceStringRecord;
      end;
    end;
    PResourceStringTableList = ^TResourceStringTableList;
@@ -417,10 +417,10 @@ begin
     begin
       For i:=0 to Count-1 do
         begin
-          ResStr:=Tables[I].TableStart{$ifndef VER3_0}^{$endif};
+          ResStr:=Tables[I].TableStart^;
           { Skip first entry (name of the Unit) }
           inc(ResStr);
-          while ResStr<Tables[I].TableEnd{$ifndef VER3_0}^{$endif} do
+          while ResStr<Tables[I].TableEnd^ do
             begin
               s:=SetFunction(ResStr^.Name,ResStr^.DefaultValue,Longint(ResStr^.HashValue),arg);
               if s<>'' then
@@ -447,12 +447,12 @@ begin
       UpUnitName:=UpCase(UnitName);
       For i:=0 to Count-1 do
         begin
-          ResStr:=Tables[I].TableStart{$ifndef VER3_0}^{$endif};
+          ResStr:=Tables[I].TableStart^;
           { Check name of the Unit }
           if ResStr^.Name<>UpUnitName then
             continue;
           inc(ResStr);
-          while ResStr<Tables[I].TableEnd{$ifndef VER3_0}^{$endif} do
+          while ResStr<Tables[I].TableEnd^ do
             begin
               s:=SetFunction(ResStr^.Name,ResStr^.DefaultValue,Longint(ResStr^.HashValue),arg);
               if s<>'' then
@@ -478,10 +478,10 @@ begin
     begin
       For i:=0 to Count-1 do
         begin
-          ResStr:=Tables[I].TableStart{$ifndef VER3_0}^{$endif};
+          ResStr:=Tables[I].TableStart^;
           { Skip first entry (name of the Unit) }
           inc(ResStr);
-          while ResStr<Tables[I].TableEnd{$ifndef VER3_0}^{$endif} do
+          while ResStr<Tables[I].TableEnd^ do
             begin
               ResStr^.CurrentValue:=ResStr^.DefaultValue;
               inc(ResStr);
@@ -500,10 +500,10 @@ begin
     begin
       For i:=0 to Count-1 do
         begin
-          ResStr:=Tables[I].TableStart{$ifndef VER3_0}^{$endif};
+          ResStr:=Tables[I].TableStart^;
           { Skip first entry (name of the Unit) }
           inc(ResStr);
-          while ResStr<Tables[I].TableEnd{$ifndef VER3_0}^{$endif} do
+          while ResStr<Tables[I].TableEnd^ do
             begin
               ResStr^.CurrentValue:='';
               inc(ResStr);

+ 0 - 4
rtl/objpas/types.pp

@@ -535,7 +535,6 @@ function CenteredRect(const SourceRect: TRect; const aCenteredRect: TRect): TRec
 function IntersectRectF(out Rect: TRectF; const R1, R2: TRectF): Boolean;
 function UnionRectF(out Rect: TRectF; const R1, R2: TRectF): Boolean;
 
-{$ifndef VER3_0}
 type
   TBitConverter = class
     generic class procedure UnsafeFrom<T>(const ASrcValue: T; var ADestination: Array of Byte; AOffset: Integer = 0); static; {inline;}
@@ -543,7 +542,6 @@ type
     generic class function UnsafeInTo<T>(const ASource: Array of Byte; AOffset: Integer = 0): T; static; {inline;}
     generic class function InTo<T>(const ASource: Array of Byte; AOffset: Integer = 0): T; static;
   end;
-{$endif}
 
 Const
   cPI: Single = 3.141592654;
@@ -1922,7 +1920,6 @@ begin
 end;
 
 
-{$ifndef VER3_0}
 generic class procedure TBitConverter.UnsafeFrom<T>(const ASrcValue: T; var ADestination: Array of Byte; AOffset: Integer = 0);
 begin
   move(ASrcValue, ADestination[AOffset], SizeOf(T));
@@ -1960,6 +1957,5 @@ begin
 
   Result := TBitConverter.specialize UnsafeInTo<T>(ASource, AOffset);
 end;
-{$endif}
 
 end.

+ 22 - 90
rtl/objpas/typinfo.pp

@@ -25,7 +25,6 @@ unit TypInfo;
 {$MODE objfpc}
 {$MODESWITCH AdvancedRecords}
 {$inline on}
-{$macro on}
 {$h+}
 
 {$IFDEF FPC_DOTTEDUNITS}
@@ -93,8 +92,7 @@ unit TypInfo;
                       mkClassProcedure,mkClassFunction,mkClassConstructor,
                       mkClassDestructor,mkOperatorOverload);
        TParamFlag     = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut,pfConstRef
-                         {$ifndef VER3_0},pfHidden,pfHigh,pfSelf,pfVmt,pfResult{$endif VER3_0}
-                         );
+                         ,pfHidden,pfHigh,pfSelf,pfVmt,pfResult);
        TParamFlags    = set of TParamFlag;
        TIntfFlag      = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
        TIntfFlags     = set of TIntfFlag;
@@ -264,17 +262,9 @@ unit TypInfo;
 
       PPropData = ^TPropData;
 
-{ Note: these are only for backwards compatibility. New type references should
-        only use PPTypeInfo directly! }
-{$ifdef ver3_0}
-{$define TypeInfoPtr := PTypeInfo}
-{$else}
-{$define TypeInfoPtr := PPTypeInfo}
-{$endif}
-
 {$PACKRECORDS C}
 
-{$if not defined(VER3_0) and not defined(VER3_2)}
+{$if not defined(VER3_2)}
 {$define PROVIDE_ATTR_TABLE}
 {$endif}
 
@@ -323,9 +313,9 @@ unit TypInfo;
       public
         Size: SizeInt;
         ElCount: SizeInt;
-        ElTypeRef: TypeInfoPtr;
+        ElTypeRef: PPTypeInfo;
         DimCount: Byte;
-        DimsRef: array[0..255] of TypeInfoPtr;
+        DimsRef: array[0..255] of PPTypeInfo;
       end;
 
       PManagedField = ^TManagedField;
@@ -339,7 +329,7 @@ unit TypInfo;
       public
         property TypeRef: PTypeInfo read GetTypeRef;
       public
-        TypeRefRef: TypeInfoPtr;
+        TypeRefRef: PPTypeInfo;
         FldOffset: SizeInt;
       end;
 
@@ -360,7 +350,7 @@ unit TypInfo;
         property Flags: Byte read GetFlags;
       public
         ParamFlags: TParamFlags;
-        ParamTypeRef: TypeInfoPtr;
+        ParamTypeRef: PPTypeInfo;
         Name: ShortString;
       end;
 
@@ -377,7 +367,7 @@ unit TypInfo;
       public
         Flags: Byte;
         CC: TCallConv;
-        ResultTypeRef: TypeInfoPtr;
+        ResultTypeRef: PPTypeInfo;
         ParamCount: Byte;
         {Params: array[0..ParamCount - 1] of TProcedureParam;}
         function GetParam(ParamIndex: Integer): PProcedureParam;
@@ -623,10 +613,8 @@ unit TypInfo;
           tkRecord: (
             Terminator: Pointer;
             Size: Longint;
-{$ifndef VER3_0}
             InitOffsetOp: PRecOpOffsetTable;
             ManagementOp: Pointer;
-{$endif}
             ManagedFieldCount: Longint;
           { ManagedFields: array[0..ManagedFieldCount - 1] of TInitManagedField ; }
           );
@@ -853,9 +841,7 @@ unit TypInfo;
         case TTypeKind of
       tkRecord:
         (
-  {$ifndef VER3_0}
           RecInitInfo: Pointer; { points to TTypeInfo followed by init table }
-  {$endif VER3_0}
           RecSize: Longint;
           case Boolean of
             False: (ManagedFldCount: Longint deprecated 'Use RecInitData^.ManagedFieldCount or TotalFieldCount depending on your use case');
@@ -887,9 +873,7 @@ unit TypInfo;
         function GetBaseType: PTypeInfo; inline;
         function GetCompType: PTypeInfo; inline;
         function GetParentInfo: PTypeInfo; inline;
-{$ifndef VER3_0}        
         function GetRecInitData: PRecInitData; inline;
-{$endif}
         function GetHelperParent: PTypeInfo; inline;
         function GetExtendedInfo: PTypeInfo; inline;
         function GetIntfParent: PTypeInfo; inline;
@@ -907,9 +891,7 @@ unit TypInfo;
         { tkClass }
         property ParentInfo: PTypeInfo read GetParentInfo;
         { tkRecord }
-{$ifndef VER3_0}        
         property RecInitData: PRecInitData read GetRecInitData;
-{$endif}
         { tkHelper }
         property HelperParent: PTypeInfo read GetHelperParent;
         property ExtendedInfo: PTypeInfo read GetExtendedInfo;
@@ -934,10 +916,7 @@ unit TypInfo;
               ();
             tkAString:
               (CodePage: Word);
-{$ifndef VER3_0}
-            tkInt64,tkQWord,
-{$endif VER3_0}
-            tkInteger,tkChar,tkEnumeration,tkBool,tkWChar,tkSet:
+            tkInt64,tkQWord,tkInteger,tkChar,tkEnumeration,tkBool,tkWChar,tkSet:
               (OrdType : TOrdType;
                case TTypeKind of
                   tkInteger,tkChar,tkEnumeration,tkBool,tkWChar : (
@@ -945,24 +924,20 @@ unit TypInfo;
                     case TTypeKind of
                       tkEnumeration:
                         (
-                        BaseTypeRef : TypeInfoPtr;
+                        BaseTypeRef : PPTypeInfo;
                         NameList : ShortString;
                         {EnumUnitName: ShortString;})
                     );
-{$ifndef VER3_0}
                   {tkBool with OrdType=otSQWord }
                   tkInt64:
                     (MinInt64Value, MaxInt64Value: Int64);
                   {tkBool with OrdType=otUQWord }
                   tkQWord:
                     (MinQWordValue, MaxQWordValue: QWord);
-{$endif VER3_0}
                   tkSet:
                     (
-{$ifndef VER3_0}
                      SetSize : SizeInt;
-{$endif VER3_0}
-                     CompTypeRef : TypeInfoPtr
+                     CompTypeRef : PPTypeInfo
                     )
               );
 {$ifndef FPUNONE}
@@ -973,7 +948,7 @@ unit TypInfo;
               (MaxLength : Byte);
             tkClass:
               (ClassType : TClass;
-               ParentInfoRef : TypeInfoPtr;
+               ParentInfoRef : PPTypeInfo;
                PropCount : SmallInt;
                UnitName : ShortString;
                // here the properties follow as array of TPropInfo:
@@ -988,9 +963,7 @@ unit TypInfo;
               );
             tkRecord:
               (
-{$ifndef VER3_0}
                 RecInitInfo: Pointer; { points to TTypeInfo followed by init table }
-{$endif VER3_0}
                 RecSize: Longint;
                 case Boolean of
                   False: (ManagedFldCount: Longint deprecated 'Use RecInitData^.ManagedFieldCount or TotalFieldCount depending on your use case');
@@ -998,8 +971,8 @@ unit TypInfo;
                 {ManagedFields: array[1..TotalFieldCount] of TManagedField}
               );
             tkHelper:
-              (HelperParentRef : TypeInfoPtr;
-               ExtendedInfoRef : TypeInfoPtr;
+              (HelperParentRef : PPTypeInfo;
+               ExtendedInfoRef : PPTypeInfo;
                HelperProps : SmallInt;
                HelperUnit : ShortString
                // here the properties follow as array of TPropInfo
@@ -1025,15 +998,9 @@ unit TypInfo;
               );
             tkProcVar:
               (ProcSig: TProcedureSignature);
-{$ifdef VER3_0}
-            tkInt64:
-              (MinInt64Value, MaxInt64Value: Int64);
-            tkQWord:
-              (MinQWordValue, MaxQWordValue: QWord);
-{$endif VER3_0}
             tkInterface:
               (
-               IntfParentRef: TypeInfoPtr;
+               IntfParentRef: PPTypeInfo;
                IntfFlags : TIntfFlagsBase;
                GUID: TGUID;
                ThunkClass : PPTypeInfo;
@@ -1043,7 +1010,7 @@ unit TypInfo;
               );
             tkInterfaceRaw:
               (
-               RawIntfParentRef: TypeInfoPtr;
+               RawIntfParentRef: PPTypeInfo;
                RawIntfFlags : TIntfFlagsBase;
                IID: TGUID;
                RawThunkClass : PPTypeInfo;
@@ -1056,15 +1023,15 @@ unit TypInfo;
             tkDynArray:
               (
               elSize     : PtrUInt;
-              elType2Ref : TypeInfoPtr;
+              elType2Ref : PPTypeInfo;
               varType    : Longint;
-              elTypeRef  : TypeInfoPtr;
+              elTypeRef  : PPTypeInfo;
               DynUnitName: ShortStringBase
               );
             tkClassRef:
-              (InstanceTypeRef: TypeInfoPtr);
+              (InstanceTypeRef: PPTypeInfo);
             tkPointer:
-              (RefTypeRef: TypeInfoPtr);
+              (RefTypeRef: PPTypeInfo);
       end;
 
       PPropInfo = ^TPropInfo;
@@ -1132,7 +1099,7 @@ unit TypInfo;
         function GetTail: Pointer; inline;
         function GetNext: PPropInfo; inline;
       public
-        PropTypeRef : TypeInfoPtr;
+        PropTypeRef : PPTypeInfo;
         GetProc : CodePointer;
         SetProc : CodePointer;
         StoredProc : CodePointer;
@@ -1391,7 +1358,7 @@ Const
   OnSetVariantprop : TSetVariantProp = Nil;
 
 { for inlining }
-function DerefTypeInfoPtr(Info: TypeInfoPtr): PTypeInfo; inline;
+function DerefTypeInfoPtr(Info: PPTypeInfo): PTypeInfo; inline;
 
 Implementation
 
@@ -1422,16 +1389,12 @@ function aligntoptr(p : pointer) : pointer;inline;
    end;
 
 
-function DerefTypeInfoPtr(Info: TypeInfoPtr): PTypeInfo; inline;
+function DerefTypeInfoPtr(Info: PPTypeInfo): PTypeInfo; inline;
 begin
-{$ifdef ver3_0}
-  Result := Info;
-{$else}
   if not Assigned(Info) then
     Result := Nil
   else
     Result := Info^;
-{$endif}
 end;
 
 function GetAttributeTable(TypeInfo: PTypeInfo): PAttributeTable;
@@ -1623,31 +1586,10 @@ begin
   PTD := GetTypeData(TypeInfo);
   ValueArr := PLongInt(Value);
   Result:=[];
-{$ifdef ver3_0}
-  case PTD^.OrdType of
-    otSByte, otUByte: begin
-      Els := 0;
-      Rem := 1;
-    end;
-    otSWord, otUWord: begin
-      Els := 0;
-      Rem := 2;
-    end;
-    otSLong, otULong: begin
-      Els := 1;
-      Rem := 0;
-    end;
-  end;
-{$else}
   Els := PTD^.SetSize div SizeOf(LongInt);
   Rem := PTD^.SetSize mod SizeOf(LongInt);
-{$endif}
 
-{$ifdef ver3_0}
-  El := 0;
-{$else}
   for El := 0 to (PTD^.SetSize - 1) div SizeOf(LongInt) do
-{$endif}
     begin
       if El = Els then
         Max := Rem
@@ -1782,11 +1724,7 @@ Var
 
 begin
   PTD:=GetTypeData(TypeInfo);
-{$ifndef ver3_0}
   FillChar(Result^, PTD^.SetSize, 0);
-{$else}
-  PInteger(Result)^ := 0;
-{$endif}
   ResArr := PLongWord(Result);
   for B in Value do
     begin
@@ -1816,11 +1754,7 @@ Function AlignTypeData(p : Pointer) : Pointer;
 {$packrecords default}
 begin
 {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
-{$ifdef VER3_0}
-  Result:=Pointer(align(p,SizeOf(Pointer)));
-{$else VER3_0}
   Result:=Pointer(align(p,PtrInt(@TAlignCheck(nil^).q)))
-{$endif VER3_0}
 {$else FPC_REQUIRES_PROPER_ALIGNMENT}
   Result:=p;
 {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
@@ -4920,12 +4854,10 @@ begin
   Result := DerefTypeInfoPtr(ParentInfoRef);
 end;
 
-{$ifndef VER3_0}
 function TTypeData.GetRecInitData: PRecInitData;
 begin
   Result := PRecInitData(aligntoptr(PTypeData(RecInitInfo+2+PByte(RecInitInfo+1)^)));
 end;
-{$endif}
 
 function TTypeData.GetHelperParent: PTypeInfo;
 begin

+ 1 - 3
rtl/win/syswin.inc

@@ -201,7 +201,7 @@ begin
     CurFilt:=@PFilterRec(Filter+sizeof(Longint))[i];
     if (CurFilt^.RvaClass=$FFFFFFFF) or
       { TODO: exception might be coming from another module, need more advanced comparing }
-      (ExClass.InheritsFrom({$if not defined(ver3_0) and not defined(ver3_2)}PClass(imagebase+CurFilt^.RvaClass)^{$else}TClass(imagebase+CurFilt^.RvaClass){$endif})) then
+      (ExClass.InheritsFrom({$if not defined(ver3_2)}PClass(imagebase+CurFilt^.RvaClass)^{$else}TClass(imagebase+CurFilt^.RvaClass){$endif})) then
     begin
       result:=Pointer(imagebase+CurFilt^.RvaHandler);
       exit;
@@ -736,7 +736,6 @@ procedure InitWin32Widestrings;
     i: longint;
     ptable: PWStrInitEntry;
   begin
-{$if not(defined(VER2_2) or defined(VER2_4))}
     { assign initial values to global Widestring typed consts }
     for i:=1 to WStrInitTablesTable^.count do
       begin
@@ -747,7 +746,6 @@ procedure InitWin32Widestrings;
             Inc(ptable);
           end;
       end;
-{$endif}
 
     { Note: since WideChar=UnicodeChar and PWideChar=PUnicodeChar,
       Wide2AnsiMoveProc is identical to Unicode2AnsiStrMoveProc. }

+ 0 - 5
rtl/win32/system.pp

@@ -26,11 +26,6 @@ interface
   {$define SYSTEMEXCEPTIONDEBUG}
 {$endif SYSTEMDEBUG}
 
-{$ifdef VER3_0}
-{ 3.1.1+ do not require this anymore }
-{$define FPC_HAS_INDIRECT_ENTRY_INFORMATION}
-{$endif VER3_0}
-
 {$ifdef cpui386}
   {$define Set_i386_Exception_handler}
 {$endif cpui386}

+ 0 - 60
rtl/win64/system.pp

@@ -55,12 +55,7 @@ var
 implementation
 
 var
-{$ifdef VER3_0}
-  SysInstance : qword;
-  FPCSysInstance: PQWord = @SysInstance; public name '_FPC_SysInstance';
-{$else VER3_0}
   FPCSysInstance : PQWord;public name '_FPC_SysInstance';
-{$endif VER3_0}
 
 {$define FPC_SYSTEM_HAS_OSSETUPENTRYINFORMATION}
 procedure OsSetupEntryInformation(constref info: TEntryInformation); forward;
@@ -82,18 +77,10 @@ function main_wrapper(arg: Pointer; proc: Pointer): ptrint; forward;
 {$ifndef SYSTEM_USE_WIN_SEH}
 procedure install_exception_handlers;forward;
 {$endif SYSTEM_USE_WIN_SEH}
-{$ifdef VER3_0}
-procedure PascalMain;external name 'PASCALMAIN';
-{$endif VER3_0}
 
 { include code common with win32 }
 {$I syswin.inc}
 
-{$ifdef VER3_0}
-{ TLS directory code }
-{$I systlsdir.inc}
-{$endif VER3_0}
-
 procedure OsSetupEntryInformation(constref info: TEntryInformation);
 begin
   TlsKey := info.OS.TlsKeyAddr;
@@ -136,27 +123,6 @@ begin
   ExitProcess(exitcode);
 end;
 
-{$ifdef VER3_0}
-procedure _FPC_DLLMainCRTStartup(_hinstance : qword;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLMainCRTStartup';
-begin
-  IsConsole:=true;
-  sysinstance:=_hinstance;
-  dllreason:=_dllreason;
-  dllparam:=PtrInt(_dllparam);
-  DLL_Entry;
-end;
-
-
-procedure _FPC_DLLWinMainCRTStartup(_hinstance : qword;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLWinMainCRTStartup';
-begin
-  IsConsole:=false;
-  sysinstance:=_hinstance;
-  dllreason:=_dllreason;
-  dllparam:=PtrInt(_dllparam);
-  DLL_Entry;
-end;
-{$endif VER3_0}
-
 //
 // Hardware exception handling
 //
@@ -346,32 +312,6 @@ procedure install_exception_handlers;
   end;
 {$endif ndef SYSTEM_USE_WIN_SEH}
 
-{$ifdef VER3_0}
-procedure LinkIn(p1,p2,p3: Pointer); inline;
-begin
-end;
-
-procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
-begin
-  IsConsole:=true;
-  GetConsoleMode(GetStdHandle((Std_Input_Handle)),@StartupConsoleMode);
-{$ifdef FPC_USE_TLS_DIRECTORY}
-  LinkIn(@_tls_used,@FreePascal_TLS_callback,@FreePascal_end_of_TLS_callback);
-{$endif FPC_USE_TLS_DIRECTORY}
-  Exe_entry;
-end;
-
-
-procedure _FPC_WinMainCRTStartup;stdcall;public name '_WinMainCRTStartup';
-begin
-  IsConsole:=false;
-{$ifdef FPC_USE_TLS_DIRECTORY}
-  LinkIn(@_tls_used,@FreePascal_TLS_callback,@FreePascal_end_of_TLS_callback);
-{$endif FPC_USE_TLS_DIRECTORY}
-  Exe_entry;
-end;
-{$endif VER3_0}
-
 {$ifdef FPC_SECTION_THREADVARS}
 function fpc_tls_add(addr: pointer): pointer; assembler; nostackframe;
   [public,alias: 'FPC_TLS_ADD']; compilerproc;

+ 0 - 16
rtl/win64/x86_64/cpuwin.inc

@@ -45,15 +45,9 @@ var
     to check if the call stack can be written on exceptions }
   _SS : Cardinal;
 
-{$ifdef VER3_0}
-procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
-{$else VER3_0}
 procedure Exe_entry(constref info: TEntryInformation);[public,alias:'_FPC_EXE_Entry'];
-{$endif VER3_0}
   begin
-{$ifndef VER3_0}
      SetupEntryInformation(info);
-{$endif VER3_0}
      IsLibrary:=false;
      { install the handlers for exe only ?
        or should we install them for DLL also ? (PM) }
@@ -67,15 +61,6 @@ procedure Exe_entry(constref info: TEntryInformation);[public,alias:'_FPC_EXE_En
         movl %eax,_SS(%rip)
         movq %rbp,%rsi
         xorq %rbp,%rbp
-{$ifdef VER3_0}
-{$ifdef FPC_USE_WIN64_SEH}
-        xor  %rcx,%rcx
-        lea  PASCALMAIN(%rip),%rdx
-        call main_wrapper
-{$else FPC_USE_WIN64_SEH}
-        call PASCALMAIN
-{$endif FPC_USE_WIN64_SEH}
-{$else VER3_0}
 {$ifdef FPC_USE_WIN64_SEH}
         xor  %rcx,%rcx
         lea  EntryInformation(%rip),%rdx
@@ -85,7 +70,6 @@ procedure Exe_entry(constref info: TEntryInformation);[public,alias:'_FPC_EXE_En
         lea  EntryInformation(%rip),%rdx
         call TEntryInformation.PascalMain(%rdx)
 {$endif FPC_USE_WIN64_SEH}
-{$endif VER3_0}
         movq %rsi,%rbp
      end ['RSI','RBP'];     { <-- specifying RSI allows compiler to save/restore it properly }
      { if we pass here there was no error ! }

+ 2 - 2
rtl/x86_64/cpuh.inc

@@ -36,10 +36,10 @@ function fpc_x86_get_fs:longint;[internproc:fpc_in_x86_get_fs];
 function fpc_x86_get_gs:longint;[internproc:fpc_in_x86_get_gs];
 
 { include automatically generated procs }
-{$if not defined(VER3_0) and not defined(VER3_2)}
+{$if not defined(VER3_2)}
 { do not active yet, they are not usable yet neither is the naming fixed }
 { $i cpummprocs.inc}
-{$endif not VER3_0 and not VER3_2}
+{$endif not VER3_2}
 
 type
   TNativeFPUControlWord = record

+ 0 - 13
rtl/x86_64/ports.inc

@@ -12,19 +12,6 @@
 
  **********************************************************************}
 
-{$IFDEF VER3_0}
-{ Bootstrapping kludge. Note that these do nothing, but since I/O port access is
-  not necessary for bootstrapping on any x86_64 target, these are only added to
-  make the rtl compile with 3.0.
-}
-procedure fpc_x86_outportb(p:longint;v:byte); begin end;
-procedure fpc_x86_outportw(p:longint;v:word); begin end;
-procedure fpc_x86_outportl(p:longint;v:longint); begin end;
-function fpc_x86_inportb(p:word):byte; begin fpc_x86_inportb:=0; end;
-function fpc_x86_inportw(p:word):word; begin fpc_x86_inportw:=0; end;
-function fpc_x86_inportl(p:word):longint; begin fpc_x86_inportl:=0; end;
-{$ENDIF VER3_0}
-
 { to give easy port access like tp with port[] }
 
 procedure tport.writeport(p : Longint;data : byte);inline;