Page 1 of 1

[patch_done] TZIBEventAlerter and Delphi linker

Posted: 12.08.2008, 18:57
by trupka
After introducing TZIBEventAlerter component, Interbase/firebird units are always linked into app, used or not. This unnecessary increases exe size approx. 100k. Commenting ENABLE_INTERBASE in Zeos.inc wont help either.
Problem lies in ZComponentReg.pas which always uses ZIBEventAlerter unit, no matter ENABLE_INTERBASE is defined or not. So...here's patch against trunk, rev408:

Code: Select all

Index: src/component/ZComponentReg.pas
===================================================================
--- src/component/ZComponentReg.pas	(revision 410)
+++ src/component/ZComponentReg.pas	(working copy)
@@ -87,7 +87,8 @@
 {$ENDIF}
 {$ENDIF}
   Classes, ZConnection, ZDataset, ZSqlUpdate, ZSqlProcessor, ZStoredProcedure,
-  ZSqlMonitor, ZSqlMetadata, ZSequence, ZIBEventAlerter;
+  ZSqlMonitor, ZSqlMetadata, ZSequence 
+  {$IFDEF ENABLE_INTERBASE}, ZIBEventAlerter {$ENDIF ENABLE_INTERBASE};
 
 {**
   Registers components in a component palette.
@@ -96,7 +97,8 @@
 begin
   RegisterComponents(ZEOS_DB_PALETTE, [
     TZConnection, TZReadOnlyQuery, TZQuery, TZTable, TZUpdateSQL,
-    TZStoredProc, TZSQLMetadata, TZSQLProcessor, TZSQLMonitor, TZSequence, TZIBEventAlerter]);
+    TZStoredProc, TZSQLMetadata, TZSQLProcessor, TZSQLMonitor, TZSequence 
+	{$IFDEF ENABLE_INTERBASE}, TZIBEventAlerter {$ENDIF ENABLE_INTERBASE}]);
 
 {$IFDEF WITH_PROPERTY_EDITOR}
   RegisterPropertyEditor(TypeInfo(string), TZConnection, 'Protocol',

Posted: 12.08.2008, 23:47
by mdaems
Committed to testing branch. Rev 411. Please confirm if this solves the problem. I might backport this one to a future zeoslib 6.6 maintenance release.

Mark

Posted: 13.08.2008, 16:13
by trupka
Tested with Delphi7 & 2007, works fine - UNDEFining ENABLE_INTERBASE removes unnecessary code.

Posted: 13.08.2008, 20:09
by mdaems
Committed to 6.6-Patches branch. (= Maintenance branch for 6.6 stable version)

Mark