[patch 02/15] [inlines.diff] fix the linking problems caused by G_INLINE_FUNC

c.shoemaker at cox.net c.shoemaker at cox.net
Mon Oct 10 10:34:24 EDT 2005


* src/app-utils/gnc-ui-util.c                 |    2 +-
* src/business/business-core/gncAddress.c     |    3 +--
* src/business/business-core/gncCustomer.c    |    3 +--
* src/business/business-core/gncEmployee.c    |    3 +--
* src/business/business-core/gncEntry.c       |    3 +--
* src/business/business-core/gncJob.c         |    3 +--
* src/business/business-core/gncOrder.c       |    3 +--
* src/business/business-core/gncVendor.c      |    3 +--
* src/engine/Account.c                        |    2 +-
* src/engine/Transaction.c                    |   11 +++++------
* src/register/register-gnome/gnucash-grid.c  |    2 +-
* src/register/register-gnome/gnucash-sheet.c |    2 +-
   - This patch fixes linking errors that I was getting from the use
     of G_INLINE_FUNC.  I think that what was happening was that the
     G_INLINE_FUNC macro was expanding to 'extern inline' even in the
     function definition.  Evidentally, in that case, the symbol has 
     external linkage and is marked as undefined in the object's symbol
     table.  My approach to fix this is to remove G_INLINE_FUNC from
     function definitions, while leaving it on function declarations.  I
     don't know if this prevents inlines, but it at least marks the symbol
     as defined which lets me link the objects.


 src/app-utils/gnc-ui-util.c                 |    2 +-
 src/business/business-core/gncAddress.c     |    3 +--
 src/business/business-core/gncCustomer.c    |    3 +--
 src/business/business-core/gncEmployee.c    |    3 +--
 src/business/business-core/gncEntry.c       |    3 +--
 src/business/business-core/gncJob.c         |    3 +--
 src/business/business-core/gncOrder.c       |    3 +--
 src/business/business-core/gncVendor.c      |    3 +--
 src/engine/Account.c                        |    2 +-
 src/engine/Transaction.c                    |   11 +++++------
 src/register/register-gnome/gnucash-grid.c  |    2 +-
 src/register/register-gnome/gnucash-sheet.c |    2 +-
 12 files changed, 16 insertions(+), 24 deletions(-)

Index: gnucash/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash.orig/src/app-utils/gnc-ui-util.c
+++ gnucash/src/app-utils/gnc-ui-util.c
@@ -1518,7 +1518,7 @@ typedef enum
 
 G_INLINE_FUNC long long int multiplier (int num_decimals);
 
-G_INLINE_FUNC long long int
+long long int
 multiplier (int num_decimals)
 {
   switch (num_decimals)
Index: gnucash/src/business/business-core/gncAddress.c
===================================================================
--- gnucash.orig/src/business/business-core/gncAddress.c
+++ gnucash/src/business/business-core/gncAddress.c
@@ -56,8 +56,7 @@ struct _gncAddress 
 #define CACHE_REMOVE(str) g_cache_remove(gnc_engine_get_string_cache(), (str));
 
 G_INLINE_FUNC void mark_address (GncAddress *address);
-G_INLINE_FUNC void
-mark_address (GncAddress *address)
+void mark_address (GncAddress *address)
 {
   address->dirty = TRUE;
 
Index: gnucash/src/business/business-core/gncCustomer.c
===================================================================
--- gnucash.orig/src/business/business-core/gncCustomer.c
+++ gnucash/src/business/business-core/gncCustomer.c
@@ -80,8 +80,7 @@ static QofLogModule log_module = GNC_MOD
 #define CACHE_REMOVE(str) g_cache_remove(gnc_engine_get_string_cache(), (str));
 
 G_INLINE_FUNC void mark_customer (GncCustomer *customer);
-G_INLINE_FUNC void
-mark_customer (GncCustomer *customer)
+void mark_customer (GncCustomer *customer)
 {
   customer->inst.dirty = TRUE;
   qof_collection_mark_dirty (customer->inst.entity.collection);
Index: gnucash/src/business/business-core/gncEmployee.c
===================================================================
--- gnucash.orig/src/business/business-core/gncEmployee.c
+++ gnucash/src/business/business-core/gncEmployee.c
@@ -63,8 +63,7 @@ static QofLogModule log_module = GNC_MOD
 #define CACHE_REMOVE(str) g_cache_remove(gnc_engine_get_string_cache(), (str));
 
 G_INLINE_FUNC void mark_employee (GncEmployee *employee);
-G_INLINE_FUNC void
-mark_employee (GncEmployee *employee)
+void mark_employee (GncEmployee *employee)
 {
   employee->inst.dirty = TRUE;
   qof_collection_mark_dirty (employee->inst.entity.collection);
Index: gnucash/src/business/business-core/gncEntry.c
===================================================================
--- gnucash.orig/src/business/business-core/gncEntry.c
+++ gnucash/src/business/business-core/gncEntry.c
@@ -170,8 +170,7 @@ gboolean gncEntryPaymentStringToType (co
 	}
 
 G_INLINE_FUNC void mark_entry (GncEntry *entry);
-G_INLINE_FUNC void
-mark_entry (GncEntry *entry)
+void mark_entry (GncEntry *entry)
 {
   entry->inst.dirty = TRUE;
   qof_collection_mark_dirty (entry->inst.entity.collection);
Index: gnucash/src/business/business-core/gncJob.c
===================================================================
--- gnucash.orig/src/business/business-core/gncJob.c
+++ gnucash/src/business/business-core/gncJob.c
@@ -58,8 +58,7 @@ static QofLogModule log_module = GNC_MOD
 #define CACHE_REMOVE(str) g_cache_remove(gnc_engine_get_string_cache(), (str));
 
 G_INLINE_FUNC void mark_job (GncJob *job);
-G_INLINE_FUNC void
-mark_job (GncJob *job)
+void mark_job (GncJob *job)
 {
   job->inst.dirty = TRUE;
   qof_collection_mark_dirty (job->inst.entity.collection);
Index: gnucash/src/business/business-core/gncOrder.c
===================================================================
--- gnucash.orig/src/business/business-core/gncOrder.c
+++ gnucash/src/business/business-core/gncOrder.c
@@ -71,8 +71,7 @@ static QofLogModule log_module = GNC_MOD
 	}
 
 G_INLINE_FUNC void mark_order (GncOrder *order);
-G_INLINE_FUNC void
-mark_order (GncOrder *order)
+void mark_order (GncOrder *order)
 {
   order->inst.dirty = TRUE;
   qof_collection_mark_dirty (order->inst.entity.collection);
Index: gnucash/src/business/business-core/gncVendor.c
===================================================================
--- gnucash.orig/src/business/business-core/gncVendor.c
+++ gnucash/src/business/business-core/gncVendor.c
@@ -69,8 +69,7 @@ static QofLogModule log_module = GNC_MOD
 #define CACHE_REMOVE(str) g_cache_remove(gnc_engine_get_string_cache(), (str));
 
 G_INLINE_FUNC void mark_vendor (GncVendor *vendor);
-G_INLINE_FUNC void
-mark_vendor (GncVendor *vendor)
+void mark_vendor (GncVendor *vendor)
 {
   vendor->inst.dirty = TRUE;
   qof_collection_mark_dirty (vendor->inst.entity.collection);
Index: gnucash/src/engine/Account.c
===================================================================
--- gnucash.orig/src/engine/Account.c
+++ gnucash/src/engine/Account.c
@@ -53,7 +53,7 @@ static void xaccAccountBringUpToDate (Ac
 \********************************************************************/
 
 G_INLINE_FUNC void mark_account (Account *account);
-G_INLINE_FUNC void
+void
 mark_account (Account *account)
 {
   if (account->parent) account->parent->saved = FALSE;
Index: gnucash/src/engine/Transaction.c
===================================================================
--- gnucash.orig/src/engine/Transaction.c
+++ gnucash/src/engine/Transaction.c
@@ -78,8 +78,7 @@ const char *void_former_notes_str = "voi
 static QofLogModule log_module = GNC_MOD_ENGINE;
 
 G_INLINE_FUNC void check_open (Transaction *trans);
-G_INLINE_FUNC void
-check_open (Transaction *trans)
+void check_open (Transaction *trans)
 {
   if (trans && 0 >= trans->inst.editlevel)
   {
@@ -512,7 +511,7 @@ xaccSplitDetermineGainStatus (Split *spl
 #define SET_GAINS_VDIRTY(s)  SET_GAINS_DIRTY(s,GAINS_STATUS_VDIRTY);
 
 G_INLINE_FUNC void mark_split (Split *s);
-G_INLINE_FUNC void mark_split (Split *s)
+void mark_split (Split *s)
 {
   Account *account = s->acc;
 
@@ -528,7 +527,7 @@ G_INLINE_FUNC void mark_split (Split *s)
 
 
 G_INLINE_FUNC void mark_trans (Transaction *trans);
-G_INLINE_FUNC void mark_trans (Transaction *trans)
+void mark_trans (Transaction *trans)
 {
   GList *node;
 
@@ -539,7 +538,7 @@ G_INLINE_FUNC void mark_trans (Transacti
 }
 
 G_INLINE_FUNC void gen_event (Split *split);
-G_INLINE_FUNC void gen_event (Split *split)
+void gen_event (Split *split)
 {
   Account *account = split->acc;
   Transaction *trans = split->parent;
@@ -564,7 +563,7 @@ G_INLINE_FUNC void gen_event (Split *spl
 }
 
 G_INLINE_FUNC void gen_event_trans (Transaction *trans);
-G_INLINE_FUNC void gen_event_trans (Transaction *trans)
+void gen_event_trans (Transaction *trans)
 {
   GList *node;
 
Index: gnucash/src/register/register-gnome/gnucash-grid.c
===================================================================
--- gnucash.orig/src/register/register-gnome/gnucash-grid.c
+++ gnucash/src/register/register-gnome/gnucash-grid.c
@@ -256,7 +256,7 @@ draw_cell_line (GdkDrawable *drawable,
                 int x1, int y1, int x2, int y2,
                 PhysicalCellBorderLineStyle style);
 
-G_INLINE_FUNC void
+void
 draw_cell_line (GdkDrawable *drawable,
                 GdkGC *gc, GdkColor *bg_color,
                 int x1, int y1, int x2, int y2,
Index: gnucash/src/register/register-gnome/gnucash-sheet.c
===================================================================
--- gnucash.orig/src/register/register-gnome/gnucash-sheet.c
+++ gnucash/src/register/register-gnome/gnucash-sheet.c
@@ -85,7 +85,7 @@ gnucash_register_set_initial_rows (guint
 G_INLINE_FUNC gboolean
 gnucash_sheet_virt_cell_out_of_bounds (GnucashSheet *sheet,
                                        VirtualCellLocation vcell_loc);
-G_INLINE_FUNC gboolean
+gboolean
 gnucash_sheet_virt_cell_out_of_bounds (GnucashSheet *sheet,
                                        VirtualCellLocation vcell_loc)
 {

--


More information about the gnucash-devel mailing list