From 2f36675adb75051526074f5bed7d18481e8c8159 Mon Sep 17 00:00:00 2001 From: Peter TB Brett Date: Sun, 11 Dec 2011 20:04:24 +0000 Subject: [PATCH] libgeda: Enable use from C++ programs. Use G_BEGIN_DECLS and G_END_DECLS to make sure function prototypes are declared with C linkage where appropriate. Closes-bug: lp-698708 --- libgeda/include/libgeda/edaerrors.h | 4 ++++ libgeda/include/libgeda/geda_list.h | 4 ++++ libgeda/include/libgeda/prototype.h | 3 +++ 3 files changed, 11 insertions(+) diff --git a/libgeda/include/libgeda/edaerrors.h b/libgeda/include/libgeda/edaerrors.h index cda48ae92..ce7f00236 100644 --- a/libgeda/include/libgeda/edaerrors.h +++ b/libgeda/include/libgeda/edaerrors.h @@ -17,6 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */ +G_BEGIN_DECLS + /*! Domain for GErrors originating in libgeda. */ #define EDA_ERROR eda_error_quark () @@ -28,3 +30,5 @@ typedef enum { } EdaError; GQuark eda_error_quark (void); + +G_END_DECLS diff --git a/libgeda/include/libgeda/geda_list.h b/libgeda/include/libgeda/geda_list.h index a849606e8..4f8b6e613 100644 --- a/libgeda/include/libgeda/geda_list.h +++ b/libgeda/include/libgeda/geda_list.h @@ -22,6 +22,8 @@ #ifndef __GEDA_LIST_H__ #define __GEDA_LIST_H__ +G_BEGIN_DECLS + #define GEDA_TYPE_LIST (geda_list_get_type()) #define GEDA_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDA_TYPE_LIST, GedaList)) #define GEDA_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDA_TYPE_LIST, GedaListClass)) @@ -56,5 +58,7 @@ void geda_list_remove_all( GedaList *list ); /*const GList *geda_list_get_glist( GedaList *list ); */ #define geda_list_get_glist(list) (list->glist) +G_END_DECLS + #endif /* __GEDA_LIST_H__ */ diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h index 756d5838c..9e9f0bcdb 100644 --- a/libgeda/include/libgeda/prototype.h +++ b/libgeda/include/libgeda/prototype.h @@ -1,3 +1,4 @@ +G_BEGIN_DECLS /* a_basic.c */ const gchar *o_file_format_header(); @@ -435,3 +436,5 @@ void s_undo_free_all(TOPLEVEL *toplevel, PAGE *p_current); /* u_basic.c */ char *u_basic_breakup_string(char *string, char delimiter, int count); + +G_END_DECLS -- 2.11.4.GIT