[patch 1/4] fix the linking problems caused by G_INLINE_FUNC

c.shoemaker at cox.net c.shoemaker at cox.net
Fri Jul 22 14:16:29 EDT 2005


 * 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.

 app-utils/gnc-ui-util.c                 |    2 +-
 business/business-core/gncAddress.c     |    3 +--
 business/business-core/gncCustomer.c    |    3 +--
 business/business-core/gncEmployee.c    |    3 +--
 business/business-core/gncEntry.c       |    3 +--
 business/business-core/gncJob.c         |    3 +--
 business/business-core/gncOrder.c       |    3 +--
 business/business-core/gncVendor.c      |    3 +--
 engine/Account.c                        |    2 +-
 engine/Transaction.c                    |   11 +++++------
 register/register-gnome/gnucash-grid.c  |    2 +-
 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
@@ -1522,7 +1522,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
@@ -62,8 +62,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
@@ -90,8 +90,7 @@ static short module = MOD_BUSINESS;
 #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
@@ -79,8 +79,7 @@ static short        module = MOD_BUSINES
 #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
@@ -185,8 +185,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
@@ -74,8 +74,7 @@ static short        module = MOD_BUSINES
 #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
@@ -89,8 +89,7 @@ static short	module = MOD_BUSINESS;
 	}
 
 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
@@ -84,8 +84,7 @@ static short        module = MOD_BUSINES
 #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
@@ -71,7 +71,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
@@ -90,8 +90,7 @@ const char *void_former_notes_str = "voi
 static short module = 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)
   {
@@ -524,7 +523,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;
 
@@ -540,7 +539,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;
 
@@ -551,7 +550,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;
@@ -576,7 +575,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
@@ -84,7 +84,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-patches mailing list