loris.luise
24-Nov-2010, 06:01 PM
Hello,
I think that Eurekalog has a odd behaviour when we have a Delphi DPR
file using conditional compilation.
Please consider this DPR
//
//
//{$define SERVICE}
//{$define ISAPI}
{$define APACHE2}
{$ifdef APACHE2}
{$E so} //change binary file extension from .dll to .so
{$LIBPREFIX 'mod_'} //prefix binary file name with mod_
library hydroweb;
{$else}
program HydroWeb;
{$endif}
uses
{$if not defined(APACHE2)}
FastMM4,
{$ifend}
{$if defined(APACHE2)}
IWInitApacheTwo,
ApacheTwoApp,
{$elseif defined(ISAPI)}
IWInitISAPI,
ISAPIApp,
{$elseif defined(SERVICE)}
IWInitService,
{$else}
Forms,
IWMain,
{$ifend}
IWUnitDmServerController in 'IWUnitDmServerController.pas' {IWServerController: TIWServerController},
IWUnitFrmMain in 'IWUnitFrmMain.pas' {frmMainForm: TIWAppForm};
{$ifdef APACHE2}
exports
apache_module name 'my_module';
{$endif}
{$R *.res}
begin
{$if defined(APACHE2)}
ModuleName := 'my_module';
Handler := 'mod_my-handler';
IWRun;
{$elseif defined(SERVICE)}
IWRun;
{$else}
try
Application.Initialize;
Application.Title := '';
Application.CreateForm(TformIWMain, formIWMain);
Application.Run;
finally
end;
{$ifend}
end.
and try to activate Eurekalog.... you'll never be able to compile it because
Eurekalog places USES in wrong position, too early. So, if I place dummy USES in non conditional compiled segments,
I can lately compile with success...
Watch this please...
------------------------
//
//
//{$define SERVICE}
//{$define ISAPI}
{$define APACHE2}
{$ifdef APACHE2}
{$E so} //change binary file extension from .dll to .so
{$LIBPREFIX 'mod_'} //prefix binary file name with mod_
//uses ExceptionLog; <<<---- only for uncomment if i change CONDITIONAL DEFINES
library hydroweb;
{$else}
// dummy uses for EL in never compiled area
// to prevent EL to place uses ExceptionLog too early in wrong place
uses ExceptionLog;
program HydroWeb;
{$endif}
uses
{$if not defined(APACHE2)}
FastMM4,
{$ifend}
ExceptionLog,
{$if defined(APACHE2)}
IWInitApacheTwo,
ApacheTwoApp,
{$elseif defined(ISAPI)}
IWInitISAPI,
ISAPIApp,
{$elseif defined(SERVICE)}
IWInitService,
{$else}
Forms,
IWMain,
{$ifend}
IWUnitDmServerController in 'IWUnitDmServerController.pas' {IWServerController: TIWServerController},
IWUnitFrmMain in 'IWUnitFrmMain.pas' {frmMainForm: TIWAppForm};
{$ifdef APACHE2}
exports
apache_module name 'my_module';
{$endif}
{$R *.res}
begin
{$if defined(APACHE2)}
ModuleName := 'my_module';
Handler := 'mod_my-handler';
IWRun;
{$elseif defined(SERVICE)}
IWRun;
{$else}
try
Application.Initialize;
Application.Title := '';
Application.CreateForm(TformIWMain, formIWMain);
Application.Run;
finally
end;
{$ifend}
end.
--------------
Thanks
I think that Eurekalog has a odd behaviour when we have a Delphi DPR
file using conditional compilation.
Please consider this DPR
//
//
//{$define SERVICE}
//{$define ISAPI}
{$define APACHE2}
{$ifdef APACHE2}
{$E so} //change binary file extension from .dll to .so
{$LIBPREFIX 'mod_'} //prefix binary file name with mod_
library hydroweb;
{$else}
program HydroWeb;
{$endif}
uses
{$if not defined(APACHE2)}
FastMM4,
{$ifend}
{$if defined(APACHE2)}
IWInitApacheTwo,
ApacheTwoApp,
{$elseif defined(ISAPI)}
IWInitISAPI,
ISAPIApp,
{$elseif defined(SERVICE)}
IWInitService,
{$else}
Forms,
IWMain,
{$ifend}
IWUnitDmServerController in 'IWUnitDmServerController.pas' {IWServerController: TIWServerController},
IWUnitFrmMain in 'IWUnitFrmMain.pas' {frmMainForm: TIWAppForm};
{$ifdef APACHE2}
exports
apache_module name 'my_module';
{$endif}
{$R *.res}
begin
{$if defined(APACHE2)}
ModuleName := 'my_module';
Handler := 'mod_my-handler';
IWRun;
{$elseif defined(SERVICE)}
IWRun;
{$else}
try
Application.Initialize;
Application.Title := '';
Application.CreateForm(TformIWMain, formIWMain);
Application.Run;
finally
end;
{$ifend}
end.
and try to activate Eurekalog.... you'll never be able to compile it because
Eurekalog places USES in wrong position, too early. So, if I place dummy USES in non conditional compiled segments,
I can lately compile with success...
Watch this please...
------------------------
//
//
//{$define SERVICE}
//{$define ISAPI}
{$define APACHE2}
{$ifdef APACHE2}
{$E so} //change binary file extension from .dll to .so
{$LIBPREFIX 'mod_'} //prefix binary file name with mod_
//uses ExceptionLog; <<<---- only for uncomment if i change CONDITIONAL DEFINES
library hydroweb;
{$else}
// dummy uses for EL in never compiled area
// to prevent EL to place uses ExceptionLog too early in wrong place
uses ExceptionLog;
program HydroWeb;
{$endif}
uses
{$if not defined(APACHE2)}
FastMM4,
{$ifend}
ExceptionLog,
{$if defined(APACHE2)}
IWInitApacheTwo,
ApacheTwoApp,
{$elseif defined(ISAPI)}
IWInitISAPI,
ISAPIApp,
{$elseif defined(SERVICE)}
IWInitService,
{$else}
Forms,
IWMain,
{$ifend}
IWUnitDmServerController in 'IWUnitDmServerController.pas' {IWServerController: TIWServerController},
IWUnitFrmMain in 'IWUnitFrmMain.pas' {frmMainForm: TIWAppForm};
{$ifdef APACHE2}
exports
apache_module name 'my_module';
{$endif}
{$R *.res}
begin
{$if defined(APACHE2)}
ModuleName := 'my_module';
Handler := 'mod_my-handler';
IWRun;
{$elseif defined(SERVICE)}
IWRun;
{$else}
try
Application.Initialize;
Application.Title := '';
Application.CreateForm(TformIWMain, formIWMain);
Application.Run;
finally
end;
{$ifend}
end.
--------------
Thanks