Re: [gnome-db] recent GSEAL addition

Murray Cumming <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <1321047001.5588.3.camel@localhost>
On Fri, 2011-11-11 at 22:29 +0100, Murray Cumming wrote:
> OK. The API certainly is much nicer this way.
> 
> I wonder if this patch would be an ABI or API break. It makes wrapping
> GdaNumeric from language bindings much easier - in this case libgdamm.

Sorry, here is the patch.

-- 
[email protected]
www.murrayc.com
www.openismus.com

_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list
0001-GdaNumeric-Use-the-_-declaration-technique.patch (text/x-patch, 1.2 KB)
From 37b83c9c37e9e35b1b7036a1b6e85666fe311a0f Mon Sep 17 00:00:00 2001
From: Murray Cumming <[email protected]>
Date: Fri, 11 Nov 2011 22:26:49 +0100
Subject: [PATCH] GdaNumeric: Use the _ declaration technique.

This is what glib and GTK+ do. It allows the struct type to be
pre-declared elsewhere, without including the header, and without
causing a double declaration.
---
 libgda/gda-value.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libgda/gda-value.h b/libgda/gda-value.h
index 98fb8b9..394f063 100644
--- a/libgda/gda-value.h
+++ b/libgda/gda-value.h
@@ -74,6 +74,9 @@ typedef struct {
 	gdouble y;
 } GdaGeometricPoint;
 
+
+typedef struct _GdaNumeric GdaNumeric;
+
 /**
  * GdaNumeric:
  * @number: a string representing a number
@@ -88,14 +91,14 @@ typedef struct {
  * Set value func: gda_value_set_numeric
  * Get value func: gda_value_get_numeric
  */
-typedef struct {
+struct _GdaNumeric {
 	gchar*   GSEAL(number);
 	glong    GSEAL(precision);
 	glong    GSEAL(width);
 	
 	/*< private >*/
 	gpointer reserved; /* reserved for future usage with GMP (http://gmplib.org/) */
-} GdaNumeric;
+};
 
 /**
  * GdaTime:
-- 
1.7.7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.