[patch_done] TZIBEventAlerter and Delphi linker

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
trupka
Expert Boarder
Expert Boarder
Posts: 140
Joined: 26.08.2007, 22:10

[patch_done] TZIBEventAlerter and Delphi linker

Post 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',
You do not have the required permissions to view the files attached to this post.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
trupka
Expert Boarder
Expert Boarder
Posts: 140
Joined: 26.08.2007, 22:10

Post by trupka »

Tested with Delphi7 & 2007, works fine - UNDEFining ENABLE_INTERBASE removes unnecessary code.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Committed to 6.6-Patches branch. (= Maintenance branch for 6.6 stable version)

Mark
Image
Post Reply