Permalink
Browse files

circumvent Delphi 5 compiler bug

  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Feb 3, 2018
1 parent 4bf0fbd commit a9525a27a3541ea488e1eaeae63835dec7669572
Showing with 23 additions and 23 deletions.
  1. +2 −2 SynBidirSock.pas
  2. +4 −4 SynDBODBC.pas
  3. +4 −4 SynDBOracle.pas
  4. +8 −8 SynOleDB.pas
  5. +2 −2 SynProtoRTSPHTTP.pas
  6. +2 −2 SynSQLite3.pas
  7. +1 −1 SynopseCommit.inc
@@ -2261,7 +2261,7 @@ destructor TWebSocketProcess.Destroy;
timeout: Int64;
log: ISynLog;
begin
log := WebSocketLog.Enter(self, 'Destroy');
log := WebSocketLog.Enter(self{$ifndef DELPHI5OROLDER},'Destroy'{$endif});
if (fState<>wpsClose) and not fNoConnectionCloseAtDestroy then
try
InterlockedIncrement(fProcessCount);
@@ -3605,7 +3605,7 @@ procedure TAsynchConnections.IdleEverySecond;
if fConnection[i].fLastOperation<allowed then
try
if log=nil then
log := fLog.Enter(self, 'IdleEverySecond');
log := fLog.Enter(self{$ifndef DELPHI5OROLDER},'IdleEverySecond'{$endif});
fConnection[i].OnLastOperationIdle(self);
inc(n);
except
@@ -1190,7 +1190,7 @@ procedure TODBCConnection.Connect;
constructor TODBCConnection.Create(aProperties: TSQLDBConnectionProperties);
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self, 'Create');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Create'{$endif});
if not aProperties.InheritsFrom(TODBCConnectionProperties) then
raise EODBCException.CreateUTF8('Invalid %.Create(%)',[self,aProperties]);
fODBCProperties := TODBCConnectionProperties(aProperties);
@@ -1211,7 +1211,7 @@ procedure TODBCConnection.Disconnect;
finally
if (ODBC<>nil) and (fDbc<>nil) then
with ODBC do begin
SynDBLog.Enter(self, 'Disconnect');
SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Disconnect'{$endif});
Disconnect(fDbc);
FreeHandle(SQL_HANDLE_DBC,fDbc);
fDbc := nil;
@@ -1645,7 +1645,7 @@ function CType2SQL(CDataType: integer): integer;
inherited ExecutePrepared; // set fConnection.fLastAccessTicks
DriverDoesNotHandleUnicode := TODBCConnection(fConnection).fODBCProperties.fDriverDoesNotHandleUnicode;
if fSQL<>'' then
with SynDBLog.Enter(Self,nil,true).Instance do
with SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'ExecutePrepared'{$endif}).Instance do
if sllSQL in Family.Level then
Log(sllSQL,SQLWithInlinedParams,self,2048);
try
@@ -1768,7 +1768,7 @@ function TODBCStatement.UpdateCount: integer;
procedure TODBCStatement.Prepare(const aSQL: RawUTF8; ExpectResults: Boolean);
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self,nil,true);
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Prepare'{$endif});
if (fStatement<>nil) or (fColumnCount>0) then
raise EODBCException.CreateUTF8('%.Prepare should be called only once',[self]);
// 1. process SQL
@@ -1947,7 +1947,7 @@ procedure TSQLDBOracleConnection.Connect;
type_Varchar2ListName: RawUTF8 = 'ODCIVARCHAR2LIST';
type_Credential: array[boolean] of integer = (OCI_CRED_RDBMS,OCI_CRED_EXT);
begin
Log := SynDBLog.Enter(self, 'Connect');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Connect'{$endif});
Disconnect; // force fTrans=fError=fServer=fContext=nil
Props := Properties as TSQLDBOracleConnectionProperties;
with OCI do
@@ -2039,7 +2039,7 @@ procedure TSQLDBOracleConnection.Connect;
constructor TSQLDBOracleConnection.Create(aProperties: TSQLDBConnectionProperties);
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self, 'Create');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Create'{$endif});
if not aProperties.InheritsFrom(TSQLDBOracleConnectionProperties) then
raise ESQLDBOracle.CreateUTF8('Invalid %.Create(%)',[self,aProperties]);
OCI.RetrieveVersion;
@@ -2061,7 +2061,7 @@ procedure TSQLDBOracleConnection.Disconnect;
finally
if (fError<>nil) and (OCI<>nil) then
with OCI do begin
Log := SynDBLog.Enter(self, 'Disconnect');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Disconnect'{$endif});
if fTrans<>nil then begin
// close any opened session
HandleFree(fTrans,OCI_HTYPE_TRANS);
@@ -2145,7 +2145,7 @@ procedure TSQLDBOracleConnection.Rollback;
procedure TSQLDBOracleConnection.StartTransaction;
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self, 'StartTransaction');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'StartTransaction'{$endif});
if TransactionCount>0 then
raise ESQLDBOracle.CreateUTF8('Invalid %.StartTransaction: nested '+
'transactions are not supported by the Oracle driver',[self]);
@@ -2307,7 +2307,7 @@ procedure TOleDBConnection.Connect;
unknown: IUnknown;
Log: ISynLog;
begin
Log := SynDBLog.Enter(self, 'Connect');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Connect'{$endif});
// check context
if Connected then
Disconnect;
@@ -2345,7 +2345,7 @@ procedure TOleDBConnection.Connect;
constructor TOleDBConnection.Create(aProperties: TSQLDBConnectionProperties);
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self, 'Create');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Create'{$endif});
if not aProperties.InheritsFrom(TOleDBConnectionProperties) then
raise EOleDBException.CreateUTF8('Invalid %.Create(%)',[self,aProperties]);
fOleDBProperties := TOleDBConnectionProperties(aProperties);
@@ -2357,7 +2357,7 @@ constructor TOleDBConnection.Create(aProperties: TSQLDBConnectionProperties);
destructor TOleDBConnection.Destroy;
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self, 'Destroy');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Destroy'{$endif});
try
inherited Destroy; // call Disconnect;
fMalloc := nil;
@@ -2371,7 +2371,7 @@ destructor TOleDBConnection.Destroy;
procedure TOleDBConnection.Disconnect;
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self, 'Disconnect');
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Disconnect'{$endif});
try
inherited Disconnect; // flush any cached statement
finally
@@ -2465,7 +2465,7 @@ procedure TOleDBConnection.OnDBInitialized;
procedure TOleDBConnection.Commit;
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self,nil,true);
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Commit'{$endif});
if assigned(fTransaction) then begin
inherited Commit;
try
@@ -2480,7 +2480,7 @@ procedure TOleDBConnection.Commit;
procedure TOleDBConnection.Rollback;
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self,nil,true);
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Rollback'{$endif});
if assigned(fTransaction) then begin
inherited Rollback;
OleDbCheck(nil,fTransaction.Abort(nil,False,False));
@@ -2490,7 +2490,7 @@ procedure TOleDBConnection.Rollback;
procedure TOleDBConnection.StartTransaction;
var Log: ISynLog;
begin
Log := SynDBLog.Enter(self,nil,true);
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'StartTransaction'{$endif});
if assigned(fTransaction) then begin
inherited StartTransaction;
OleDbCheck(nil,fTransaction.StartTransaction(ISOLATIONLEVEL_READCOMMITTED,0,nil,nil));
@@ -2508,7 +2508,7 @@ function TOleDBConnectionProperties.ConnectionStringDialogExecute(Parent: HWND):
tmp: PWideChar;
Log: ISynLog;
begin
Log := SynDBLog.Enter(self,nil,true);
Log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'ConnectionStringDialog'{$endif});
result := false;
if self<>nil then
try
@@ -223,7 +223,7 @@ constructor TRTSPOverHTTPServer.Create(const aRtspServer, aRtspPort, aHttpPort:
destructor TRTSPOverHTTPServer.Destroy;
var log: ISynLog;
begin
log := fLog.Enter(self, 'Destroy');
log := fLog.Enter(self{$ifndef DELPHI5OROLDER},'Destroy'{$endif});
inherited Destroy;
fPendingGet.Free;
end;
@@ -378,7 +378,7 @@ TReq = record
text: SockString;
log: ISynLog;
begin // here we follow the steps and content stated by https://goo.gl/CX6VA3
log := fLog.Enter(self, 'RegressionTests');
log := fLog.Enter(self{$ifndef DELPHI5OROLDER},'Tests'{$endif});
if (self = nil) or (fRtspServer <> '127.0.0.1') then
test.Check(false, 'expect a running proxy on 127.0.0.1')
else
@@ -3969,7 +3969,7 @@ procedure TSQLDataBase.ExecuteAll(const aSQL: RawUTF8);
exit; // avoid GPF in case of call from a static-only server
{$ifdef WITHLOG}
if SQLShouldBeLogged(aSQL) then begin
log := fLog.Enter(self, 'ExecuteAll');
log := fLog.Enter(self{$ifndef DELPHI5OROLDER},'ExecuteAll'{$endif});
log.Log(sllSQL,aSQL,self,4096);
{$endif}
end;
@@ -4009,7 +4009,7 @@ function TSQLDataBase.Execute(const aSQL: RawUTF8; var ID: TInt64DynArray): inte
end;
{$ifdef WITHLOG}
if SQLShouldBeLogged(aSQL) then begin
log := fLog.Enter(self, 'Execute');
log := fLog.Enter(self{$ifndef DELPHI5OROLDER},'Execute'{$endif});
log.Log(sllSQL,aSQL,self,2048);
end;
{$endif}
@@ -1 +1 @@
'1.18.4219'
'1.18.4220'

0 comments on commit a9525a2

Please sign in to comment.