Browse Source

* Removed {$ifdef fpc}s introduced in r6614 and 6615

git-svn-id: trunk@6788 -
joost 18 years ago
parent
commit
132e4f6f67

+ 0 - 2
packages/fcl-db/src/database.inc

@@ -290,11 +290,9 @@ end;
 Procedure TDBTransaction.InternalHandleException;
 
 begin
-  {$ifdef fpc}
   if assigned(classes.ApplicationHandleException) then
     classes.ApplicationHandleException(self)
   else
-  {$endif}
     ShowException(ExceptObject,ExceptAddr);
 end;
 

+ 0 - 19
packages/fcl-db/src/dataset.inc

@@ -658,7 +658,6 @@ end;
 Function TDataset.GetIsIndexField(Field: TField): Boolean;
 
 begin
-  //!! To be implemented
   Result:=False;
 end;
 
@@ -919,11 +918,9 @@ end;
 Procedure TDataset.InternalHandleException;
 
 begin
-{$ifdef fpc} 
   if assigned(classes.ApplicationHandleException) then
     classes.ApplicationHandleException(self)
   else
-{$endif}
     ShowException(ExceptObject,ExceptAddr);
 end;
 
@@ -1404,11 +1401,7 @@ begin
 {$endif}
     DoBeforeDelete;
     DoBeforeScroll;
-{$ifdef fpc}
     If Not TryDoing(@InternalDelete,OnPostError) then exit;
-{$else}
-    If Not TryDoing(InternalDelete,OnPostError) then exit;
-{$endif}
 {$ifdef dsdebug}
     writeln ('Delete: Internaldelete succeeded');
 {$endif}
@@ -1556,11 +1549,7 @@ begin
     Exit;
     end;
   DoBeforeEdit;
-{$ifdef fpc}  
   If Not TryDoing(@InternalEdit,OnEditError) then exit;
-{$else}
-  If Not TryDoing(InternalEdit,OnEditError) then exit;
-{$endif}
   GetCalcFields(ActiveBuffer);
   SetState(dsedit);
   DataEvent(deRecordChange,0);
@@ -1606,7 +1595,6 @@ Function TDataset.FindFirst: Boolean;
 
 begin
   Result:=False;
-  //!! To be implemented
 end;
 
 Function TDataset.FindLast: Boolean;
@@ -1614,7 +1602,6 @@ Function TDataset.FindLast: Boolean;
 
 begin
   Result:=False;
-  //!! To be implemented
 end;
 
 Function TDataset.FindNext: Boolean;
@@ -1622,7 +1609,6 @@ Function TDataset.FindNext: Boolean;
 
 begin
   Result:=False;
-  //!! To be implemented
 end;
 
 Function TDataset.FindPrior: Boolean;
@@ -1630,7 +1616,6 @@ Function TDataset.FindPrior: Boolean;
 
 begin
   Result:=False;
-  //!! To be implemented
 end;
 
 Procedure TDataset.First;
@@ -1920,11 +1905,7 @@ begin
     writeln ('Post: checking required fields');
 {$endif}
     DoBeforePost;
-{$ifdef fpc}
     If Not TryDoing(@InternalPost,OnPostError) then exit;
-{$else}
-    If Not TryDoing(InternalPost,OnPostError) then exit;
-{$endif}    
     cursorposchanged;
 {$ifdef dsdebug}
     writeln ('Post: Internalpost succeeded');

+ 5 - 32
packages/fcl-db/src/db.pas

@@ -16,28 +16,13 @@
  **********************************************************************}
 unit db;
 
-{$ifdef fpc}
 {$mode objfpc}
-{$endif}
 
 {$h+}
 
 interface
 
-uses Classes,Sysutils
-{$ifdef fpc}
-,Variants
-{$endif}
-// For compilation with Delphi. (Morfik)
-{$ifdef bpc}
-{$ifndef VER100} //d3
-{$ifndef VER120} //d4
-{$ifndef VER130} //d5
-,Variants
-{$endif VER120}
-{$endif VER130}
-{$endif VER100}
-{$endif};
+uses Classes,Sysutils,Variants;
 
 const
 
@@ -197,7 +182,7 @@ type
     procedure SetRequired(const AValue: Boolean);
   public
     constructor Create(AOwner: TFieldDefs; const AName: string;
-      ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint); {$ifdef fpc}overload;{$else}reintroduce;{$endif}
+      ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint); overload;
     destructor Destroy; override;
     procedure Assign(APersistent: TPersistent); override;
     function CreateField(AOwner: TComponent): TField;
@@ -226,10 +211,10 @@ type
     procedure Add(const AName: string; ADataType: TFieldType; ASize: Word); overload;
     procedure Add(const AName: string; ADataType: TFieldType); overload;
     Function AddFieldDef : TFieldDef;
-    procedure Assign(FieldDefs: TFieldDefs); {$ifdef fpc}overload;{$else}reintroduce;{$endif}
+    procedure Assign(FieldDefs: TFieldDefs); overload;
 //    procedure Clear;
 //    procedure Delete(Index: Longint);
-    procedure Update; {$ifdef fpc}overload;{$else}reintroduce;{$endif}
+    procedure Update; overload;
     Property HiddenFields : Boolean Read FHiddenFields Write FHiddenFields;
     property Items[Index: Longint]: TFieldDef read GetItem write SetItem; default;
   end;
@@ -857,12 +842,11 @@ type
     destructor Destroy; override;
     procedure Add(const Name, Fields: string; Options: TIndexOptions);
     Function AddIndexDef: TIndexDef;
-//    procedure Clear;
     function Find(const IndexName: string): TIndexDef;
     function FindIndexForFields(const Fields: string): TIndexDef;
     function GetIndexForFields(const Fields: string;
       CaseInsensitive: Boolean): TIndexDef;
-    procedure Update; {$ifdef fpc}overload;{$else}reintroduce;{$endif}
+    procedure Update; overload;
     Property Items[Index: Integer] : TIndexDef read GetItem write SetItem; default;
   end;
 
@@ -974,12 +958,7 @@ type
     var Accept: Boolean) of object;
 
   TDatasetClass = Class of TDataset;
-{$ifdef fpc}
   TBufferArray = ^pchar;
-{$else}
-  TTBufferArray = array[0..MaxInt div sizeof(pchar) - 1] of pchar;
-  TBufferArray = ^TTBufferArray;
-{$endif}  
 
   TDataSet = class(TComponent)
   Private
@@ -1848,12 +1827,6 @@ uses dbconst,typinfo, fmtbcd;
 { ---------------------------------------------------------------------
     Auxiliary functions
   ---------------------------------------------------------------------}
-{$ifndef fpc}
-Function VarIsClear(const V: Variant): Boolean;
-begin
-  Result:=VarIsEmpty(V);
-end;
-{$endif}
 
 Procedure DatabaseError (Const Msg : String);
 

+ 0 - 16
packages/fcl-db/src/dsparams.inc

@@ -513,11 +513,7 @@ begin
   If IsNull then
     Result:=0
   else
-{$ifdef fpc}
     Result:=FValue;
-{$else}
-    Result:=Integer(FValue);
-{$endif}    
 end;
 
 
@@ -613,11 +609,7 @@ end;
 
 Procedure TParam.SetAsLargeInt(AValue: LargeInt);
 begin
-{$ifdef fpc}
   FValue:=AValue;
-{$else}
-  FValue:=integer(AValue);
-{$endif}  
   FDataType:=ftLargeint;
 end;
 
@@ -654,27 +646,19 @@ begin
     case VarType(Value) of
       varBoolean  : FDataType:=ftBoolean;
       varSmallint,
-{$ifdef fpc}
       varShortInt,
-{$endif}
       varByte     : FDataType:=ftSmallInt;
-{$ifdef fpc}
       varWord,
-{$endif}      
       varInteger  : FDataType:=ftInteger;
       varCurrency : FDataType:=ftCurrency;
-{$ifdef fpc}
       varLongWord,
-{$endif}
       varSingle,
       varDouble   : FDataType:=ftFloat;
       varDate     : FDataType:=ftDateTime;
       varString,
       varOleStr   : if (FDataType<>ftFixedChar) then
                       FDataType:=ftString;
-{$ifdef fpc}
       varInt64    : FDataType:=ftLargeInt;
-{$endif}      
     else
       FDataType:=ftUnknown;
     end;

+ 0 - 12
packages/fcl-db/src/fields.inc

@@ -336,11 +336,7 @@ begin
       vtWideString:
         AsString := WideString(VWideString);
       vtInt64:
-{$ifdef fpc}
         Self.Value := VInt64^;
-{$else}
-        Self.Value := Integer(VInt64^);// Definitely wrong result !! MVC.
-{$endif}        
     else
       Error;
     end;
@@ -1313,11 +1309,7 @@ Var L : Largeint;
 
 begin
   If GetValue(L) then
-{$ifdef fpc}
     Result:=L
-{$else}
-    Result:=Integer(L); // Wrong result MVC.
-{$endif}    
   else
     Result:=Null;
 end;
@@ -1416,11 +1408,7 @@ end;
 
 procedure TLargeintField.SetVarValue(const AValue: Variant);
 begin
-{$ifdef fpc}
   SetAsLargeint(AValue);
-{$else}
-  SetAsLargeint(Integer(AValue));
-{$endif}
 end;
 
 Function TLargeintField.CheckRange(AValue : largeint) : Boolean;