diff --git a/bindings/app-utils.i b/bindings/app-utils.i index fe141ac14b..96430c3034 100644 --- a/bindings/app-utils.i +++ b/bindings/app-utils.i @@ -22,10 +22,6 @@ %{ /* Includes the header in the wrapper code */ #include -#ifdef __cplusplus -extern "C" -{ -#endif #include #include #include @@ -36,18 +32,14 @@ extern "C" #endif #include #include - -#ifdef __cplusplus -} -#endif %} #if defined(SWIGGUILE) //Always C++ %{ -extern "C" -{ #include "guile-mappings.h" +extern "C" +{ SCM scm_init_sw_app_utils_module (void); } %} diff --git a/bindings/engine.i b/bindings/engine.i index 2dbd47e0f5..186a0860a8 100644 --- a/bindings/engine.i +++ b/bindings/engine.i @@ -23,11 +23,6 @@ /* Includes the header in the wrapper code */ #include -#ifdef __cplusplus -extern "C" -{ -#endif - #include #include "qof.h" #include "qoflog.h" @@ -58,9 +53,6 @@ extern "C" #include "gncTaxTable.h" #include "gncVendor.h" -#ifdef __cplusplus -} -#endif %} #if defined(SWIGGUILE) //Always C++ %{ diff --git a/bindings/guile/glib-guile.h b/bindings/guile/glib-guile.h index d22578eaf7..d6123d0fdd 100644 --- a/bindings/guile/glib-guile.h +++ b/bindings/guile/glib-guile.h @@ -28,6 +28,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + SCM gnc_glist_to_scm_list(GList *glist, const gchar *wct); GList* gnc_scm_list_to_glist(SCM wcp_list); @@ -37,4 +41,8 @@ int gnc_glist_string_p(SCM list); GSList * gnc_scm_to_gslist_string(SCM list); +#ifdef __cplusplus +} +#endif + #endif diff --git a/bindings/guile/gnc-engine-guile.cpp b/bindings/guile/gnc-engine-guile.cpp index 4470adb201..d9f56f0eee 100644 --- a/bindings/guile/gnc-engine-guile.cpp +++ b/bindings/guile/gnc-engine-guile.cpp @@ -27,8 +27,7 @@ #include "swig-runtime.h" #include #include -extern "C" -{ + #include "Account.h" #include "engine-helpers.h" #include "gnc-engine-guile.h" @@ -43,7 +42,6 @@ extern "C" #ifndef HAVE_STRPTIME # include "strptime.h" #endif -} /** \todo Code dependent on the private query headers qofquery-p.h and qofquerycore-p.h may need to be modified. diff --git a/bindings/guile/gnc-engine-guile.h b/bindings/guile/gnc-engine-guile.h index 0919395138..2795e8e287 100644 --- a/bindings/guile/gnc-engine-guile.h +++ b/bindings/guile/gnc-engine-guile.h @@ -27,15 +27,15 @@ #include #include -#ifdef __cplusplus -extern "C" -{ -#endif #include "gnc-engine.h" #include /* for GncAccountValue */ #include "gnc-hooks.h" +#ifdef __cplusplus +extern "C" +{ +#endif /* Helpers for various conversions to and from guile */ GDate gnc_time64_to_GDate(SCM x); diff --git a/bindings/guile/gnc-guile-utils.h b/bindings/guile/gnc-guile-utils.h index 6a981974e9..6649cb13f7 100644 --- a/bindings/guile/gnc-guile-utils.h +++ b/bindings/guile/gnc-guile-utils.h @@ -27,6 +27,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** Helper function to get the string representation of * a guile string. * @@ -74,4 +78,8 @@ SCM gnc_scm_call_1_to_vector(SCM func, SCM arg); * comments. */ gchar *gnc_scm_strip_comments (SCM scm_text); +#ifdef __cplusplus +} +#endif + #endif diff --git a/bindings/guile/gnc-helpers.h b/bindings/guile/gnc-helpers.h index 763037e611..26eea7e2eb 100644 --- a/bindings/guile/gnc-helpers.h +++ b/bindings/guile/gnc-helpers.h @@ -28,7 +28,15 @@ #include "gnc-ui-util.h" +#ifdef __cplusplus +extern "C" { +#endif + SCM gnc_printinfo2scm(GNCPrintAmountInfo info); GNCPrintAmountInfo gnc_scm2printinfo(SCM info_scm); +#ifdef __cplusplus +} +#endif + #endif diff --git a/bindings/guile/gnc-kvp-guile.cpp b/bindings/guile/gnc-kvp-guile.cpp index 33c04cf335..d1e011c185 100644 --- a/bindings/guile/gnc-kvp-guile.cpp +++ b/bindings/guile/gnc-kvp-guile.cpp @@ -3,8 +3,6 @@ #include #include -extern "C" -{ #include #include @@ -13,7 +11,6 @@ extern "C" #include "gnc-engine-guile.h" #include "gnc-guile-utils.h" #include "gnc-kvp-guile.h" -} /* NOTE: There are some problems with this approach. Currently, * guids are stored simply as strings in scheme, so some diff --git a/bindings/guile/gnc-kvp-guile.h b/bindings/guile/gnc-kvp-guile.h index 46ee642a75..287410f209 100644 --- a/bindings/guile/gnc-kvp-guile.h +++ b/bindings/guile/gnc-kvp-guile.h @@ -21,12 +21,13 @@ #ifndef KVP_SCM_H #define KVP_SCM_H +#include +#include + #ifdef __cplusplus extern "C" { #endif -#include -#include KvpValue* gnc_scm_to_kvp_value_ptr(SCM kvpval); SCM gnc_kvp_value_ptr_to_scm(KvpValue* val); diff --git a/bindings/guile/test/test-print-queries.cpp b/bindings/guile/test/test-print-queries.cpp index 20e326a956..3442a6dd12 100644 --- a/bindings/guile/test/test-print-queries.cpp +++ b/bindings/guile/test/test-print-queries.cpp @@ -23,15 +23,11 @@ #include #include "guile-mappings.h" -extern "C" -{ - #include "gnc-engine-guile.h" #include "test-engine-stuff.h" #include "test-stuff.h" #include "Query.h" #include "TransLog.h" -} static void test_query (Query *q, SCM val2str) diff --git a/bindings/guile/test/test-scm-query-string.cpp b/bindings/guile/test/test-scm-query-string.cpp index 5e3b60b8f6..bfc5810a82 100644 --- a/bindings/guile/test/test-scm-query-string.cpp +++ b/bindings/guile/test/test-scm-query-string.cpp @@ -23,15 +23,12 @@ #include "guile-mappings.h" #include -extern "C" -{ #include "gnc-engine-guile.h" #include "gnc-guile-utils.h" #include "test-engine-stuff.h" #include "test-stuff.h" #include "Query.h" #include "TransLog.h" -} static void test_query (Query *q, SCM val2str) diff --git a/bindings/guile/test/test-scm-query.cpp b/bindings/guile/test/test-scm-query.cpp index b8ae768e77..cd7b0a0cba 100644 --- a/bindings/guile/test/test-scm-query.cpp +++ b/bindings/guile/test/test-scm-query.cpp @@ -22,15 +22,12 @@ #include #include -extern "C" -{ #include "gnc-engine-guile.h" #include "test-engine-stuff.h" #include "test-stuff.h" #include "Query.h" #include "TransLog.h" -} static void test_query (QofQuery *q) diff --git a/common/test-core/unittest-support.h b/common/test-core/unittest-support.h index 64eff447d3..0b9b8a1560 100644 --- a/common/test-core/unittest-support.h +++ b/common/test-core/unittest-support.h @@ -25,6 +25,11 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + /** @file unittest-support.h * @brief Macros and logging-capture functions to ease writing GLib-testing * based unit tests. @@ -356,4 +361,8 @@ void gnc_log_shutdown (void); void gnc_log_set_handler (guint logdomain, gchar *logdomain, GLogFunc * func, gpointer data); */ +#ifdef __cplusplus +} +#endif + #endif /*UNITTEST_SUPPORT_H*/ diff --git a/gnucash/gnome-search/gnc-general-search.h b/gnucash/gnome-search/gnc-general-search.h index dc514639d7..1c02ed3a3d 100644 --- a/gnucash/gnome-search/gnc-general-search.h +++ b/gnucash/gnome-search/gnc-general-search.h @@ -34,6 +34,10 @@ #include "dialog-search.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_TYPE_GENERAL_SEARCH \ (gnc_general_search_get_type ()) @@ -91,4 +95,8 @@ GType gnc_general_search_get_type (void); void gnc_general_search_grab_focus (GNCGeneralSearch *gsl); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-search/search-core-type.h b/gnucash/gnome-search/search-core-type.h index 4abd8565d5..e9a81deeb9 100644 --- a/gnucash/gnome-search/search-core-type.h +++ b/gnucash/gnome-search/search-core-type.h @@ -25,6 +25,10 @@ #include "qof.h" #include "search-param.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_TYPE_SEARCH_CORE_TYPE (gnc_search_core_type_get_type ()) #define GNC_SEARCH_CORE_TYPE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreType)) #define GNC_SEARCH_CORE_TYPE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypeClass)) @@ -81,5 +85,8 @@ void gnc_search_core_register_type (const char *type_name, void gnc_search_core_initialize (void); void gnc_search_core_finalize (void); +#ifdef __cplusplus +} +#endif #endif /* ! _GNCSEARCH_CORE_TYPE_H */ diff --git a/gnucash/gnome-utils/dialog-doclink-utils.h b/gnucash/gnome-utils/dialog-doclink-utils.h index 0d2b6a36d1..7436d85fe6 100644 --- a/gnucash/gnome-utils/dialog-doclink-utils.h +++ b/gnucash/gnome-utils/dialog-doclink-utils.h @@ -23,6 +23,10 @@ #ifndef DIALOG_DOCLINK_UTILS_H #define DIALOG_DOCLINK_UTILS_H +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_DOC_LINK_PATH_HEAD "assoc-head" /* Note, assoc-head is the old name for the document link head which has been kept for compatibility */ @@ -120,4 +124,8 @@ gchar * gnc_doclink_get_unescaped_just_uri (const gchar *uri); */ void gnc_doclink_pref_path_head_changed (GtkWindow *parent, const gchar *old_path_head_uri); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/dialog-file-access.h b/gnucash/gnome-utils/dialog-file-access.h index bf8cb38b00..8bed1a10b1 100644 --- a/gnucash/gnome-utils/dialog-file-access.h +++ b/gnucash/gnome-utils/dialog-file-access.h @@ -34,10 +34,18 @@ * loading/open and for saving. */ +#ifdef __cplusplus +extern "C" { +#endif + void gnc_ui_file_access_for_open (GtkWindow *parent); void gnc_ui_file_access_for_save_as (GtkWindow *parent); void gnc_ui_file_access_for_export (GtkWindow *parent); +#ifdef __cplusplus +} +#endif + /** @} */ #endif /* DIALOG_FILE_ACCESS_H */ diff --git a/gnucash/gnome-utils/dialog-options.cpp b/gnucash/gnome-utils/dialog-options.cpp index 19f901b278..b0a085c462 100644 --- a/gnucash/gnome-utils/dialog-options.cpp +++ b/gnucash/gnome-utils/dialog-options.cpp @@ -23,10 +23,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ -extern "C" -{ #include // Need this to include Account.h -} #include // To include as C++ overriding later indirect includes #include @@ -37,8 +34,6 @@ extern "C" #include "dialog-options.hpp" #include -extern "C" -{ #include // for OPTION_SECTION_ACCOUNTS #include "dialog-utils.h" @@ -46,7 +41,6 @@ extern "C" #include // for GNC_PREFS_NUM_SOURCE #include "gnc-session.h" // for gnc_get_current_session #include "gnc-ui.h" // for DF_MANUAL -} #include #include diff --git a/gnucash/gnome-utils/dialog-preferences.h b/gnucash/gnome-utils/dialog-preferences.h index f3154eac76..22fec3260b 100644 --- a/gnucash/gnome-utils/dialog-preferences.h +++ b/gnucash/gnome-utils/dialog-preferences.h @@ -62,6 +62,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** This function adds a full page of preferences to the preferences * dialog. When the dialog is created, the specified widget will be * pulled from the specified glade file and added to the preferences @@ -104,6 +108,10 @@ void gnc_preferences_add_to_page (const gchar *filename, * the window stack instead of creating a new dialog. */ void gnc_preferences_dialog (GtkWindow *parent); +#ifdef __cplusplus +} +#endif + #endif /** @} */ /** @} */ diff --git a/gnucash/gnome-utils/dialog-reset-warnings.h b/gnucash/gnome-utils/dialog-reset-warnings.h index 51692b4793..f61137e365 100644 --- a/gnucash/gnome-utils/dialog-reset-warnings.h +++ b/gnucash/gnome-utils/dialog-reset-warnings.h @@ -22,4 +22,13 @@ * * **********************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + void gnc_reset_warnings_dialog (GtkWindow *parent); + +#ifdef __cplusplus +} +#endif + diff --git a/gnucash/gnome-utils/dialog-transfer.cpp b/gnucash/gnome-utils/dialog-transfer.cpp index 803c7ae9da..f1d3acf048 100644 --- a/gnucash/gnome-utils/dialog-transfer.cpp +++ b/gnucash/gnome-utils/dialog-transfer.cpp @@ -29,7 +29,6 @@ #include #include -extern "C" { #include "dialog-transfer.h" #include "dialog-utils.h" #include "gnc-amount-edit.h" @@ -48,7 +47,6 @@ extern "C" { #include "engine-helpers.h" #include "QuickFill.h" #include -} #define DIALOG_TRANSFER_CM_CLASS "dialog-transfer" diff --git a/gnucash/gnome-utils/dialog-transfer.h b/gnucash/gnome-utils/dialog-transfer.h index 9d4870a84a..fc65394bc0 100644 --- a/gnucash/gnome-utils/dialog-transfer.h +++ b/gnucash/gnome-utils/dialog-transfer.h @@ -26,6 +26,10 @@ #include "Account.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _xferDialog XferDialog; /** Opens up a window to do an automatic transfer between accounts @@ -221,4 +225,8 @@ gboolean gnc_xfer_dialog_run_exchange_dialog( Account *reg_acc, Transaction *txn, gnc_commodity *xfer_com, gboolean expanded); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/dialog-utils.h b/gnucash/gnome-utils/dialog-utils.h index 7278ab244d..e89aee3a7d 100644 --- a/gnucash/gnome-utils/dialog-utils.h +++ b/gnucash/gnome-utils/dialog-utils.h @@ -29,6 +29,10 @@ #include #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_PREF_GRID_LINES_HORIZONTAL "grid-lines-horizontal" #define GNC_PREF_GRID_LINES_VERTICAL "grid-lines-vertical" @@ -165,4 +169,8 @@ gnc_cost_policy_select_new (void); */ gchar* gnc_get_negative_color (void); +#ifdef __cplusplus +} +#endif + #endif /* DIALOG_UTILS_H */ diff --git a/gnucash/gnome-utils/gnc-account-sel.h b/gnucash/gnome-utils/gnc-account-sel.h index 7ec5f116f2..297f58f6f9 100644 --- a/gnucash/gnome-utils/gnc-account-sel.h +++ b/gnucash/gnome-utils/gnc-account-sel.h @@ -33,6 +33,10 @@ #include "Account.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_TYPE_ACCOUNT_SEL (gnc_account_sel_get_type()) #define GNC_ACCOUNT_SEL(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, GNC_TYPE_ACCOUNT_SEL, GNCAccountSel) #define GNC_ACCOUNT_SEL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, GNC_TYPE_ACCOUNT_SEL, GNCAccountSelClass) @@ -108,4 +112,8 @@ gint gnc_account_sel_get_num_account (GNCAccountSel *gas); void gnc_account_sel_purge_account (GNCAccountSel *gas, Account *acc, gboolean recursive); void gnc_account_sel_set_hexpand (GNCAccountSel *gas, gboolean expand); +#ifdef __cplusplus +} +#endif + #endif /* GNC_ACCOUNT_SEL_H */ diff --git a/gnucash/gnome-utils/gnc-amount-edit.h b/gnucash/gnome-utils/gnc-amount-edit.h index 158d2c6cd5..a26c6e5787 100644 --- a/gnucash/gnome-utils/gnc-amount-edit.h +++ b/gnucash/gnome-utils/gnc-amount-edit.h @@ -32,6 +32,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_TYPE_AMOUNT_EDIT (gnc_amount_edit_get_type ()) #define GNC_AMOUNT_EDIT(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GNC_TYPE_AMOUNT_EDIT, GNCAmountEdit) #define GNC_AMOUNT_EDIT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GNC_TYPE_AMOUNT_EDIT, GNCAmountEditClass) @@ -245,4 +249,8 @@ void gnc_amount_edit_show_warning_symbol (GNCAmountEdit *gae, gboolean show); */ void gnc_amount_edit_make_mnemonic_target (GNCAmountEdit *gae, GtkWidget *label); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-autoclear.h b/gnucash/gnome-utils/gnc-autoclear.h index 1896c2c057..ac9807d12e 100644 --- a/gnucash/gnome-utils/gnc-autoclear.h +++ b/gnucash/gnome-utils/gnc-autoclear.h @@ -27,6 +27,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** Account splits are analysed; attempts to find a unique combination * of uncleared splits which would set cleared balance to * toclear_value. If this is not possible, *errmsg will be error @@ -36,4 +40,8 @@ GList * gnc_account_get_autoclear_splits (Account *account, gnc_numeric toclear_value, gchar **errmsg); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-autosave.h b/gnucash/gnome-utils/gnc-autosave.h index c49f5e64d1..101b6e84a1 100644 --- a/gnucash/gnome-utils/gnc-autosave.h +++ b/gnucash/gnome-utils/gnc-autosave.h @@ -27,6 +27,10 @@ #include #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Callback that is used to notify the autosave subsystem when the QofBook changed its dirty state. */ void gnc_autosave_dirty_handler (QofBook *book, gboolean dirty); @@ -34,4 +38,8 @@ void gnc_autosave_dirty_handler (QofBook *book, gboolean dirty); /** Removes any still existing autosave timer from the event loop. */ void gnc_autosave_remove_timer(QofBook *book); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-commodity-edit.h b/gnucash/gnome-utils/gnc-commodity-edit.h index c4b21486ed..1c021b7d5c 100644 --- a/gnucash/gnome-utils/gnc-commodity-edit.h +++ b/gnucash/gnome-utils/gnc-commodity-edit.h @@ -34,6 +34,10 @@ #include "gnc-commodity.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Callback function to return the printable string of a commodity */ const char * gnc_commodity_edit_get_string (gpointer ptr); @@ -45,4 +49,8 @@ const char * gnc_commodity_edit_get_string (gpointer ptr); gpointer gnc_commodity_edit_new_select (gpointer arg, gpointer ptr, GtkWidget *toplevel); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-component-manager.h b/gnucash/gnome-utils/gnc-component-manager.h index 742faefa75..be25a7eee2 100644 --- a/gnucash/gnome-utils/gnc-component-manager.h +++ b/gnucash/gnome-utils/gnc-component-manager.h @@ -24,6 +24,10 @@ #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + #define NO_COMPONENT (-1) @@ -333,4 +337,8 @@ gint gnc_forall_gui_components (const char *component_class, GNCComponentHandler handler, gpointer iter_data); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-currency-edit.h b/gnucash/gnome-utils/gnc-currency-edit.h index 652050e811..2293081a6c 100644 --- a/gnucash/gnome-utils/gnc-currency-edit.h +++ b/gnucash/gnome-utils/gnc-currency-edit.h @@ -57,6 +57,10 @@ #include "gnc-commodity.h" +#ifdef __cplusplus +extern "C" { +#endif + /** @name Basic Object Implementation */ /** @{ */ @@ -126,6 +130,10 @@ void gnc_currency_edit_clear_display (GNCCurrencyEdit *gce); /** @} */ +#ifdef __cplusplus +} +#endif + #endif /** @} */ diff --git a/gnucash/gnome-utils/gnc-date-edit.h b/gnucash/gnome-utils/gnc-date-edit.h index 68f5478f8c..3ee92031f0 100644 --- a/gnucash/gnome-utils/gnc-date-edit.h +++ b/gnucash/gnome-utils/gnc-date-edit.h @@ -35,6 +35,10 @@ #include #include "gnc-date.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GNC_DATE_EDIT_SHOW_TIME = 1 << 0, @@ -135,4 +139,9 @@ void gnc_date_activates_default (GNCDateEdit *gde, gboolean state); void gnc_date_grab_focus (GNCDateEdit *gde); void gnc_date_make_mnemonic_target (GNCDateEdit *gde, GtkWidget *label); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-date-format.h b/gnucash/gnome-utils/gnc-date-format.h index 41abcc05e6..a0d02dbb4d 100644 --- a/gnucash/gnome-utils/gnc-date-format.h +++ b/gnucash/gnome-utils/gnc-date-format.h @@ -31,6 +31,10 @@ #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_TYPE_DATE_FORMAT (gnc_date_format_get_type ()) #define GNC_DATE_FORMAT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnc_date_format_get_type(), GNCDateFormat) #define GNC_DATE_FORMAT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnc_date_format_get_type(), GNCDateFormatClass) @@ -71,4 +75,8 @@ const char* gnc_date_format_get_custom (GNCDateFormat *gdf); void gnc_date_format_refresh (GNCDateFormat *gdf); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-file.h b/gnucash/gnome-utils/gnc-file.h index 7c723ebdfb..3fbaca0392 100644 --- a/gnucash/gnome-utils/gnc-file.h +++ b/gnucash/gnome-utils/gnc-file.h @@ -119,6 +119,10 @@ #include "qof.h" #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GNC_FILE_DIALOG_OPEN, @@ -168,4 +172,8 @@ typedef void (*GNCShutdownCB) (int); void gnc_file_set_shutdown_callback (GNCShutdownCB cb); gboolean gnc_file_save_in_progress (void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_FILE_H */ diff --git a/gnucash/gnome-utils/gnc-frequency.h b/gnucash/gnome-utils/gnc-frequency.h index 561824da86..8aba8fe910 100644 --- a/gnucash/gnome-utils/gnc-frequency.h +++ b/gnucash/gnome-utils/gnc-frequency.h @@ -29,6 +29,10 @@ #include "FreqSpec.h" #include "Recurrence.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_TYPE_FREQUENCY (gnc_frequency_get_type()) #define GNC_FREQUENCY(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, GNC_TYPE_FREQUENCY, GncFrequency) #define GNC_FREQENCY_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, GNC_TYPE_FREQUENCY, GncFrequency) @@ -101,4 +105,8 @@ void gnc_frequency_set_frequency_label_text (GncFrequency *gf, const gchar *txt) */ void gnc_frequency_set_date_label_text (GncFrequency *gf, const gchar *txt); +#ifdef __cplusplus +} +#endif + #endif /* !defined( GNC_FREQUENCY_H ) */ diff --git a/gnucash/gnome-utils/gnc-general-select.h b/gnucash/gnome-utils/gnc-general-select.h index d46e72d2cf..12f08caae5 100644 --- a/gnucash/gnome-utils/gnc-general-select.h +++ b/gnucash/gnome-utils/gnc-general-select.h @@ -31,6 +31,10 @@ #ifndef GNC_GENERAL_SELECT_H #define GNC_GENERAL_SELECT_H +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_TYPE_GENERAL_SELECT (gnc_general_select_get_type ()) #define GNC_GENERAL_SELECT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, gnc_general_select_get_type(), GNCGeneralSelect) #define GNC_GENERAL_SELECT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, gnc_general_select_get_type(), \ GNCGeneralSelectClass) @@ -83,5 +87,9 @@ GType gnc_general_select_get_type (void); void gnc_general_select_make_mnemonic_target (GNCGeneralSelect *gsl, GtkWidget *label); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-gnome-utils.h b/gnucash/gnome-utils/gnc-gnome-utils.h index 471d67189a..05cba2ec02 100644 --- a/gnucash/gnome-utils/gnc-gnome-utils.h +++ b/gnucash/gnome-utils/gnc-gnome-utils.h @@ -37,6 +37,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** Initialize the gnome-utils library * Should be run once before using any gnome-utils features. */ @@ -101,6 +105,10 @@ GncMainWindow *gnc_gui_init (void); int gnc_ui_start_event_loop (void); gboolean gnucash_ui_is_running (void); +#ifdef __cplusplus +} +#endif + #endif /** @} */ /** @} */ diff --git a/gnucash/gnome-utils/gnc-gobject-utils.h b/gnucash/gnome-utils/gnc-gobject-utils.h index c0fd9cff9c..3d066e45cd 100644 --- a/gnucash/gnome-utils/gnc-gobject-utils.h +++ b/gnucash/gnome-utils/gnc-gobject-utils.h @@ -41,6 +41,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** @name Gobject Tracking Functions * @{ * @@ -165,6 +169,10 @@ type_name##_get_type (void) \ return g_define_type_id_static; \ } /* closes type_name##_get_type() */ +#ifdef __cplusplus +} +#endif + #endif /* GNC_GOBJECT_UTILS_H */ /** @} */ diff --git a/gnucash/gnome-utils/gnc-gtk-utils.h b/gnucash/gnome-utils/gnc-gtk-utils.h index 43e2c0375e..bc77574fdf 100644 --- a/gnucash/gnome-utils/gnc-gtk-utils.h +++ b/gnucash/gnome-utils/gnc-gtk-utils.h @@ -37,6 +37,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** @name gtk Miscellaneous Functions @{ */ @@ -96,5 +100,9 @@ void gnc_menubar_model_remove_items_with_attrib (GMenuModel *menu_model, const g /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* GNC_GTK_UTILS_H */ /** @} */ diff --git a/gnucash/gnome-utils/gnc-gui-query.h b/gnucash/gnome-utils/gnc-gui-query.h index e6b7fac5ed..6e34e64790 100644 --- a/gnucash/gnome-utils/gnc-gui-query.h +++ b/gnucash/gnome-utils/gnc-gui-query.h @@ -23,6 +23,10 @@ #ifndef QUERY_USER_H #define QUERY_USER_H +#ifdef __cplusplus +extern "C" { +#endif + extern void gnc_info_dialog (GtkWindow *parent, const char *format, ...) G_GNUC_PRINTF (2, 3); @@ -30,5 +34,9 @@ gnc_info_dialog (GtkWindow *parent, void gnc_error_dialog (GtkWindow* parent, const char* format, ...) G_GNUC_PRINTF (2, 3); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp index d4dd2b5686..4a857ef240 100644 --- a/gnucash/gnome-utils/gnc-main-window.cpp +++ b/gnucash/gnome-utils/gnc-main-window.cpp @@ -39,8 +39,6 @@ #include "dialog-options.hpp" #include -extern "C" -{ #include @@ -88,7 +86,6 @@ extern "C" # include # include // for stat(2) #endif -} /** Names of signals generated by the main window. */ enum diff --git a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp index 38fb4d60dc..763a372f07 100644 --- a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp +++ b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp @@ -23,8 +23,6 @@ #include #include #include "gnc-option-gtk-ui.hpp" -extern "C" -{ #include // for scanf format string #include #include // for GNC_MOD_GUI @@ -38,7 +36,6 @@ extern "C" #include "gnc-tree-view-account.h" // for GNC_TREE_VIEW_ACCOUNT #include "gnc-tree-model-budget.h" // for gnc_tree_model_budget #include "misc-gnome-utils.h" // for xxxgtk_textview_set_text -} /*Something somewhere in windows.h defines ABSOLUTE to something and *that contaminates using it in RelativeDateType. Undef it. diff --git a/gnucash/gnome-utils/gnc-splash.h b/gnucash/gnome-utils/gnc-splash.h index c6819f45b3..acc204b894 100644 --- a/gnucash/gnome-utils/gnc-splash.h +++ b/gnucash/gnome-utils/gnc-splash.h @@ -24,11 +24,19 @@ #define GNC_SPLASH_H #include +#ifdef __cplusplus +extern "C" { +#endif + void gnc_show_splash_screen (void); void gnc_destroy_splash_screen (void); void gnc_update_splash_screen (const gchar *string, double percentage); GtkWindow *gnc_get_splash_screen (void); +#ifdef __cplusplus +} +#endif + #define GNC_SPLASH_PERCENTAGE_UNKNOWN 101 #endif diff --git a/gnucash/gnome-utils/gnc-tree-model-budget.h b/gnucash/gnome-utils/gnc-tree-model-budget.h index 03fbdf9051..bedd273af4 100644 --- a/gnucash/gnome-utils/gnc-tree-model-budget.h +++ b/gnucash/gnome-utils/gnc-tree-model-budget.h @@ -34,6 +34,10 @@ #include "gnc-budget.h" +#ifdef __cplusplus +extern "C" { +#endif + /* The budget list columns. */ enum { @@ -54,4 +58,8 @@ gboolean gnc_tree_model_budget_get_iter_for_budget(GtkTreeModel *tm, GtkTreeIter *iter, GncBudget *bgt); /** @} */ +#ifdef __cplusplus +} +#endif + #endif // __GNC_TREE_MODEL_BUDGET_H__ diff --git a/gnucash/gnome-utils/gnc-ui.h b/gnucash/gnome-utils/gnc-ui.h index 1473f59445..5715321b20 100644 --- a/gnucash/gnome-utils/gnc-ui.h +++ b/gnucash/gnome-utils/gnc-ui.h @@ -37,6 +37,10 @@ #include "gnc-pricedb.h" #include +#ifdef __cplusplus +extern "C" { +#endif + /** Documentation references ****************************************/ #ifdef G_OS_WIN32 @@ -191,5 +195,9 @@ GtkWindow *gnc_ui_get_main_window (GtkWidget *widget); void gnc_set_busy_cursor(GtkWidget *w, gboolean update_now); void gnc_unset_busy_cursor(GtkWidget *w); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome-utils/misc-gnome-utils.h b/gnucash/gnome-utils/misc-gnome-utils.h index 3b78968c5f..34b75ace79 100644 --- a/gnucash/gnome-utils/misc-gnome-utils.h +++ b/gnucash/gnome-utils/misc-gnome-utils.h @@ -20,8 +20,16 @@ #ifndef __GTT_UTIL_H__ #define __GTT_UTIL_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* Some gtk-like utilities */ void xxxgtk_textview_set_text (GtkTextView *text, const char *str); char * xxxgtk_textview_get_text (GtkTextView *text); +#ifdef __cplusplus +} +#endif + #endif /* __GTT_UTIL_H__ */ diff --git a/gnucash/gnome-utils/print-session.h b/gnucash/gnome-utils/print-session.h index 45540ee40c..277d813a2d 100644 --- a/gnucash/gnome-utils/print-session.h +++ b/gnucash/gnome-utils/print-session.h @@ -36,6 +36,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * Retrieve the print settings from the GtkPrintOperation @a op and save them in * a static variable. @@ -69,6 +73,10 @@ GtkPrintSettings *gnc_print_get_settings(void); /** Key for saving the PDF-export directory in the print settings */ #define GNC_GTK_PRINT_SETTINGS_EXPORT_DIR "gnc-pdf-export-directory" +#ifdef __cplusplus +} +#endif + /** @} */ /** @} */ diff --git a/gnucash/gnome-utils/test/test-autoclear.cpp b/gnucash/gnome-utils/test/test-autoclear.cpp index fd97991485..288074e900 100644 --- a/gnucash/gnome-utils/test/test-autoclear.cpp +++ b/gnucash/gnome-utils/test/test-autoclear.cpp @@ -24,9 +24,7 @@ #include "config.h" #include // GoogleTest is written in C++, however, the function we test in C. -extern "C" { #include "../gnc-autoclear.h" -} #include #include #include diff --git a/gnucash/gnome/assistant-hierarchy.cpp b/gnucash/gnome/assistant-hierarchy.cpp index 7e64b25260..4f769e2bc8 100644 --- a/gnucash/gnome/assistant-hierarchy.cpp +++ b/gnucash/gnome/assistant-hierarchy.cpp @@ -29,8 +29,6 @@ #include #include -extern "C" -{ #include #include @@ -68,7 +66,6 @@ extern "C" #include "gnc-plugin-page-account-tree.h" #include "gnc-engine.h" -} static QofLogModule log_module = GNC_MOD_IMPORT; diff --git a/gnucash/gnome/assistant-loan.cpp b/gnucash/gnome/assistant-loan.cpp index a55393215a..817bc6f5fe 100644 --- a/gnucash/gnome/assistant-loan.cpp +++ b/gnucash/gnome/assistant-loan.cpp @@ -27,8 +27,6 @@ #include #include -extern "C" -{ #include #include #include @@ -52,7 +50,6 @@ extern "C" #ifdef __MINGW32__ #include #endif -} #include #include diff --git a/gnucash/gnome/assistant-loan.h b/gnucash/gnome/assistant-loan.h index 3e5062e8a7..7c73fd8e78 100644 --- a/gnucash/gnome/assistant-loan.h +++ b/gnucash/gnome/assistant-loan.h @@ -22,4 +22,13 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + void gnc_ui_sx_loan_assistant_create(void); + +#ifdef __cplusplus +} +#endif + diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp index 077ef428a2..248240cbdc 100644 --- a/gnucash/gnome/assistant-stock-transaction.cpp +++ b/gnucash/gnome/assistant-stock-transaction.cpp @@ -31,7 +31,6 @@ #include #include -extern "C" { #include "Transaction.h" #include "engine-helpers.h" #include "dialog-utils.h" @@ -49,7 +48,6 @@ void stock_assistant_prepare (GtkAssistant *assistant, GtkWidget *page, gpointer user_data); void stock_assistant_finish (GtkAssistant *assistant, gpointer user_data); void stock_assistant_cancel (GtkAssistant *gtkassistant, gpointer user_data); -} enum class FieldMask : unsigned; bool operator &(FieldMask lhs, FieldMask rhs); diff --git a/gnucash/gnome/assistant-stock-transaction.h b/gnucash/gnome/assistant-stock-transaction.h index 3173976a45..2e7645df58 100644 --- a/gnucash/gnome/assistant-stock-transaction.h +++ b/gnucash/gnome/assistant-stock-transaction.h @@ -25,6 +25,10 @@ #include "Account.h" +#ifdef __cplusplus +extern "C" { +#endif + /********************************************************************\ * gnc_stock_transaction_assistant * * opens up a assistant to record a stock transaction * @@ -35,4 +39,8 @@ \********************************************************************/ void gnc_stock_transaction_assistant (GtkWidget *parent, Account * account); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome/business-gnome-utils.h b/gnucash/gnome/business-gnome-utils.h index 24dcf3f58f..de298743c1 100644 --- a/gnucash/gnome/business-gnome-utils.h +++ b/gnucash/gnome/business-gnome-utils.h @@ -30,6 +30,10 @@ #include "gncTaxTable.h" #include "gncInvoice.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_PREFS_GROUP_INVOICE "dialogs.business.invoice" #define GNC_PREFS_GROUP_BILL "dialogs.business.bill" @@ -106,4 +110,8 @@ gpointer gnc_simple_combo_get_value (GtkComboBox *cbox); void gnc_simple_combo_set_value (GtkComboBox *cbox, gpointer data); +#ifdef __cplusplus +} +#endif + #endif /* GNC_BUSINESS_GNOME_UTILS_H_ */ diff --git a/gnucash/gnome/business-options-gnome.cpp b/gnucash/gnome/business-options-gnome.cpp index 8249314e9b..eb1041e583 100644 --- a/gnucash/gnome/business-options-gnome.cpp +++ b/gnucash/gnome/business-options-gnome.cpp @@ -26,15 +26,12 @@ #include #include "business-options-gnome.h" -extern "C" -{ #include // for scanf format string #include #include #include // for gnc_get_current_book #include // for GNC_GENERAL_SEARCH #include "dialog-utils.h" // for gnc_builder_add_from_file -} #include diff --git a/gnucash/gnome/dialog-custom-report.h b/gnucash/gnome/dialog-custom-report.h index 1f35f273d5..9b21e5ce75 100644 --- a/gnucash/gnome/dialog-custom-report.h +++ b/gnucash/gnome/dialog-custom-report.h @@ -30,6 +30,10 @@ #include "gnc-main-window.h" +#ifdef __cplusplus +extern "C" { +#endif + /** @addtogroup Reports @{ */ /** @file dialog-custom-report.h @@ -45,6 +49,10 @@ gnc_ui_custom_report_edit_name(GncMainWindow * window, SCM scm_guid); /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* DIALOG_CUSTOM_REPORT_H */ diff --git a/gnucash/gnome/dialog-new-user.h b/gnucash/gnome/dialog-new-user.h index 78e9a0fc86..b92ade6b81 100644 --- a/gnucash/gnome/dialog-new-user.h +++ b/gnucash/gnome/dialog-new-user.h @@ -23,6 +23,10 @@ #ifndef DIALOG_NEW_USER_H #define DIALOG_NEW_USER_H +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_PREFS_GROUP_NEW_USER "dialogs.new-user" #define GNC_PREF_FIRST_STARTUP "first-startup" @@ -39,4 +43,8 @@ void gnc_new_user_dialog_register_qif_assistant (void (*cb_fcn)(void)); /* private */ void gncp_new_user_finish (void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome/dialog-price-edit-db.cpp b/gnucash/gnome/dialog-price-edit-db.cpp index beee0995e3..ff66d2c871 100644 --- a/gnucash/gnome/dialog-price-edit-db.cpp +++ b/gnucash/gnome/dialog-price-edit-db.cpp @@ -30,7 +30,6 @@ #include #include -extern "C" { #include "dialog-utils.h" #include "gnc-accounting-period.h" #include "gnc-amount-edit.h" @@ -48,7 +47,6 @@ extern "C" { #include "gnc-ui-util.h" #include "gnc-warnings.h" #include -} #define DIALOG_PRICE_DB_CM_CLASS "dialog-price-edit-db" diff --git a/gnucash/gnome/dialog-report-column-view.cpp b/gnucash/gnome/dialog-report-column-view.cpp index 838e8a272e..f23854d8c3 100644 --- a/gnucash/gnome/dialog-report-column-view.cpp +++ b/gnucash/gnome/dialog-report-column-view.cpp @@ -28,8 +28,6 @@ #include #include -extern "C" -{ #include #include "swig-runtime.h" @@ -39,7 +37,6 @@ extern "C" #include "guile-mappings.h" #include "gnc-guile-utils.h" #include "gnc-ui.h" -} #include "dialog-report-column-view.hpp" #include diff --git a/gnucash/gnome/dialog-report-column-view.hpp b/gnucash/gnome/dialog-report-column-view.hpp index 9d3843b831..6670349b69 100644 --- a/gnucash/gnome/dialog-report-column-view.hpp +++ b/gnucash/gnome/dialog-report-column-view.hpp @@ -24,10 +24,10 @@ #define GNC_DIALOG_COLUMN_VIEW_H #include -extern "C" -{ #include +extern "C" +{ typedef struct gncp_column_view_edit gnc_column_view_edit; GtkWidget * gnc_column_view_edit_options(GncOptionDB* odb, SCM view); diff --git a/gnucash/gnome/dialog-report-style-sheet.cpp b/gnucash/gnome/dialog-report-style-sheet.cpp index ec405b6306..f3ac6383fc 100644 --- a/gnucash/gnome/dialog-report-style-sheet.cpp +++ b/gnucash/gnome/dialog-report-style-sheet.cpp @@ -28,8 +28,6 @@ #include #include -extern "C" -{ #include #include "dialog-report-style-sheet.h" @@ -41,7 +39,6 @@ extern "C" #include "gnc-guile-utils.h" #include "gnc-ui.h" #include -} #include "gnc-report.h" #define DIALOG_STYLE_SHEETS_CM_CLASS "style-sheets-dialog" diff --git a/gnucash/gnome/gnc-plugin-page-report.cpp b/gnucash/gnome/gnc-plugin-page-report.cpp index a9f1b24fd8..184a7971ac 100644 --- a/gnucash/gnome/gnc-plugin-page-report.cpp +++ b/gnucash/gnome/gnc-plugin-page-report.cpp @@ -42,8 +42,6 @@ #include #include -extern "C" -{ #include #include @@ -76,8 +74,6 @@ extern "C" #include "guile-mappings.h" #include "gnc-icons.h" #include "print-session.h" -} - #include #include diff --git a/gnucash/gnome/top-level.h b/gnucash/gnome/top-level.h index 64a483f4cf..3170e35644 100644 --- a/gnucash/gnome/top-level.h +++ b/gnucash/gnome/top-level.h @@ -25,6 +25,14 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + void gnc_main_gui_init(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnome/window-report.cpp b/gnucash/gnome/window-report.cpp index 7b4e7c1590..2a0c3ea378 100644 --- a/gnucash/gnome/window-report.cpp +++ b/gnucash/gnome/window-report.cpp @@ -30,8 +30,6 @@ #include "dialog-report-column-view.hpp" #include -extern "C" -{ #include #include @@ -44,7 +42,6 @@ extern "C" #include "guile-mappings.h" #include "gnc-plugin-page-report.h" -} #include "gnc-report.h" /******************************************************************** diff --git a/gnucash/gnucash-cli.cpp b/gnucash/gnucash-cli.cpp index edcf33d6ca..e85f252ee1 100644 --- a/gnucash/gnucash-cli.cpp +++ b/gnucash/gnucash-cli.cpp @@ -30,11 +30,9 @@ #include "gnucash-commands.hpp" #include "gnucash-core-app.hpp" -extern "C" { #include #include #include -} #include #include diff --git a/gnucash/gnucash-commands.cpp b/gnucash/gnucash-commands.cpp index 6cfa44ca44..c603241905 100644 --- a/gnucash/gnucash-commands.cpp +++ b/gnucash/gnucash-commands.cpp @@ -32,14 +32,12 @@ #include "gnucash-commands.hpp" #include "gnucash-core-app.hpp" -extern "C" { #include #include #include #include #include #include -} #include #include diff --git a/gnucash/gnucash-core-app.cpp b/gnucash/gnucash-core-app.cpp index 69f7a5d082..1687293b14 100644 --- a/gnucash/gnucash-core-app.cpp +++ b/gnucash/gnucash-core-app.cpp @@ -31,7 +31,6 @@ #include "gnucash-core-app.hpp" -extern "C" { #include #include #include @@ -45,7 +44,6 @@ extern "C" { #include #include #include "gnucash-locale-platform.h" -} #include #include diff --git a/gnucash/gnucash-locale-platform.h b/gnucash/gnucash-locale-platform.h index 737a99b305..bfdddc8ff3 100644 --- a/gnucash/gnucash-locale-platform.h +++ b/gnucash/gnucash-locale-platform.h @@ -25,6 +25,14 @@ #ifndef GNUCASH_LOCALE_PLATFORM_H #define GNUCASH_LOCALE_PLATFORM_H +#ifdef __cplusplus +extern "C" { +#endif + char *set_platform_locale(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/gnucash.cpp b/gnucash/gnucash.cpp index ea72ab4c1f..d3fea5b316 100644 --- a/gnucash/gnucash.cpp +++ b/gnucash/gnucash.cpp @@ -32,7 +32,6 @@ #include "gnucash-commands.hpp" #include "gnucash-core-app.hpp" -extern "C" { #include #include #include @@ -59,7 +58,6 @@ extern "C" { #include #include #include -} #include #include diff --git a/gnucash/html/gnc-html-factory.h b/gnucash/html/gnc-html-factory.h index 947e6ed6ce..dcf6db1f37 100644 --- a/gnucash/html/gnc-html-factory.h +++ b/gnucash/html/gnc-html-factory.h @@ -25,6 +25,14 @@ #include "gnc-html.h" +#ifdef __cplusplus +extern "C" { +#endif + GncHtml* gnc_html_factory_create_html( void ); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/html/gnc-html-history.h b/gnucash/html/gnc-html-history.h index e4fdfd31df..87c93a08b0 100644 --- a/gnucash/html/gnc-html-history.h +++ b/gnucash/html/gnc-html-history.h @@ -28,6 +28,10 @@ typedef struct _gnc_html_history gnc_html_history; #include "gnc-html.h" +#ifdef __cplusplus +extern "C" { +#endif + struct _gnc_html_history_node { char* type; @@ -59,6 +63,10 @@ gnc_html_history_node * gnc_html_history_node_new(URLType type, void gnc_html_history_node_destroy(gnc_html_history_node * node); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp index ea90fbd0f1..7b86adb2e9 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp +++ b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp @@ -29,8 +29,6 @@ #include -extern "C" -{ #include "config.h" #include @@ -50,7 +48,6 @@ extern "C" #include "gnc-csv-gnumeric-popup.h" #include "go-charmap-sel.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/assistant-csv-price-import.h b/gnucash/import-export/csv-imp/assistant-csv-price-import.h index 213b622e2e..d81e698775 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-price-import.h +++ b/gnucash/import-export/csv-imp/assistant-csv-price-import.h @@ -28,9 +28,17 @@ #ifndef GNC_ASSISTANT_CSV_IMPORT_PRICE_H #define GNC_ASSISTANT_CSV_IMPORT_PRICE_H +#ifdef __cplusplus +extern "C" { +#endif /** The gnc_file_csv_price_import() will let the user import the * commodity prices from a file. */ void gnc_file_csv_price_import (void); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp index 1b0f48958b..db822d6fd2 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp +++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp @@ -30,8 +30,6 @@ #include -extern "C" -{ #include #include @@ -57,7 +55,6 @@ extern "C" #include "gnc-csv-gnumeric-popup.h" #include "go-charmap-sel.h" -} #include "gnc-imp-settings-csv-tx.hpp" #include "gnc-import-tx.hpp" diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.h b/gnucash/import-export/csv-imp/assistant-csv-trans-import.h index e51f329926..c98e253b62 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.h +++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.h @@ -29,8 +29,17 @@ #define GNC_ASSISTANT_CSV_IMPORT_TRANS_H +#ifdef __cplusplus +extern "C" { +#endif + /** The gnc_file_csv_trans_import() will let the user import the * account tree or transactions to a delimited file. */ void gnc_file_csv_trans_import (void); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/import-export/csv-imp/gnc-csv-account-map.h b/gnucash/import-export/csv-imp/gnc-csv-account-map.h index 976a661190..726d9e4d64 100644 --- a/gnucash/import-export/csv-imp/gnc-csv-account-map.h +++ b/gnucash/import-export/csv-imp/gnc-csv-account-map.h @@ -30,6 +30,10 @@ #include #include "Account.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Enumeration for the mappings liststore */ enum GncImportColumn {MAPPING_STRING, MAPPING_FULLPATH, MAPPING_ACCOUNT}; @@ -49,4 +53,8 @@ void gnc_csv_account_map_change_mappings (Account *old_account, Account *new_acc */ Account * gnc_csv_account_map_search (const gchar *map_string); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/import-export/csv-imp/gnc-csv-gnumeric-popup.h b/gnucash/import-export/csv-imp/gnc-csv-gnumeric-popup.h index d5f6d150e2..233520f954 100644 --- a/gnucash/import-export/csv-imp/gnc-csv-gnumeric-popup.h +++ b/gnucash/import-export/csv-imp/gnc-csv-gnumeric-popup.h @@ -72,6 +72,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { char const *name; @@ -95,5 +99,9 @@ void gnumeric_create_popup_menu (GnumericPopupMenuElement const *elements, int sensitive_filter, GdkEventButton *event); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp index cbeedfce94..c9e29f8bdf 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp +++ b/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp @@ -24,7 +24,6 @@ #include #include -extern "C" { #include #if PLATFORM(WINDOWS) #include @@ -32,7 +31,6 @@ extern "C" { #include "engine-helpers.h" #include "gnc-ui-util.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp b/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp index 38acdd077b..9d2a4a9d6f 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp +++ b/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp @@ -24,7 +24,6 @@ #ifndef GNC_PRICE_PROPS_HPP #define GNC_PRICE_PROPS_HPP -extern "C" { #include #if PLATFORM(WINDOWS) #include @@ -33,7 +32,6 @@ extern "C" { #include #include "gnc-pricedb.h" #include "gnc-commodity.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp index 8196856c67..8fbfc0d93c 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp +++ b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp @@ -23,13 +23,11 @@ #include #include -extern "C" { #include #if PLATFORM(WINDOWS) #include #endif - #include "engine-helpers.h" #include "gnc-csv-account-map.h" #include "gnc-ui-util.h" @@ -38,8 +36,6 @@ extern "C" { #include "gnc-pricedb.h" #include -} - #include #include #include diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-tx.hpp b/gnucash/import-export/csv-imp/gnc-imp-props-tx.hpp index faf8cea75d..5999fb7257 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-props-tx.hpp +++ b/gnucash/import-export/csv-imp/gnc-imp-props-tx.hpp @@ -24,7 +24,6 @@ #ifndef GNC_TRANS_PROPS_HPP #define GNC_TRANS_PROPS_HPP -extern "C" { #include #if PLATFORM(WINDOWS) #include @@ -35,7 +34,6 @@ extern "C" { #include "Account.h" #include "Transaction.h" #include "gnc-commodity.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp index d55d6cc119..fe2e5296bc 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp +++ b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp @@ -34,8 +34,6 @@ #include #include -extern "C" -{ #include #include @@ -44,7 +42,6 @@ extern "C" #include "Account.h" #include "gnc-state.h" #include "gnc-ui-util.h" -} constexpr auto group_prefix = "Import csv,price - "; diff --git a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.hpp b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.hpp index ef15cdd29d..38f1f7fc2a 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.hpp +++ b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.hpp @@ -28,11 +28,9 @@ #ifndef GNC_CSV_PRICE_IMPORT_SETTINGS_H #define GNC_CSV_PRICE_IMPORT_SETTINGS_H -extern "C" { #include #include "Account.h" #include "gnc-commodity.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.cpp b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.cpp index f7c89f8c50..c867605372 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.cpp +++ b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.cpp @@ -34,8 +34,6 @@ #include #include -extern "C" -{ #include #include @@ -44,7 +42,6 @@ extern "C" #include "Account.h" #include "gnc-state.h" #include "gnc-ui-util.h" -} constexpr auto group_prefix = "Import csv,transaction - "; diff --git a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.hpp b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.hpp index 8d798f7f19..bc23e15db0 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.hpp +++ b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-tx.hpp @@ -28,11 +28,9 @@ #ifndef GNC_CSV_TRANS_IMPORT_SETTINGS_H #define GNC_CSV_TRANS_IMPORT_SETTINGS_H -extern "C" { #include #include "Account.h" #include "gnc-commodity.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-imp-settings-csv.cpp b/gnucash/import-export/csv-imp/gnc-imp-settings-csv.cpp index 694b5b98e0..7bd8e44324 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-settings-csv.cpp +++ b/gnucash/import-export/csv-imp/gnc-imp-settings-csv.cpp @@ -29,8 +29,6 @@ #include "gnc-imp-settings-csv.hpp" #include -extern "C" -{ #include #include @@ -39,7 +37,6 @@ extern "C" #include "Account.h" #include "gnc-state.h" #include "gnc-ui-util.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-imp-settings-csv.hpp b/gnucash/import-export/csv-imp/gnc-imp-settings-csv.hpp index fa283bfbdc..bb344ce39c 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-settings-csv.hpp +++ b/gnucash/import-export/csv-imp/gnc-imp-settings-csv.hpp @@ -28,11 +28,9 @@ #ifndef GNC_CSV_IMPORT_SETTINGS_H #define GNC_CSV_IMPORT_SETTINGS_H -extern "C" { #include #include "Account.h" #include "gnc-commodity.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-import-price.cpp b/gnucash/import-export/csv-imp/gnc-import-price.cpp index 73925eefe9..8368b921c6 100644 --- a/gnucash/import-export/csv-imp/gnc-import-price.cpp +++ b/gnucash/import-export/csv-imp/gnc-import-price.cpp @@ -22,7 +22,6 @@ #include -extern "C" { #include #if PLATFORM(WINDOWS) #include @@ -33,7 +32,6 @@ extern "C" { #include "gnc-ui-util.h" //get book #include "gnc-commodity.h" #include "gnc-pricedb.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-import-price.hpp b/gnucash/import-export/csv-imp/gnc-import-price.hpp index 38f54cc594..56af0852c7 100644 --- a/gnucash/import-export/csv-imp/gnc-import-price.hpp +++ b/gnucash/import-export/csv-imp/gnc-import-price.hpp @@ -30,10 +30,8 @@ #ifndef GNC_PRICE_IMPORT_HPP #define GNC_PRICE_IMPORT_HPP -extern "C" { #include "config.h" #include "gnc-commodity.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-import-tx.cpp b/gnucash/import-export/csv-imp/gnc-import-tx.cpp index 459cbfcb10..e70a1237c2 100644 --- a/gnucash/import-export/csv-imp/gnc-import-tx.cpp +++ b/gnucash/import-export/csv-imp/gnc-import-tx.cpp @@ -23,14 +23,12 @@ #include -extern "C" { #include #if PLATFORM(WINDOWS) #include #endif #include -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-import-tx.hpp b/gnucash/import-export/csv-imp/gnc-import-tx.hpp index ffa8a035ab..aa3e881c6d 100644 --- a/gnucash/import-export/csv-imp/gnc-import-tx.hpp +++ b/gnucash/import-export/csv-imp/gnc-import-tx.hpp @@ -29,12 +29,10 @@ #ifndef GNC_TX_IMPORT_HPP #define GNC_TX_IMPORT_HPP -extern "C" { #include #include "Account.h" #include "Transaction.h" -} #include #include diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer-csv.cpp b/gnucash/import-export/csv-imp/gnc-tokenizer-csv.cpp index 8f116e4076..5a8aa93e92 100644 --- a/gnucash/import-export/csv-imp/gnc-tokenizer-csv.cpp +++ b/gnucash/import-export/csv-imp/gnc-tokenizer-csv.cpp @@ -11,9 +11,7 @@ #include #include -extern "C" { - #include -} +#include void GncCsvTokenizer::set_separators(const std::string& separators) diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer-csv.hpp b/gnucash/import-export/csv-imp/gnc-tokenizer-csv.hpp index ef75632e64..c60910b5a4 100644 --- a/gnucash/import-export/csv-imp/gnc-tokenizer-csv.hpp +++ b/gnucash/import-export/csv-imp/gnc-tokenizer-csv.hpp @@ -34,9 +34,7 @@ #ifndef GNC_CSV_TOKENIZER_HPP #define GNC_CSV_TOKENIZER_HPP -extern "C" { #include -} #include #include // fstream diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer-dummy.hpp b/gnucash/import-export/csv-imp/gnc-tokenizer-dummy.hpp index 5bedfee3b2..dffb64a6d0 100644 --- a/gnucash/import-export/csv-imp/gnc-tokenizer-dummy.hpp +++ b/gnucash/import-export/csv-imp/gnc-tokenizer-dummy.hpp @@ -35,9 +35,7 @@ #ifndef GNC_DUMMY_TOKENIZER_HPP #define GNC_DUMMY_TOKENIZER_HPP -extern "C" { #include -} #include #include // fstream diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer-fw.hpp b/gnucash/import-export/csv-imp/gnc-tokenizer-fw.hpp index d2eca2e799..e34c55de13 100644 --- a/gnucash/import-export/csv-imp/gnc-tokenizer-fw.hpp +++ b/gnucash/import-export/csv-imp/gnc-tokenizer-fw.hpp @@ -37,9 +37,7 @@ #ifndef GNC_FW_TOKENIZER_HPP #define GNC_FW_TOKENIZER_HPP -extern "C" { #include -} #include #include // fstream diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer.cpp b/gnucash/import-export/csv-imp/gnc-tokenizer.cpp index 2f54db6aae..d14ead25ba 100644 --- a/gnucash/import-export/csv-imp/gnc-tokenizer.cpp +++ b/gnucash/import-export/csv-imp/gnc-tokenizer.cpp @@ -14,11 +14,9 @@ #include #include -extern "C" { #include #include #include -} std::unique_ptr gnc_tokenizer_factory(GncImpFileFormat fmt) { diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer.hpp b/gnucash/import-export/csv-imp/gnc-tokenizer.hpp index fb68bd33ed..8ad0bd27cb 100644 --- a/gnucash/import-export/csv-imp/gnc-tokenizer.hpp +++ b/gnucash/import-export/csv-imp/gnc-tokenizer.hpp @@ -35,9 +35,7 @@ #ifndef GNC_TOKENIZER_HPP #define GNC_TOKENIZER_HPP -extern "C" { #include -} #include #include // fstream diff --git a/gnucash/import-export/import-account-matcher.h b/gnucash/import-export/import-account-matcher.h index 4e39515a0b..a7d9be613e 100644 --- a/gnucash/import-export/import-account-matcher.h +++ b/gnucash/import-export/import-account-matcher.h @@ -35,6 +35,10 @@ #include "gnc-tree-view-account.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { GtkWidget *dialog; /* Dialog Widget */ @@ -125,5 +129,9 @@ Account * gnc_import_select_account(GtkWidget *parent, gboolean * ok_pressed ); +#ifdef __cplusplus +} +#endif + #endif /**@}*/ diff --git a/gnucash/import-export/import-backend.h b/gnucash/import-export/import-backend.h index cb9c726631..d19d03a165 100644 --- a/gnucash/import-export/import-backend.h +++ b/gnucash/import-export/import-backend.h @@ -31,6 +31,10 @@ #include "Transaction.h" #include "import-settings.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _transactioninfo GNCImportTransInfo; typedef struct _selected_match_info GNCImportSelectedMatchInfo; typedef struct _matchinfo @@ -259,6 +263,10 @@ gint gnc_import_MatchInfo_get_probability (const GNCImportMatchInfo * info); /**@}*/ +#ifdef __cplusplus +} +#endif + #endif /** @} */ diff --git a/gnucash/import-export/import-main-matcher.h b/gnucash/import-export/import-main-matcher.h index 51ddf4f532..87eff3f39c 100644 --- a/gnucash/import-export/import-main-matcher.h +++ b/gnucash/import-export/import-main-matcher.h @@ -36,6 +36,10 @@ #include "Transaction.h" #include "import-backend.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _main_matcher_info GNCImportMainMatcher; typedef void (*GNCTransactionProcessedCB) (GNCImportTransInfo *trans_info, @@ -221,5 +225,9 @@ void gnc_gen_trans_list_show_reconcile_after_close_button (GNCImportMainMatcher */ GtkWidget* gnc_gen_trans_list_get_reconcile_after_close_button (GNCImportMainMatcher *info); +#ifdef __cplusplus +} +#endif + #endif /**@}*/ diff --git a/gnucash/import-export/import-pending-matches.h b/gnucash/import-export/import-pending-matches.h index 57530b1acb..70a6f47245 100644 --- a/gnucash/import-export/import-pending-matches.h +++ b/gnucash/import-export/import-pending-matches.h @@ -29,6 +29,10 @@ #include #include "import-backend.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef GHashTable GNCImportPendingMatches; typedef enum _import_match_type { @@ -58,5 +62,9 @@ gnc_import_PendingMatches_get_match_type(GNCImportPendingMatches *map, const char * gnc_import_PendingMatches_get_type_str(GNCImportPendingMatchType type); +#ifdef __cplusplus +} +#endif + #endif /** @} */ diff --git a/gnucash/import-export/test/gtest-import-account-matcher.cpp b/gnucash/import-export/test/gtest-import-account-matcher.cpp index 004c564f71..1c643416e8 100644 --- a/gnucash/import-export/test/gtest-import-account-matcher.cpp +++ b/gnucash/import-export/test/gtest-import-account-matcher.cpp @@ -23,15 +23,12 @@ *******************************************************************/ #include -extern "C" -{ #include #include #include #include #include #include -} #include using AccountV = std::vector; diff --git a/gnucash/import-export/test/gtest-import-backend.cpp b/gnucash/import-export/test/gtest-import-backend.cpp index 6909a33516..9c77f1844a 100644 --- a/gnucash/import-export/test/gtest-import-backend.cpp +++ b/gnucash/import-export/test/gtest-import-backend.cpp @@ -6,12 +6,9 @@ #include -extern "C" -{ #include #include #include -} #include "gmock-gnc-prefs.h" #include "gmock-qofbook.h" diff --git a/gnucash/import-export/test/test-import-pending-matches.cpp b/gnucash/import-export/test/test-import-pending-matches.cpp index 56a52d3929..c633f256a1 100644 --- a/gnucash/import-export/test/test-import-pending-matches.cpp +++ b/gnucash/import-export/test/test-import-pending-matches.cpp @@ -1,7 +1,6 @@ #include #include /* for references in import-backend.h */ -extern "C" { #include #include @@ -9,7 +8,6 @@ extern "C" { #include "import-pending-matches.h" #include "Split.h" #include "test-engine-stuff.h" -} static const gchar *suitename = "/import-export/import-pending-matches"; diff --git a/gnucash/register/register-gnome/gnucash-register.h b/gnucash/register/register-gnome/gnucash-register.h index 9dd839df9d..dde62e31ba 100644 --- a/gnucash/register/register-gnome/gnucash-register.h +++ b/gnucash/register/register-gnome/gnucash-register.h @@ -26,6 +26,10 @@ #include "table-allgui.h" #include "gnucash-sheet.h" +#ifdef __cplusplus +extern "C" { +#endif + /** @ingroup Register * @addtogroup Gnome * @{ @@ -87,4 +91,9 @@ void gnucash_register_set_open_doclink_cb (GnucashRegister *reg, GnucashSheet *gnucash_register_get_sheet (GnucashRegister *reg); void gnucash_register_reset_sheet_layout (GnucashRegister *reg); /** @} */ + +#ifdef __cplusplus +} +#endif + #endif diff --git a/gnucash/report/gnc-report.cpp b/gnucash/report/gnc-report.cpp index 6dffdf4a3d..33b4aa8220 100644 --- a/gnucash/report/gnc-report.cpp +++ b/gnucash/report/gnc-report.cpp @@ -31,8 +31,6 @@ #include #include #include -extern "C" -{ #include #include #include @@ -43,7 +41,6 @@ extern "C" #include #include #include -} #include "gnc-report.h" extern "C" SCM scm_init_sw_report_module(void); diff --git a/libgnucash/app-utils/QuickFill.h b/libgnucash/app-utils/QuickFill.h index 4fd125319f..d9d33fe50b 100644 --- a/libgnucash/app-utils/QuickFill.h +++ b/libgnucash/app-utils/QuickFill.h @@ -52,6 +52,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { QUICKFILL_LIFO, @@ -127,4 +131,8 @@ void gnc_quickfill_remove (QuickFill *root, const gchar *text, /** @} */ /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* QUICKFILL_H */ diff --git a/libgnucash/app-utils/gfec.h b/libgnucash/app-utils/gfec.h index b1ecc30b68..b7b026e345 100644 --- a/libgnucash/app-utils/gfec.h +++ b/libgnucash/app-utils/gfec.h @@ -13,6 +13,10 @@ #include #include "guile-mappings.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*gfec_error_handler)(const char *error_message); SCM gfec_eval_file(const char *file, gfec_error_handler error_handler); @@ -20,4 +24,8 @@ SCM gfec_eval_string(const char *str, gfec_error_handler error_handler); SCM gfec_apply(SCM proc, SCM arglist, gfec_error_handler error_handler); gboolean gfec_try_load(const gchar *fn); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libgnucash/app-utils/gnc-account-merge.h b/libgnucash/app-utils/gnc-account-merge.h index 0a7c34dba9..bace53304e 100644 --- a/libgnucash/app-utils/gnc-account-merge.h +++ b/libgnucash/app-utils/gnc-account-merge.h @@ -23,6 +23,10 @@ #include "Account.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING, @@ -41,4 +45,8 @@ GncAccountMergeDisposition determine_merge_disposition(Account *existing_root, A void account_trees_merge(Account *existing_root, Account *new_accts_root); +#ifdef __cplusplus +} +#endif + #endif /* GNC_ACCOUNT_MERGE_H */ diff --git a/libgnucash/app-utils/gnc-exp-parser.h b/libgnucash/app-utils/gnc-exp-parser.h index 88651f002a..88d5982135 100644 --- a/libgnucash/app-utils/gnc-exp-parser.h +++ b/libgnucash/app-utils/gnc-exp-parser.h @@ -24,6 +24,10 @@ #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * The errors which can be determined at the gnc-exp-parser level. **/ @@ -89,4 +93,8 @@ gboolean gnc_exp_parser_parse_separate_vars (const char * expression, * the problem. Otherwise, return NULL. */ const char * gnc_exp_parser_error_string (void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libgnucash/app-utils/gnc-gsettings.cpp b/libgnucash/app-utils/gnc-gsettings.cpp index 58b1bd599c..50b55392a8 100644 --- a/libgnucash/app-utils/gnc-gsettings.cpp +++ b/libgnucash/app-utils/gnc-gsettings.cpp @@ -28,14 +28,12 @@ #include #include -extern "C" { #include #include #include "gnc-gsettings.h" #include "gnc-path.h" #include "qof.h" #include "gnc-prefs-p.h" -} #include #include diff --git a/libgnucash/app-utils/gnc-gsettings.h b/libgnucash/app-utils/gnc-gsettings.h index 7f2d9f3a00..f02815f003 100644 --- a/libgnucash/app-utils/gnc-gsettings.h +++ b/libgnucash/app-utils/gnc-gsettings.h @@ -52,6 +52,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** Convert a partial schema name into a complete gsettings schema name. * * This function takes a partial gsettings schema name and converts @@ -605,6 +609,10 @@ void gnc_gsettings_load_backend (void); */ void gnc_gsettings_version_upgrade (void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_GSETTINGS_H */ /** @} */ /** @} */ diff --git a/libgnucash/app-utils/gnc-prefs-utils.h b/libgnucash/app-utils/gnc-prefs-utils.h index 1eaf935eb9..581fcdcd64 100644 --- a/libgnucash/app-utils/gnc-prefs-utils.h +++ b/libgnucash/app-utils/gnc-prefs-utils.h @@ -42,6 +42,10 @@ #define GNC_PREFS_UTILS_H_ +#ifdef __cplusplus +extern "C" { +#endif + /** This function is called early in the load process * to preload a number of preferences from the settings backend */ @@ -52,6 +56,10 @@ void gnc_prefs_init (void); */ void gnc_prefs_remove_registered (void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_PREFS_UTILS_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp index 0f71f20ad2..1d75084e8d 100644 --- a/libgnucash/app-utils/gnc-quotes.cpp +++ b/libgnucash/app-utils/gnc-quotes.cpp @@ -48,7 +48,6 @@ #include #include "gnc-quotes.hpp" -extern "C" { #include #include #include "gnc-ui-util.h" @@ -56,7 +55,6 @@ extern "C" { #include #include #include -} static const QofLogModule log_module = "gnc.price-quotes"; diff --git a/libgnucash/app-utils/gnc-state.h b/libgnucash/app-utils/gnc-state.h index 2cf0d7b944..624813c39a 100644 --- a/libgnucash/app-utils/gnc-state.h +++ b/libgnucash/app-utils/gnc-state.h @@ -54,6 +54,10 @@ #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Definitions shared by file-utils.c and gnc-main-window.c */ #define STATE_FILE_TOP "Top" #define STATE_FILE_BOOK_GUID "BookGuid" @@ -102,6 +106,10 @@ GKeyFile *gnc_state_get_current (void); */ gint gnc_state_drop_sections_for (const gchar *partial_name); +#ifdef __cplusplus +} +#endif + #endif /* GNC_STATE_H */ /** @} */ /** @} */ diff --git a/libgnucash/app-utils/gnc-ui-util.h b/libgnucash/app-utils/gnc-ui-util.h index 3c137371d1..54cd23306d 100644 --- a/libgnucash/app-utils/gnc-ui-util.h +++ b/libgnucash/app-utils/gnc-ui-util.h @@ -39,6 +39,10 @@ #include "gncOwner.h" #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef QofSession * (*QofSessionCB) (void); @@ -434,6 +438,10 @@ gchar * gnc_filter_text_for_currency_commodity (const gnc_commodity *comm, const gchar *incoming_text, const gchar **symbol); +#ifdef __cplusplus +} +#endif + #endif /** @} */ /** @} */ diff --git a/libgnucash/app-utils/test/gtest-gnc-quotes.cpp b/libgnucash/app-utils/test/gtest-gnc-quotes.cpp index 3f1136e805..f9c165172e 100644 --- a/libgnucash/app-utils/test/gtest-gnc-quotes.cpp +++ b/libgnucash/app-utils/test/gtest-gnc-quotes.cpp @@ -22,8 +22,6 @@ * * \********************************************************************/ -extern "C" -{ #include #include #include @@ -31,6 +29,7 @@ extern "C" #include /* gnc-quotes normally gets this from gnc-ui-util, but let's avoid the dependency. */ +extern "C" { static gnc_commodity* gnc_default_currency(void) { @@ -38,8 +37,8 @@ gnc_default_currency(void) auto table{gnc_commodity_table_get_table(book)}; return gnc_commodity_table_lookup(table, GNC_COMMODITY_NS_CURRENCY, "USD"); } +} -} // extern "C" #include #include "../gnc-quotes.cpp" diff --git a/libgnucash/app-utils/test/test-print-parse-amount.cpp b/libgnucash/app-utils/test/test-print-parse-amount.cpp index 8dea72099c..a4ab4683e6 100644 --- a/libgnucash/app-utils/test/test-print-parse-amount.cpp +++ b/libgnucash/app-utils/test/test-print-parse-amount.cpp @@ -21,8 +21,6 @@ #include #include -extern "C" -{ #include #include @@ -31,7 +29,6 @@ extern "C" #include "test-engine-stuff.h" #include "test-stuff.h" #include -} static void test_num_print_info (gnc_numeric n, GNCPrintAmountInfo print_info, int line) diff --git a/libgnucash/app-utils/test/test-sx.cpp b/libgnucash/app-utils/test/test-sx.cpp index 7047deb1f7..b38fc22e87 100644 --- a/libgnucash/app-utils/test/test-sx.cpp +++ b/libgnucash/app-utils/test/test-sx.cpp @@ -22,8 +22,6 @@ #include #include -extern "C" -{ #include #include "SX-book.h" #include "SX-ttinfo.h" @@ -34,7 +32,6 @@ extern "C" #include "test-stuff.h" #include "test-engine-stuff.h" -} static void test_basic() diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp index 11030e19dd..a616e9f0d7 100644 --- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp +++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp @@ -28,8 +28,6 @@ #include #include -extern "C" -{ #include "config.h" #include @@ -60,8 +58,6 @@ extern "C" #include "splint-defs.h" #endif -} - #include #include #include diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.hpp b/libgnucash/backend/dbi/gnc-backend-dbi.hpp index f02d590076..cc3893cfc7 100644 --- a/libgnucash/backend/dbi/gnc-backend-dbi.hpp +++ b/libgnucash/backend/dbi/gnc-backend-dbi.hpp @@ -22,8 +22,7 @@ /* Private structures and variables for gnc-backend-dbi.c and its unit tests */ #ifndef GNC_BACKEND_DBI_HPP #define GNC_BACKEND_DBI_HPP -extern "C" -{ + #include #ifdef G_OS_WIN32 #include @@ -33,7 +32,7 @@ extern "C" #include #define GETPID() getpid() #endif -} + #include #include diff --git a/libgnucash/backend/dbi/gnc-dbiprovider.hpp b/libgnucash/backend/dbi/gnc-dbiprovider.hpp index 7f416a24ea..28bc96b381 100644 --- a/libgnucash/backend/dbi/gnc-dbiprovider.hpp +++ b/libgnucash/backend/dbi/gnc-dbiprovider.hpp @@ -24,10 +24,7 @@ #ifndef __GNC_DBIPROVIDER_HPP__ #define __GNC_DBIPROVIDER_HPP__ -extern "C" -{ #include -} #include #include diff --git a/libgnucash/backend/dbi/gnc-dbiproviderimpl.hpp b/libgnucash/backend/dbi/gnc-dbiproviderimpl.hpp index 107984dd9a..1028017836 100644 --- a/libgnucash/backend/dbi/gnc-dbiproviderimpl.hpp +++ b/libgnucash/backend/dbi/gnc-dbiproviderimpl.hpp @@ -23,10 +23,8 @@ #ifndef __GNC_DBISQLPROVIDERIMPL_HPP__ #define __GNC_DBISQLPROVIDERIMPL_HPP__ #include -extern "C" -{ #include -} + #include #include #include diff --git a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp index 3eaf4d9bc2..aac47df1cf 100644 --- a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp +++ b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp @@ -22,12 +22,9 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include -} #include #include diff --git a/libgnucash/backend/dbi/gnc-dbisqlresult.cpp b/libgnucash/backend/dbi/gnc-dbisqlresult.cpp index b045056ff2..ba19f73388 100644 --- a/libgnucash/backend/dbi/gnc-dbisqlresult.cpp +++ b/libgnucash/backend/dbi/gnc-dbisqlresult.cpp @@ -22,14 +22,11 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include /* For direct access to dbi data structs, sadly needed for datetime */ #include -} #include #include #include "gnc-dbisqlresult.hpp" diff --git a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp index 75a86ed749..85837fe590 100644 --- a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp +++ b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp @@ -26,8 +26,6 @@ #include -extern "C" -{ #include #include @@ -50,15 +48,11 @@ extern "C" #include "gncInvoice.h" /* For version_control */ #include -} /* For test_conn_index_functions */ #include "../gnc-backend-dbi.hpp" #include "../gnc-backend-dbi.h" -extern "C" -{ #include #include -} #include #include diff --git a/libgnucash/backend/dbi/test/test-backend-dbi.cpp b/libgnucash/backend/dbi/test/test-backend-dbi.cpp index acb21e40c0..b88ed88d1c 100644 --- a/libgnucash/backend/dbi/test/test-backend-dbi.cpp +++ b/libgnucash/backend/dbi/test/test-backend-dbi.cpp @@ -21,12 +21,9 @@ \********************************************************************/ #include -extern "C" -{ #include #include "qof.h" #include "cashobjects.h" -} extern void test_suite_gnc_backend_dbi (); #define GNC_LIB_NAME_1 "gncmod-backend-dbi" diff --git a/libgnucash/backend/dbi/test/test-dbi-business-stuff.cpp b/libgnucash/backend/dbi/test/test-dbi-business-stuff.cpp index 2f4acfcb03..89e1823218 100644 --- a/libgnucash/backend/dbi/test/test-dbi-business-stuff.cpp +++ b/libgnucash/backend/dbi/test/test-dbi-business-stuff.cpp @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -extern "C" -{ #include #include "qof.h" #include "cashobjects.h" @@ -39,7 +37,6 @@ extern "C" #include "gncInvoice.h" #include "gncEmployee.h" #include "gncVendor.h" -} #include "test-dbi-stuff.h" #include "test-dbi-business-stuff.h" diff --git a/libgnucash/backend/dbi/test/test-dbi-stuff.cpp b/libgnucash/backend/dbi/test/test-dbi-stuff.cpp index 9bfecada30..24f8a91c79 100644 --- a/libgnucash/backend/dbi/test/test-dbi-stuff.cpp +++ b/libgnucash/backend/dbi/test/test-dbi-stuff.cpp @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -extern "C" -{ #include #include #include @@ -36,7 +34,6 @@ extern "C" #include #include #include -} #include #include "../gnc-backend-dbi.hpp" diff --git a/libgnucash/backend/sql/gnc-account-sql.cpp b/libgnucash/backend/sql/gnc-account-sql.cpp index f80370bbc1..2552ed3bc0 100644 --- a/libgnucash/backend/sql/gnc-account-sql.cpp +++ b/libgnucash/backend/sql/gnc-account-sql.cpp @@ -26,8 +26,6 @@ * restoring data to/from an SQL db */ #include -extern "C" -{ #include #include @@ -40,7 +38,6 @@ extern "C" #if defined( S_SPLINT_S ) #include "splint-defs.h" #endif -} #include #include diff --git a/libgnucash/backend/sql/gnc-address-sql.cpp b/libgnucash/backend/sql/gnc-address-sql.cpp index 79beb8af0b..7ca71473a9 100644 --- a/libgnucash/backend/sql/gnc-address-sql.cpp +++ b/libgnucash/backend/sql/gnc-address-sql.cpp @@ -29,14 +29,11 @@ */ #include -extern "C" -{ #include #include "gnc-engine.h" #include "gncAddress.h" -} #include #include #include diff --git a/libgnucash/backend/sql/gnc-bill-term-sql.cpp b/libgnucash/backend/sql/gnc-bill-term-sql.cpp index 5f598f90ce..355220cfd2 100644 --- a/libgnucash/backend/sql/gnc-bill-term-sql.cpp +++ b/libgnucash/backend/sql/gnc-bill-term-sql.cpp @@ -28,8 +28,6 @@ * restoring data to/from an SQL database */ #include -extern "C" -{ #include #include @@ -39,7 +37,6 @@ extern "C" #include "gncBillTermP.h" #include "gncInvoice.h" #include "qof.h" -} #include #include diff --git a/libgnucash/backend/sql/gnc-book-sql.cpp b/libgnucash/backend/sql/gnc-book-sql.cpp index ca27169889..2d26ab7dec 100644 --- a/libgnucash/backend/sql/gnc-book-sql.cpp +++ b/libgnucash/backend/sql/gnc-book-sql.cpp @@ -27,8 +27,6 @@ */ #include -extern "C" -{ #include #include "qof.h" @@ -40,7 +38,6 @@ extern "C" #if defined( S_SPLINT_S ) #include "splint-defs.h" #endif -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-budget-sql.cpp b/libgnucash/backend/sql/gnc-budget-sql.cpp index 67ecb3a9b2..492eefb3d3 100644 --- a/libgnucash/backend/sql/gnc-budget-sql.cpp +++ b/libgnucash/backend/sql/gnc-budget-sql.cpp @@ -26,8 +26,6 @@ * restoring data to/from an SQL db */ #include -extern "C" -{ #include #include @@ -39,7 +37,6 @@ extern "C" #if defined( S_SPLINT_S ) #include "splint-defs.h" #endif -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-commodity-sql.cpp b/libgnucash/backend/sql/gnc-commodity-sql.cpp index 32689d323c..e3383dbe9c 100644 --- a/libgnucash/backend/sql/gnc-commodity-sql.cpp +++ b/libgnucash/backend/sql/gnc-commodity-sql.cpp @@ -26,15 +26,12 @@ * restoring data to/from an SQL db */ #include -extern "C" -{ #include #include #include "qof.h" #include "gnc-commodity.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-customer-sql.cpp b/libgnucash/backend/sql/gnc-customer-sql.cpp index 26e075ca92..82a141d0fb 100644 --- a/libgnucash/backend/sql/gnc-customer-sql.cpp +++ b/libgnucash/backend/sql/gnc-customer-sql.cpp @@ -29,8 +29,6 @@ */ #include -extern "C" -{ #include #include @@ -39,7 +37,6 @@ extern "C" #include "gncBillTermP.h" #include "gncCustomerP.h" #include "gncTaxTableP.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-employee-sql.cpp b/libgnucash/backend/sql/gnc-employee-sql.cpp index b0cb6e3d11..a84218a9db 100644 --- a/libgnucash/backend/sql/gnc-employee-sql.cpp +++ b/libgnucash/backend/sql/gnc-employee-sql.cpp @@ -29,8 +29,6 @@ */ #include -extern "C" -{ #include #include @@ -38,7 +36,6 @@ extern "C" #include "gnc-commodity.h" #include "gncEmployeeP.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-entry-sql.cpp b/libgnucash/backend/sql/gnc-entry-sql.cpp index 053996bc63..9df5fb8d29 100644 --- a/libgnucash/backend/sql/gnc-entry-sql.cpp +++ b/libgnucash/backend/sql/gnc-entry-sql.cpp @@ -29,8 +29,6 @@ */ #include -extern "C" -{ #include #include @@ -40,7 +38,6 @@ extern "C" #include "gncOrderP.h" #include "gncInvoiceP.h" #include "gncTaxTableP.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-invoice-sql.cpp b/libgnucash/backend/sql/gnc-invoice-sql.cpp index adfbebaf5c..4f2551b6f7 100644 --- a/libgnucash/backend/sql/gnc-invoice-sql.cpp +++ b/libgnucash/backend/sql/gnc-invoice-sql.cpp @@ -28,8 +28,6 @@ * restoring data to/from an SQL database */ #include -extern "C" -{ #include #include @@ -40,7 +38,6 @@ extern "C" #include "gncBillTermP.h" #include "gncInvoiceP.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-job-sql.cpp b/libgnucash/backend/sql/gnc-job-sql.cpp index 5daf2bdd80..beb8b9e1cf 100644 --- a/libgnucash/backend/sql/gnc-job-sql.cpp +++ b/libgnucash/backend/sql/gnc-job-sql.cpp @@ -29,15 +29,12 @@ */ #include -extern "C" -{ #include #include #include #include "gncJobP.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-lots-sql.cpp b/libgnucash/backend/sql/gnc-lots-sql.cpp index 322ff85266..6fd27944c3 100644 --- a/libgnucash/backend/sql/gnc-lots-sql.cpp +++ b/libgnucash/backend/sql/gnc-lots-sql.cpp @@ -27,8 +27,6 @@ */ #include -extern "C" -{ #include #include @@ -40,7 +38,6 @@ extern "C" #if defined( S_SPLINT_S ) #include "splint-defs.h" #endif -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-order-sql.cpp b/libgnucash/backend/sql/gnc-order-sql.cpp index e339e027a7..3201bf9833 100644 --- a/libgnucash/backend/sql/gnc-order-sql.cpp +++ b/libgnucash/backend/sql/gnc-order-sql.cpp @@ -29,15 +29,12 @@ */ #include -extern "C" -{ #include #include #include #include #include "gncOrderP.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-owner-sql.cpp b/libgnucash/backend/sql/gnc-owner-sql.cpp index c25e00b261..2cbf09c090 100644 --- a/libgnucash/backend/sql/gnc-owner-sql.cpp +++ b/libgnucash/backend/sql/gnc-owner-sql.cpp @@ -28,8 +28,6 @@ * restoring data to/from an SQL database */ #include -extern "C" -{ #include #include #include @@ -37,7 +35,6 @@ extern "C" #include "gncJobP.h" #include "gncEmployeeP.h" #include "gncVendorP.h" -} #include #include #include diff --git a/libgnucash/backend/sql/gnc-price-sql.cpp b/libgnucash/backend/sql/gnc-price-sql.cpp index 9dd5e60aee..57e2b14dc1 100644 --- a/libgnucash/backend/sql/gnc-price-sql.cpp +++ b/libgnucash/backend/sql/gnc-price-sql.cpp @@ -27,8 +27,6 @@ */ #include -extern "C" -{ #include #include "qof.h" @@ -37,7 +35,6 @@ extern "C" #if defined( S_SPLINT_S ) #include "splint-defs.h" #endif -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-recurrence-sql.cpp b/libgnucash/backend/sql/gnc-recurrence-sql.cpp index fb82c90ecf..0789d3f634 100644 --- a/libgnucash/backend/sql/gnc-recurrence-sql.cpp +++ b/libgnucash/backend/sql/gnc-recurrence-sql.cpp @@ -27,8 +27,6 @@ */ #include -extern "C" -{ #include #include "qof.h" @@ -38,7 +36,6 @@ extern "C" #if defined( S_SPLINT_S ) #include "splint-defs.h" #endif -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-schedxaction-sql.cpp b/libgnucash/backend/sql/gnc-schedxaction-sql.cpp index dddaf83f1c..735f9b11cd 100644 --- a/libgnucash/backend/sql/gnc-schedxaction-sql.cpp +++ b/libgnucash/backend/sql/gnc-schedxaction-sql.cpp @@ -27,8 +27,6 @@ */ #include -extern "C" -{ #include #include "qof.h" @@ -39,7 +37,6 @@ extern "C" #ifdef S_SPLINT_S #include "splint-defs.h" #endif -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-slots-sql.cpp b/libgnucash/backend/sql/gnc-slots-sql.cpp index 4d197345e7..19abcfb6d4 100644 --- a/libgnucash/backend/sql/gnc-slots-sql.cpp +++ b/libgnucash/backend/sql/gnc-slots-sql.cpp @@ -26,8 +26,6 @@ * restoring data to/from an SQL db */ #include -extern "C" -{ #include #include @@ -38,7 +36,6 @@ extern "C" #ifdef S_SPLINT_S #include "splint-defs.h" #endif -} #include #include diff --git a/libgnucash/backend/sql/gnc-sql-backend.cpp b/libgnucash/backend/sql/gnc-sql-backend.cpp index 082e3403bb..9ca69b8a61 100644 --- a/libgnucash/backend/sql/gnc-sql-backend.cpp +++ b/libgnucash/backend/sql/gnc-sql-backend.cpp @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ -extern "C" -{ #include #include #include @@ -32,7 +30,6 @@ extern "C" #include #include #include -} #include #include diff --git a/libgnucash/backend/sql/gnc-sql-backend.hpp b/libgnucash/backend/sql/gnc-sql-backend.hpp index cbdfdaf930..ec7bf705de 100644 --- a/libgnucash/backend/sql/gnc-sql-backend.hpp +++ b/libgnucash/backend/sql/gnc-sql-backend.hpp @@ -24,11 +24,9 @@ #ifndef __GNC_SQL_BACKEND_HPP__ #define __GNC_SQL_BACKEND_HPP__ -extern "C" -{ #include #include -} + #include #include #include diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp index 1c300066aa..f76b26b6e5 100644 --- a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp +++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp @@ -21,11 +21,8 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ -extern "C" -{ #include #include -} #include #include #include diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp index 926029a38c..ae9c9b90c4 100644 --- a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp +++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp @@ -24,10 +24,7 @@ #ifndef __GNC_SQL_COLUMN_TABLE_ENTRY_HPP__ #define __GNC_SQL_COLUMN_TABLE_ENTRY_HPP__ -extern "C" -{ #include -} #include #include #include diff --git a/libgnucash/backend/sql/gnc-sql-connection.hpp b/libgnucash/backend/sql/gnc-sql-connection.hpp index eeef886037..4f2fd1121b 100644 --- a/libgnucash/backend/sql/gnc-sql-connection.hpp +++ b/libgnucash/backend/sql/gnc-sql-connection.hpp @@ -24,10 +24,7 @@ #ifndef __GNC_SQL_CONNECTION_HPP__ #define __GNC_SQL_CONNECTION_HPP__ -extern "C" -{ #include -} #include #include #include diff --git a/libgnucash/backend/sql/gnc-sql-object-backend.cpp b/libgnucash/backend/sql/gnc-sql-object-backend.cpp index dbaeaeda68..428f49ded7 100644 --- a/libgnucash/backend/sql/gnc-sql-object-backend.cpp +++ b/libgnucash/backend/sql/gnc-sql-object-backend.cpp @@ -21,10 +21,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \***********************************************************************/ -extern "C" -{ #include -} #include "gnc-sql-object-backend.hpp" #include "gnc-sql-backend.hpp" #include "gnc-sql-column-table-entry.hpp" diff --git a/libgnucash/backend/sql/gnc-sql-object-backend.hpp b/libgnucash/backend/sql/gnc-sql-object-backend.hpp index bd3f705122..5a8a901948 100644 --- a/libgnucash/backend/sql/gnc-sql-object-backend.hpp +++ b/libgnucash/backend/sql/gnc-sql-object-backend.hpp @@ -24,10 +24,8 @@ #ifndef __GNC_SQL_OBJECT_BACKEND_HPP__ #define __GNC_SQL_OBJECT_BACKEND_HPP__ -extern "C" -{ #include -} + #include #include #include diff --git a/libgnucash/backend/sql/gnc-sql-result.cpp b/libgnucash/backend/sql/gnc-sql-result.cpp index 20f774b68c..9b7b5ddfb7 100644 --- a/libgnucash/backend/sql/gnc-sql-result.cpp +++ b/libgnucash/backend/sql/gnc-sql-result.cpp @@ -21,10 +21,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \***********************************************************************/ -extern "C" -{ #include -} #include #include "gnc-sql-column-table-entry.hpp" diff --git a/libgnucash/backend/sql/gnc-sql-result.hpp b/libgnucash/backend/sql/gnc-sql-result.hpp index 3c5c558a93..757084c3b5 100644 --- a/libgnucash/backend/sql/gnc-sql-result.hpp +++ b/libgnucash/backend/sql/gnc-sql-result.hpp @@ -24,10 +24,8 @@ #ifndef __GNC_SQL_RESULT_HPP__ #define __GNC_SQL_RESULT_HPP__ -extern "C" -{ #include -} + #include #include #include diff --git a/libgnucash/backend/sql/gnc-tax-table-sql.cpp b/libgnucash/backend/sql/gnc-tax-table-sql.cpp index 818ab84ed5..4a30a90691 100644 --- a/libgnucash/backend/sql/gnc-tax-table-sql.cpp +++ b/libgnucash/backend/sql/gnc-tax-table-sql.cpp @@ -28,8 +28,6 @@ * restoring data to/from an SQL database */ #include -extern "C" -{ #include #include @@ -38,7 +36,6 @@ extern "C" #include "gncEntry.h" #include "gncTaxTableP.h" -} #include #include diff --git a/libgnucash/backend/sql/gnc-transaction-sql.cpp b/libgnucash/backend/sql/gnc-transaction-sql.cpp index 05ad24b7d2..d5e8778422 100644 --- a/libgnucash/backend/sql/gnc-transaction-sql.cpp +++ b/libgnucash/backend/sql/gnc-transaction-sql.cpp @@ -26,8 +26,6 @@ * restoring data to/from an SQL db */ #include -extern "C" -{ #include #include @@ -47,7 +45,6 @@ extern "C" #ifdef S_SPLINT_S #include "splint-defs.h" #endif -} #include #include diff --git a/libgnucash/backend/sql/gnc-vendor-sql.cpp b/libgnucash/backend/sql/gnc-vendor-sql.cpp index 481b1f4225..0ad17b4f55 100644 --- a/libgnucash/backend/sql/gnc-vendor-sql.cpp +++ b/libgnucash/backend/sql/gnc-vendor-sql.cpp @@ -29,8 +29,6 @@ */ #include -extern "C" -{ #include #include #include @@ -39,7 +37,6 @@ extern "C" #include "gncBillTermP.h" #include "gncVendorP.h" #include "gncTaxTableP.h" -} #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/test/test-column-types.cpp b/libgnucash/backend/sql/test/test-column-types.cpp index 5e2c170387..d3aa6e5491 100644 --- a/libgnucash/backend/sql/test/test-column-types.cpp +++ b/libgnucash/backend/sql/test/test-column-types.cpp @@ -23,16 +23,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -extern "C" -{ #include #include "qof.h" -} -extern "C" -{ #include "cashobjects.h" #include "test-stuff.h" -} int main (int argc, char** argv) { diff --git a/libgnucash/backend/sql/test/test-sqlbe.cpp b/libgnucash/backend/sql/test/test-sqlbe.cpp index 0a6191c3f3..5141e7a905 100644 --- a/libgnucash/backend/sql/test/test-sqlbe.cpp +++ b/libgnucash/backend/sql/test/test-sqlbe.cpp @@ -22,11 +22,8 @@ #include -extern "C" -{ #include #include "qof.h" -} extern void test_suite_gnc_backend_sql (); int diff --git a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp index f7e639ae07..0136d0993e 100644 --- a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp +++ b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp @@ -22,12 +22,9 @@ ********************************************************************/ #include -extern "C" -{ #include #include #include -} /* Add specific headers for this class */ #include "../gnc-sql-connection.hpp" #include "../gnc-sql-backend.hpp" diff --git a/libgnucash/backend/xml/gnc-account-xml-v2.cpp b/libgnucash/backend/xml/gnc-account-xml-v2.cpp index cfc8b32132..95f54ab5be 100644 --- a/libgnucash/backend/xml/gnc-account-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-account-xml-v2.cpp @@ -24,14 +24,11 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include #include -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-address-xml-v2.cpp b/libgnucash/backend/xml/gnc-address-xml-v2.cpp index bd0a1a8077..5e5481593d 100644 --- a/libgnucash/backend/xml/gnc-address-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-address-xml-v2.cpp @@ -23,12 +23,9 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include -} #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/gnc-address-xml-v2.h b/libgnucash/backend/xml/gnc-address-xml-v2.h index d1ed84f4a3..ed26a5ab69 100644 --- a/libgnucash/backend/xml/gnc-address-xml-v2.h +++ b/libgnucash/backend/xml/gnc-address-xml-v2.h @@ -22,10 +22,9 @@ #ifndef GNC_ADDRESS_XML_V2_H #define GNC_ADDRESS_XML_V2_H -extern "C" -{ + #include "gncAddress.h" -} + gboolean gnc_dom_tree_to_address (xmlNodePtr node, GncAddress* address); xmlNodePtr gnc_address_to_dom_tree (const char* tag, GncAddress* addr); void gnc_address_xml_initialize (void); diff --git a/libgnucash/backend/xml/gnc-backend-xml.cpp b/libgnucash/backend/xml/gnc-backend-xml.cpp index c0a51a9251..8a941b28b1 100644 --- a/libgnucash/backend/xml/gnc-backend-xml.cpp +++ b/libgnucash/backend/xml/gnc-backend-xml.cpp @@ -31,8 +31,6 @@ #include #include -extern "C" -{ #include @@ -75,7 +73,6 @@ extern "C" #ifndef HAVE_STRPTIME # include "strptime.h" #endif -} #include #include "gnc-backend-xml.h" diff --git a/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp b/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp index 06c6799f2b..278813f13f 100644 --- a/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp @@ -21,8 +21,6 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ -extern "C" -{ #include #include #include @@ -30,7 +28,6 @@ extern "C" #include "gncBillTermP.h" #include "gncInvoice.h" #include "qof.h" -} #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/gnc-book-xml-v2.cpp b/libgnucash/backend/xml/gnc-book-xml-v2.cpp index 17d0b53baf..17740c1f38 100644 --- a/libgnucash/backend/xml/gnc-book-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-book-xml-v2.cpp @@ -24,13 +24,10 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "qof.h" -} #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/gnc-budget-xml-v2.cpp b/libgnucash/backend/xml/gnc-budget-xml-v2.cpp index 80ed55748d..cab10a82f1 100644 --- a/libgnucash/backend/xml/gnc-budget-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-budget-xml-v2.cpp @@ -22,12 +22,9 @@ */ #include -extern "C" -{ #include #include #include -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp b/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp index ea12cdaadf..25503d9adb 100644 --- a/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp @@ -23,13 +23,10 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include "AccountP.h" #include "Account.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-customer-xml-v2.cpp b/libgnucash/backend/xml/gnc-customer-xml-v2.cpp index bf2edd91ea..05ee5fa4cd 100644 --- a/libgnucash/backend/xml/gnc-customer-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-customer-xml-v2.cpp @@ -23,8 +23,6 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include @@ -32,7 +30,6 @@ extern "C" #include "gncBillTermP.h" #include "gncCustomerP.h" #include "gncTaxTableP.h" -} #include "gnc-xml-helper.h" #include "gnc-customer-xml-v2.h" diff --git a/libgnucash/backend/xml/gnc-employee-xml-v2.cpp b/libgnucash/backend/xml/gnc-employee-xml-v2.cpp index f70bab19a5..37b72dddec 100644 --- a/libgnucash/backend/xml/gnc-employee-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-employee-xml-v2.cpp @@ -23,13 +23,10 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "gncEmployeeP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/gnc-entry-xml-v2.cpp b/libgnucash/backend/xml/gnc-entry-xml-v2.cpp index 08125df99d..55bbd64422 100644 --- a/libgnucash/backend/xml/gnc-entry-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-entry-xml-v2.cpp @@ -23,8 +23,6 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include @@ -33,7 +31,6 @@ extern "C" #include "gncOrderP.h" #include "gncInvoiceP.h" #include "gncTaxTableP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp b/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp index bc75540b04..b266adedce 100644 --- a/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp @@ -24,14 +24,11 @@ #include -extern "C" -{ #include #include #include "qof.h" #include "SchedXaction.h" #include "FreqSpec.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-invoice-xml-v2.cpp b/libgnucash/backend/xml/gnc-invoice-xml-v2.cpp index 6cbc3aa6e1..904204b777 100644 --- a/libgnucash/backend/xml/gnc-invoice-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-invoice-xml-v2.cpp @@ -23,15 +23,12 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "gncBillTermP.h" #include "gncInvoiceP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-job-xml-v2.cpp b/libgnucash/backend/xml/gnc-job-xml-v2.cpp index 39e70e7a37..50d6399373 100644 --- a/libgnucash/backend/xml/gnc-job-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-job-xml-v2.cpp @@ -23,13 +23,10 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "gncJobP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-lot-xml-v2.cpp b/libgnucash/backend/xml/gnc-lot-xml-v2.cpp index 2041b5f726..1f287e270d 100644 --- a/libgnucash/backend/xml/gnc-lot-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-lot-xml-v2.cpp @@ -24,14 +24,11 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "gnc-lot.h" #include "gnc-lot-p.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-order-xml-v2.cpp b/libgnucash/backend/xml/gnc-order-xml-v2.cpp index 9d54f530d8..4160f2f427 100644 --- a/libgnucash/backend/xml/gnc-order-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-order-xml-v2.cpp @@ -23,13 +23,10 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "gncOrderP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-owner-xml-v2.cpp b/libgnucash/backend/xml/gnc-owner-xml-v2.cpp index 159f48d5e7..a28ff63980 100644 --- a/libgnucash/backend/xml/gnc-owner-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-owner-xml-v2.cpp @@ -23,8 +23,6 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include @@ -32,7 +30,6 @@ extern "C" #include "gncJobP.h" #include "gncVendorP.h" #include "gncEmployeeP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp b/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp index be9b99afb3..55ffeba126 100644 --- a/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp @@ -20,14 +20,11 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * *******************************************************************/ -extern "C" -{ #include #include #include "gnc-pricedb.h" #include "gnc-pricedb-p.h" -} #include "gnc-xml.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-recurrence-xml-v2.cpp b/libgnucash/backend/xml/gnc-recurrence-xml-v2.cpp index cab44edc17..7ffb68e314 100644 --- a/libgnucash/backend/xml/gnc-recurrence-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-recurrence-xml-v2.cpp @@ -22,13 +22,10 @@ */ #include -extern "C" -{ #include #include #include "qof.h" #include "Recurrence.h" -} #include "gnc-xml.h" #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp b/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp index 4ef67f06e3..57eba9002c 100644 --- a/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp @@ -22,13 +22,10 @@ *******************************************************************/ #include -extern "C" -{ #include #include #include "SX-book.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-tax-table-xml-v2.cpp b/libgnucash/backend/xml/gnc-tax-table-xml-v2.cpp index a8c714a030..8186d75fae 100644 --- a/libgnucash/backend/xml/gnc-tax-table-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-tax-table-xml-v2.cpp @@ -23,14 +23,11 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "gncEntry.h" #include "gncTaxTableP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp index bf095e09e5..7d078e977c 100644 --- a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp @@ -23,8 +23,6 @@ *******************************************************************/ #include -extern "C" -{ #include #include #include "AccountP.h" @@ -32,7 +30,6 @@ extern "C" #include "TransactionP.h" #include "gnc-lot.h" #include "gnc-lot-p.h" -} #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp b/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp index 520cdd3d3e..03fc094c2e 100644 --- a/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp @@ -23,15 +23,12 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include "gncBillTermP.h" #include "gncVendorP.h" #include "gncTaxTableP.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-xml-backend.cpp b/libgnucash/backend/xml/gnc-xml-backend.cpp index 03cc9b9b0e..bc7136a861 100644 --- a/libgnucash/backend/xml/gnc-xml-backend.cpp +++ b/libgnucash/backend/xml/gnc-xml-backend.cpp @@ -17,8 +17,6 @@ #include #include -extern "C" -{ #include #include #if PLATFORM(WINDOWS) @@ -36,8 +34,6 @@ extern "C" #include #include -} - #include #include "gnc-xml-backend.hpp" diff --git a/libgnucash/backend/xml/gnc-xml-backend.hpp b/libgnucash/backend/xml/gnc-xml-backend.hpp index 662ec8e418..e125764b62 100644 --- a/libgnucash/backend/xml/gnc-xml-backend.hpp +++ b/libgnucash/backend/xml/gnc-xml-backend.hpp @@ -18,10 +18,7 @@ #ifndef __GNC_XML_BACKEND_HPP__ #define __GNC_XML_BACKEND_HPP__ -extern "C" -{ #include -} #include #include diff --git a/libgnucash/backend/xml/io-example-account.cpp b/libgnucash/backend/xml/io-example-account.cpp index dd6831ec54..1d89137186 100644 --- a/libgnucash/backend/xml/io-example-account.cpp +++ b/libgnucash/backend/xml/io-example-account.cpp @@ -25,8 +25,6 @@ #include #include -extern "C" -{ #include #include @@ -52,7 +50,6 @@ extern "C" #if COMPILER(MSVC) # define g_fopen fopen #endif -} #include "sixtp.h" diff --git a/libgnucash/backend/xml/io-gncxml-gen.cpp b/libgnucash/backend/xml/io-gncxml-gen.cpp index 4585662fcc..b9a395c6bd 100644 --- a/libgnucash/backend/xml/io-gncxml-gen.cpp +++ b/libgnucash/backend/xml/io-gncxml-gen.cpp @@ -21,10 +21,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ -extern "C" -{ #include -} #include "io-gncxml-gen.h" diff --git a/libgnucash/backend/xml/io-gncxml-v1.cpp b/libgnucash/backend/xml/io-gncxml-v1.cpp index a731b421a1..821ab8ed49 100644 --- a/libgnucash/backend/xml/io-gncxml-v1.cpp +++ b/libgnucash/backend/xml/io-gncxml-v1.cpp @@ -25,8 +25,6 @@ * * *******************************************************************/ #include -extern "C" -{ #include #include @@ -44,7 +42,6 @@ extern "C" #include #include #include -} #include "io-gncxml.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/io-gncxml-v2.cpp b/libgnucash/backend/xml/io-gncxml-v2.cpp index 9b746fdfe4..94e6e2fbbb 100644 --- a/libgnucash/backend/xml/io-gncxml-v2.cpp +++ b/libgnucash/backend/xml/io-gncxml-v2.cpp @@ -21,8 +21,6 @@ #include #include -extern "C" -{ #include #include @@ -65,7 +63,6 @@ extern "C" # define g_fopen fopen # define g_open _open #endif -} #include "gnc-xml-backend.hpp" #include "sixtp-parsers.h" diff --git a/libgnucash/backend/xml/io-utils.cpp b/libgnucash/backend/xml/io-utils.cpp index c203fb677e..29ad18065e 100644 --- a/libgnucash/backend/xml/io-utils.cpp +++ b/libgnucash/backend/xml/io-utils.cpp @@ -23,12 +23,9 @@ \********************************************************************/ #include -extern "C" -{ #include #include -} #include "gnc-xml.h" #include "io-utils.h" diff --git a/libgnucash/backend/xml/sixtp-dom-generators.cpp b/libgnucash/backend/xml/sixtp-dom-generators.cpp index 94e5b9d185..715a0d91fe 100644 --- a/libgnucash/backend/xml/sixtp-dom-generators.cpp +++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp @@ -22,14 +22,11 @@ ********************************************************************/ #include -extern "C" -{ #define __EXTENSIONS__ #include #include -} #include "gnc-xml-helper.h" #include "sixtp-dom-generators.h" diff --git a/libgnucash/backend/xml/sixtp-dom-parsers.cpp b/libgnucash/backend/xml/sixtp-dom-parsers.cpp index 5d33afe19c..2b693ca3e8 100644 --- a/libgnucash/backend/xml/sixtp-dom-parsers.cpp +++ b/libgnucash/backend/xml/sixtp-dom-parsers.cpp @@ -22,14 +22,11 @@ ********************************************************************/ #include -extern "C" -{ #include #include #include -} #include "gnc-xml-helper.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/sixtp-stack.cpp b/libgnucash/backend/xml/sixtp-stack.cpp index 36bbc4a6e5..7cd7597c64 100644 --- a/libgnucash/backend/xml/sixtp-stack.cpp +++ b/libgnucash/backend/xml/sixtp-stack.cpp @@ -20,10 +20,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * ********************************************************************/ -extern "C" -{ #include -} #include "sixtp.h" #include "sixtp-stack.h" diff --git a/libgnucash/backend/xml/sixtp-to-dom-parser.cpp b/libgnucash/backend/xml/sixtp-to-dom-parser.cpp index 277a6f8672..7578bc381b 100644 --- a/libgnucash/backend/xml/sixtp-to-dom-parser.cpp +++ b/libgnucash/backend/xml/sixtp-to-dom-parser.cpp @@ -20,11 +20,8 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * ********************************************************************/ -extern "C" -{ #include #include -} #include diff --git a/libgnucash/backend/xml/sixtp-utils.cpp b/libgnucash/backend/xml/sixtp-utils.cpp index 9faadbe67c..3da4b1f121 100644 --- a/libgnucash/backend/xml/sixtp-utils.cpp +++ b/libgnucash/backend/xml/sixtp-utils.cpp @@ -23,8 +23,6 @@ #define __EXTENSIONS__ #include -extern "C" -{ #include #include @@ -40,7 +38,6 @@ extern "C" #include "strptime.h" #endif #include -} #include "sixtp.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/sixtp.cpp b/libgnucash/backend/xml/sixtp.cpp index cc82f20921..199d8258b4 100644 --- a/libgnucash/backend/xml/sixtp.cpp +++ b/libgnucash/backend/xml/sixtp.cpp @@ -23,8 +23,6 @@ #include #include -extern "C" -{ #include #include #include @@ -36,7 +34,6 @@ extern "C" typedef int ssize_t; # define g_fopen fopen #endif -} #include "sixtp.h" #include "sixtp-parsers.h" diff --git a/libgnucash/backend/xml/test/test-dom-converters1.cpp b/libgnucash/backend/xml/test/test-dom-converters1.cpp index 02c31dfe66..2e70ab9805 100644 --- a/libgnucash/backend/xml/test/test-dom-converters1.cpp +++ b/libgnucash/backend/xml/test/test-dom-converters1.cpp @@ -23,8 +23,6 @@ */ #include -extern "C" -{ #include #include @@ -33,7 +31,6 @@ extern "C" #include "cashobjects.h" #include "gnc-engine.h" #include "gnc-commodity.h" -} #include diff --git a/libgnucash/backend/xml/test/test-file-stuff.cpp b/libgnucash/backend/xml/test/test-file-stuff.cpp index 0264c81224..da5f14151e 100644 --- a/libgnucash/backend/xml/test/test-file-stuff.cpp +++ b/libgnucash/backend/xml/test/test-file-stuff.cpp @@ -24,8 +24,6 @@ #include #include -extern "C" -{ #include #include @@ -37,7 +35,6 @@ extern "C" #include "gnc-engine.h" #include "test-stuff.h" -} #include diff --git a/libgnucash/backend/xml/test/test-kvp-frames.cpp b/libgnucash/backend/xml/test/test-kvp-frames.cpp index 508d60020c..eca84dda94 100644 --- a/libgnucash/backend/xml/test/test-kvp-frames.cpp +++ b/libgnucash/backend/xml/test/test-kvp-frames.cpp @@ -1,7 +1,5 @@ #include -extern "C" -{ #include #include @@ -10,7 +8,6 @@ extern "C" #include "test-engine-stuff.h" #include "qof.h" -} #include "test-file-stuff.h" #include "sixtp-dom-generators.h" diff --git a/libgnucash/backend/xml/test/test-load-backend.cpp b/libgnucash/backend/xml/test/test-load-backend.cpp index 65d5406365..0cf924a5be 100644 --- a/libgnucash/backend/xml/test/test-load-backend.cpp +++ b/libgnucash/backend/xml/test/test-load-backend.cpp @@ -24,13 +24,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -extern "C" -{ #include #include "qof.h" #include "cashobjects.h" #include "test-stuff.h" -} #define GNC_LIB_NAME "gncmod-backend-xml" #define GNC_LIB_REL_PATH "xml" diff --git a/libgnucash/backend/xml/test/test-load-example-account.cpp b/libgnucash/backend/xml/test/test-load-example-account.cpp index 3596a7cad4..c8fdf3248a 100644 --- a/libgnucash/backend/xml/test/test-load-example-account.cpp +++ b/libgnucash/backend/xml/test/test-load-example-account.cpp @@ -22,8 +22,6 @@ */ #include -extern "C" -{ #include #include #include @@ -34,7 +32,6 @@ extern "C" #include "gnc-engine.h" #include "test-engine-stuff.h" -} #include diff --git a/libgnucash/backend/xml/test/test-load-xml2.cpp b/libgnucash/backend/xml/test/test-load-xml2.cpp index 5325b29480..ef6ecc4c91 100644 --- a/libgnucash/backend/xml/test/test-load-xml2.cpp +++ b/libgnucash/backend/xml/test/test-load-xml2.cpp @@ -29,8 +29,6 @@ #include #include -extern "C" -{ #include #include #include @@ -48,7 +46,6 @@ extern "C" #include #include -} #include "../gnc-backend-xml.h" #include "../io-gncxml-v2.h" diff --git a/libgnucash/backend/xml/test/test-string-converters.cpp b/libgnucash/backend/xml/test/test-string-converters.cpp index 72f74ba212..22509aad04 100644 --- a/libgnucash/backend/xml/test/test-string-converters.cpp +++ b/libgnucash/backend/xml/test/test-string-converters.cpp @@ -17,15 +17,12 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ -extern "C" -{ #include #include #include "gnc-engine.h" #include "test-engine-stuff.h" -} #include "test-file-stuff.h" #include "sixtp-dom-parsers.h" diff --git a/libgnucash/backend/xml/test/test-xml-account.cpp b/libgnucash/backend/xml/test/test-xml-account.cpp index ee90e5901b..bc5d541fe5 100644 --- a/libgnucash/backend/xml/test/test-xml-account.cpp +++ b/libgnucash/backend/xml/test/test-xml-account.cpp @@ -24,8 +24,6 @@ #include #include -extern "C" -{ #include #include @@ -37,7 +35,6 @@ extern "C" #include "Account.h" #include "Scrub.h" -} #include diff --git a/libgnucash/backend/xml/test/test-xml-commodity.cpp b/libgnucash/backend/xml/test/test-xml-commodity.cpp index 5deeeed9d3..58683a75ea 100644 --- a/libgnucash/backend/xml/test/test-xml-commodity.cpp +++ b/libgnucash/backend/xml/test/test-xml-commodity.cpp @@ -20,8 +20,6 @@ #include #include -extern "C" -{ #include #include @@ -30,7 +28,6 @@ extern "C" #include "test-engine-stuff.h" #include "Account.h" -} #include diff --git a/libgnucash/backend/xml/test/test-xml-pricedb.cpp b/libgnucash/backend/xml/test/test-xml-pricedb.cpp index b5a734cc0b..0b625b7e54 100644 --- a/libgnucash/backend/xml/test/test-xml-pricedb.cpp +++ b/libgnucash/backend/xml/test/test-xml-pricedb.cpp @@ -24,8 +24,6 @@ #include #include -extern "C" -{ #include #include @@ -36,7 +34,6 @@ extern "C" #include "gnc-pricedb.h" #include "test-engine-stuff.h" -} #include "gnc-xml-helper.h" #include "gnc-xml.h" diff --git a/libgnucash/backend/xml/test/test-xml-transaction.cpp b/libgnucash/backend/xml/test/test-xml-transaction.cpp index 54a22262ad..4eddc6598d 100644 --- a/libgnucash/backend/xml/test/test-xml-transaction.cpp +++ b/libgnucash/backend/xml/test/test-xml-transaction.cpp @@ -24,8 +24,6 @@ #include #include -extern "C" -{ #include #include @@ -45,7 +43,6 @@ extern "C" #include #include #include -} #include "../gnc-xml-helper.h" #include "../gnc-xml.h" diff --git a/libgnucash/backend/xml/test/test-xml2-is-file.cpp b/libgnucash/backend/xml/test/test-xml2-is-file.cpp index 82ff4526db..6303313f0c 100644 --- a/libgnucash/backend/xml/test/test-xml2-is-file.cpp +++ b/libgnucash/backend/xml/test/test-xml2-is-file.cpp @@ -17,12 +17,9 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ -extern "C" -{ #include #include #include -} #include "test-engine-stuff.h" #include "io-gncxml-v2.h" diff --git a/libgnucash/core-utils/gnc-environment.h b/libgnucash/core-utils/gnc-environment.h index 44372a2777..a095e229ea 100644 --- a/libgnucash/core-utils/gnc-environment.h +++ b/libgnucash/core-utils/gnc-environment.h @@ -46,12 +46,20 @@ #ifndef GNC_ENVIRONMENT_H #define GNC_ENVIRONMENT_H +#ifdef __cplusplus +extern "C" { +#endif + /** Parse /etc/gnucash/environment and set environment variables * based on the contents of that file. Read the comments in * /etc/gnucash/environment for more details. */ void gnc_environment_setup (void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_ENVIRONMENT_H */ /** @} */ diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp index d65038a2ff..0123069b68 100644 --- a/libgnucash/core-utils/gnc-filepath-utils.cpp +++ b/libgnucash/core-utils/gnc-filepath-utils.cpp @@ -31,7 +31,6 @@ #include #include -extern "C" { #include #include @@ -63,7 +62,6 @@ extern "C" { #ifdef MAC_INTEGRATION #include #endif -} #include "gnc-locale-utils.hpp" #include diff --git a/libgnucash/core-utils/gnc-filepath-utils.h b/libgnucash/core-utils/gnc-filepath-utils.h index 57e1ddf777..1f5ca8bae0 100644 --- a/libgnucash/core-utils/gnc-filepath-utils.h +++ b/libgnucash/core-utils/gnc-filepath-utils.h @@ -29,6 +29,10 @@ #ifndef GNC_FILEPATH_UTILS_H #define GNC_FILEPATH_UTILS_H +#ifdef __cplusplus +extern "C" { +#endif + /** The gnc_resolve_file_path() routine is a utility that will accept * a fragmentary filename as input, and resolve it into a fully * qualified path in the file system, i.e. a path that begins with @@ -190,4 +194,8 @@ typedef struct */ GList *gnc_list_all_paths (void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_FILEPATH_UTILS_H */ diff --git a/libgnucash/core-utils/gnc-path.h b/libgnucash/core-utils/gnc-path.h index cc133e9217..fba6aae603 100644 --- a/libgnucash/core-utils/gnc-path.h +++ b/libgnucash/core-utils/gnc-path.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** Returns the installation prefix path, usually * "$prefix". * @@ -118,5 +122,8 @@ gchar *gnc_path_get_reportsdir(void); gchar *gnc_path_get_stdreportsdir(void); +#ifdef __cplusplus +} +#endif #endif /* GNC_PATH_H */ diff --git a/libgnucash/core-utils/gnc-prefs.h b/libgnucash/core-utils/gnc-prefs.h index 7d7a104d0e..5010bfc951 100644 --- a/libgnucash/core-utils/gnc-prefs.h +++ b/libgnucash/core-utils/gnc-prefs.h @@ -45,11 +45,7 @@ #ifndef GNC_PREFS_H #define GNC_PREFS_H -#ifdef __cplusplus -extern "C++" { #include -} -#endif /* Preference groups used across multiple modules */ #define GNC_PREFS_GROUP_GENERAL "general" @@ -97,6 +93,10 @@ extern "C++" { #define GNC_PREF_CURRENCY_CHOICE_LOCALE "currency-choice-locale" #define GNC_PREF_CURRENCY_CHOICE_OTHER "currency-choice-other" +#ifdef __cplusplus +extern "C" { +#endif + /** @name Early bird functions, needed before any backend has been set up @{ */ @@ -569,6 +569,10 @@ void gnc_prefs_set_reg_negative_color_pref_id (gulong id); /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* GNC_PREFS_H */ diff --git a/libgnucash/core-utils/gnc-version.h b/libgnucash/core-utils/gnc-version.h index f3d6fee901..47e8b2bfce 100644 --- a/libgnucash/core-utils/gnc-version.h +++ b/libgnucash/core-utils/gnc-version.h @@ -44,12 +44,20 @@ * /etc/gnucash/environment for more details. */ +#ifdef __cplusplus +extern "C" { +#endif + const char *gnc_version(void); const char *gnc_build_id(void); const char *gnc_vcs_rev(void); const char *gnc_vcs_rev_date(void); const int gnc_gnucash_major_version(void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_VERSION_H */ /** @} */ diff --git a/libgnucash/core-utils/test/gtest-path-utilities.cpp b/libgnucash/core-utils/test/gtest-path-utilities.cpp index 90e1240ee6..14792dfcab 100644 --- a/libgnucash/core-utils/test/gtest-path-utilities.cpp +++ b/libgnucash/core-utils/test/gtest-path-utilities.cpp @@ -1,13 +1,10 @@ #include -extern "C" -{ #include #include #include #include #include -} #include diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp index b0fc10f6b6..5f293ab4bc 100644 --- a/libgnucash/engine/Account.cpp +++ b/libgnucash/engine/Account.cpp @@ -25,9 +25,7 @@ #include -extern "C" { #include "gnc-prefs.h" -} #include #include diff --git a/libgnucash/engine/Query.h b/libgnucash/engine/Query.h index b3722ae086..096e4f6af8 100644 --- a/libgnucash/engine/Query.h +++ b/libgnucash/engine/Query.h @@ -30,6 +30,10 @@ #include "qof.h" #include "Account.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * This function defines a compatibility API from the old Query API to * the new Query API. Note that it is not a 100% complete equivalent. @@ -186,4 +190,8 @@ void xaccQueryAddGUIDMatch(QofQuery * q, const GncGUID *guid, time64 xaccQueryGetEarliestDateFound(QofQuery * q); time64 xaccQueryGetLatestDateFound(QofQuery * q); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libgnucash/engine/Recurrence.h b/libgnucash/engine/Recurrence.h index 6f8df001e7..298cb6cbac 100644 --- a/libgnucash/engine/Recurrence.h +++ b/libgnucash/engine/Recurrence.h @@ -44,6 +44,10 @@ #include "Account.h" #include "gnc-numeric.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { PERIOD_ONCE, /* Not a true period at all, but convenient here. */ @@ -185,4 +189,8 @@ int recurrenceListCmp(GList *a, GList *b); void recurrenceListFree(GList **recurrence); +#ifdef __cplusplus +} +#endif + #endif /* RECURRENCE_H */ diff --git a/libgnucash/engine/SX-book-p.h b/libgnucash/engine/SX-book-p.h index 4513811c04..3339cd4ee3 100644 --- a/libgnucash/engine/SX-book-p.h +++ b/libgnucash/engine/SX-book-p.h @@ -39,6 +39,10 @@ /* ====================================================================== */ +#ifdef __cplusplus +extern "C" { +#endif + SchedXactions* gnc_collection_get_schedxactions(const QofCollection *col); /* Associate the given template root account with a book */ @@ -46,4 +50,8 @@ void gnc_book_set_template_root (QofBook *book, Account *templateRoot); gboolean gnc_sxtt_register (void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_SX_BOOK_P_H */ diff --git a/libgnucash/engine/SX-book.h b/libgnucash/engine/SX-book.h index 111aaceafb..82b9e2c85e 100644 --- a/libgnucash/engine/SX-book.h +++ b/libgnucash/engine/SX-book.h @@ -42,14 +42,15 @@ typedef struct xaccSchedXactionsDef SchedXactions; typedef struct _SchedXactionsClass SchedXactionsClass; -#ifdef __cplusplus -extern "C++" { #include -} -#endif + #include "SchedXaction.h" #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + struct xaccSchedXactionsDef { QofInstance inst; @@ -91,6 +92,10 @@ Account *gnc_book_get_template_root(const QofBook *book); /** @return The list of SXes which reference the given Account. Caller should free this list. **/ GList* gnc_sx_get_sxes_referencing_account(QofBook *book, Account *acct); +#ifdef __cplusplus +} +#endif + #endif /* GNC_SX_BOOK_H */ /** @} */ /** @} */ diff --git a/libgnucash/engine/SX-ttinfo.h b/libgnucash/engine/SX-ttinfo.h index 72486f7a66..1c36d1d3ea 100644 --- a/libgnucash/engine/SX-ttinfo.h +++ b/libgnucash/engine/SX-ttinfo.h @@ -31,6 +31,10 @@ #include "Account.h" #include "gnc-commodity.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct TTInfo_s TTInfo; typedef struct TTSplitInfo_s TTSplitInfo; @@ -87,4 +91,8 @@ const char *gnc_ttsplitinfo_get_debit_formula(TTSplitInfo *split_i); void gnc_ttsplitinfo_set_account(TTSplitInfo *split_i, Account *acc); Account *gnc_ttsplitinfo_get_account(TTSplitInfo *split_i); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libgnucash/engine/SchedXaction.h b/libgnucash/engine/SchedXaction.h index 4fa22d459e..e58b6d2042 100644 --- a/libgnucash/engine/SchedXaction.h +++ b/libgnucash/engine/SchedXaction.h @@ -44,6 +44,10 @@ typedef struct _SchedXactionClass SchedXactionClass; #include "Recurrence.h" #include "gnc-engine.h" +#ifdef __cplusplus +extern "C" { +#endif + /* --- type macros --- */ #define GNC_TYPE_SCHEDXACTION (gnc_schedxaction_get_type ()) #define GNC_SCHEDXACTION(o) \ @@ -322,6 +326,10 @@ gboolean SXRegister (void); /** \deprecated */ #define xaccSchedXactionGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X)) +#ifdef __cplusplus +} +#endif + #endif /* XACC_SCHEDXACTION_H */ /** @} */ diff --git a/libgnucash/engine/Scrub.h b/libgnucash/engine/Scrub.h index 34ec0e5985..ddfca07eb3 100644 --- a/libgnucash/engine/Scrub.h +++ b/libgnucash/engine/Scrub.h @@ -52,6 +52,10 @@ #include "gnc-engine.h" +#ifdef __cplusplus +extern "C" { +#endif + /** @name Double-Entry Scrubbing Convert single-entry accounts to clean double-entry @@ -170,6 +174,10 @@ void xaccAccountScrubColorNotSet (QofBook *book); */ void xaccTransScrubPostedDate (Transaction *trans); +#ifdef __cplusplus +} +#endif + #endif /* XACC_SCRUB_H */ /** @} */ /** @} */ diff --git a/libgnucash/engine/Scrub3.h b/libgnucash/engine/Scrub3.h index 2c1a8eae75..43501801d7 100644 --- a/libgnucash/engine/Scrub3.h +++ b/libgnucash/engine/Scrub3.h @@ -34,6 +34,10 @@ #include "gnc-engine.h" +#ifdef __cplusplus +extern "C" { +#endif + /** @name High-Level Lot Constraint * Provides the high-level API for checking and repairing ('scrubbing * clean') the usage of Lots and Cap Gains transactions in stock and @@ -70,6 +74,11 @@ void xaccAccountScrubLots (Account *acc); void xaccAccountTreeScrubLots (Account *acc); /** @} */ + +#ifdef __cplusplus +} +#endif + #endif /* XACC_SCRUB3_H */ /** @} */ /** @} */ diff --git a/libgnucash/engine/SplitP.h b/libgnucash/engine/SplitP.h index 4192cc5dde..93cfe8312c 100644 --- a/libgnucash/engine/SplitP.h +++ b/libgnucash/engine/SplitP.h @@ -52,6 +52,10 @@ #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + /** STRUCTS *********************************************************/ /* A "split" is more commonly referred to as an "entry" in a "transaction". */ @@ -232,6 +236,10 @@ typedef struct SplitTestFunctions* _utest_split_fill_functions (void); +#ifdef __cplusplus +} +#endif + /*@}*/ diff --git a/libgnucash/engine/TransLog.h b/libgnucash/engine/TransLog.h index 502171b858..9f1ba8fd61 100644 --- a/libgnucash/engine/TransLog.h +++ b/libgnucash/engine/TransLog.h @@ -46,6 +46,10 @@ #include "Account.h" #include "Transaction.h" +#ifdef __cplusplus +extern "C" { +#endif + void xaccOpenLog (void); void xaccCloseLog (void); void xaccReopenLog (void); @@ -81,6 +85,10 @@ void xaccLogSetBaseName (const char *); /** Test a filename to see if it is the name of the current logfile */ gboolean xaccFileIsCurrentLog (const gchar *name); +#ifdef __cplusplus +} +#endif + #endif /* XACC_TRANS_LOG_H */ /** @} */ /** @} */ diff --git a/libgnucash/engine/TransactionP.h b/libgnucash/engine/TransactionP.h index 3e107ff390..e90b45fc8f 100644 --- a/libgnucash/engine/TransactionP.h +++ b/libgnucash/engine/TransactionP.h @@ -52,6 +52,10 @@ #include "SplitP.h" #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + /** STRUCTS *********************************************************/ /* @@ -205,5 +209,9 @@ TransTestFunctions* _utest_trans_fill_functions (void); /*@}*/ +#ifdef __cplusplus +} +#endif + #endif /* XACC_TRANSACTION_P_H */ diff --git a/libgnucash/engine/cashobjects.h b/libgnucash/engine/cashobjects.h index 42dfd2be72..b6759517d9 100644 --- a/libgnucash/engine/cashobjects.h +++ b/libgnucash/engine/cashobjects.h @@ -30,6 +30,14 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + gboolean cashobjects_register(void); +#ifdef __cplusplus +} +#endif + #endif /* _CASHOBJECTS_H */ diff --git a/libgnucash/engine/engine-helpers.h b/libgnucash/engine/engine-helpers.h index 29a504ce94..57900484ef 100644 --- a/libgnucash/engine/engine-helpers.h +++ b/libgnucash/engine/engine-helpers.h @@ -25,17 +25,17 @@ #ifndef ENGINE_HELPERS_H #define ENGINE_HELPERS_H -#ifdef __cplusplus -extern "C++" { #include -} -#endif #include "gnc-engine.h" #include "Account.h" #include "Query.h" #include "Transaction.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*GncBOCb) (gpointer new_val, gpointer user_data); /** Gets the transaction Number or split Action based on book option: @@ -83,4 +83,8 @@ gnc_book_option_register_cb (gchar *key, GncBOCb func, gpointer user_data); void gnc_book_option_remove_cb (gchar *key, GncBOCb func, gpointer user_data); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libgnucash/engine/gnc-accounting-period.h b/libgnucash/engine/gnc-accounting-period.h index 835d03b9cb..80997ffcf1 100644 --- a/libgnucash/engine/gnc-accounting-period.h +++ b/libgnucash/engine/gnc-accounting-period.h @@ -47,6 +47,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * This specifies a time interval. */ @@ -125,6 +129,10 @@ time64 gnc_accounting_period_fiscal_end (void); /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* GNC_ACCOUNTING_PERIOD_H */ /** @} */ diff --git a/libgnucash/engine/gnc-aqbanking-templates.cpp b/libgnucash/engine/gnc-aqbanking-templates.cpp index b8a7c7a4a9..27cb5cdf1e 100644 --- a/libgnucash/engine/gnc-aqbanking-templates.cpp +++ b/libgnucash/engine/gnc-aqbanking-templates.cpp @@ -27,10 +27,7 @@ #include -extern "C" -{ #include "gnc-aqbanking-templates.h" -} #include "qofinstance-p.h" #include "kvp-frame.hpp" diff --git a/libgnucash/engine/gnc-commodity.h b/libgnucash/engine/gnc-commodity.h index cafc331e7f..75d0bc693b 100644 --- a/libgnucash/engine/gnc-commodity.h +++ b/libgnucash/engine/gnc-commodity.h @@ -49,12 +49,8 @@ typedef struct _GncCommodityClass gnc_commodityClass; typedef struct _GncCommodityNamespaceClass gnc_commodity_namespaceClass; -#ifdef __cplusplus -extern "C++" { #include #include -} -#endif #include "gnc-engine.h" diff --git a/libgnucash/engine/gnc-commodity.hpp b/libgnucash/engine/gnc-commodity.hpp index d4590c62c2..b1e0c53cc7 100644 --- a/libgnucash/engine/gnc-commodity.hpp +++ b/libgnucash/engine/gnc-commodity.hpp @@ -35,9 +35,7 @@ #include -extern "C" { #include -} using CommVec = std::vector; diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp index 326a72a3bc..ba3c5c84c5 100644 --- a/libgnucash/engine/gnc-date.cpp +++ b/libgnucash/engine/gnc-date.cpp @@ -27,8 +27,6 @@ #define __EXTENSIONS__ #include -extern "C" -{ #include #include @@ -45,7 +43,6 @@ extern "C" #ifdef G_OS_WIN32 # include #endif -} #include #include diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h index d2da7be275..0b06af4a88 100644 --- a/libgnucash/engine/gnc-date.h +++ b/libgnucash/engine/gnc-date.h @@ -69,21 +69,15 @@ #ifndef GNC_DATE_H #define GNC_DATE_H +#include + +#include #ifdef __cplusplus extern "C" { #endif -#ifdef __cplusplus -extern "C++" { -#endif -#include -#ifdef __cplusplus -} -#endif - -#include /** * Many systems, including Microsoft Windows and BSD-derived Unixes diff --git a/libgnucash/engine/gnc-datetime.cpp b/libgnucash/engine/gnc-datetime.cpp index d030f8e09c..62764b672b 100644 --- a/libgnucash/engine/gnc-datetime.cpp +++ b/libgnucash/engine/gnc-datetime.cpp @@ -22,11 +22,8 @@ * * \********************************************************************/ -extern "C" -{ #include #include "platform.h" -} #include #include #include diff --git a/libgnucash/engine/gnc-engine.h b/libgnucash/engine/gnc-engine.h index c3693a6007..9a981c8e52 100644 --- a/libgnucash/engine/gnc-engine.h +++ b/libgnucash/engine/gnc-engine.h @@ -36,11 +36,7 @@ #ifndef GNC_ENGINE_H #define GNC_ENGINE_H -#ifdef __cplusplus -extern "C++" { #include -} -#endif #include "qof.h" diff --git a/libgnucash/engine/gnc-euro.h b/libgnucash/engine/gnc-euro.h index 13f47bbf2b..93c9c69e91 100644 --- a/libgnucash/engine/gnc-euro.h +++ b/libgnucash/engine/gnc-euro.h @@ -27,6 +27,10 @@ #include "gnc-commodity.h" #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + gboolean gnc_is_euro_currency (const gnc_commodity * currency); gnc_numeric gnc_convert_to_euro (const gnc_commodity * currency, gnc_numeric value); @@ -36,4 +40,8 @@ gnc_numeric gnc_euro_currency_get_rate (const gnc_commodity *currency); gnc_commodity * gnc_get_euro (void); +#ifdef __cplusplus +} +#endif + #endif /* EURO_UTILS_H */ diff --git a/libgnucash/engine/gnc-features.cpp b/libgnucash/engine/gnc-features.cpp index edb62f8a50..79bfea18c8 100644 --- a/libgnucash/engine/gnc-features.cpp +++ b/libgnucash/engine/gnc-features.cpp @@ -29,10 +29,7 @@ #include #include "qofbook.hpp" -extern "C" -{ #include "gnc-features.h" -} static const FeaturesTable features_table { diff --git a/libgnucash/engine/gnc-hooks.h b/libgnucash/engine/gnc-hooks.h index efbddd44a9..63fc902d69 100644 --- a/libgnucash/engine/gnc-hooks.h +++ b/libgnucash/engine/gnc-hooks.h @@ -25,6 +25,10 @@ #ifndef GNC_HOOKS_H #define GNC_HOOKS_H +#ifdef __cplusplus +extern "C" { +#endif + /** * Create a new hook. Not a common occurrence, but... * The returned string is just the 'name' argument, @@ -73,4 +77,8 @@ void gnc_hooks_init(void); #define HOOK_BOOK_CLOSED "hook_book_closed" #define HOOK_BOOK_SAVED "hook_book_saved" +#ifdef __cplusplus +} +#endif + #endif /* GNC_HOOKS_H */ diff --git a/libgnucash/engine/gnc-int128.cpp b/libgnucash/engine/gnc-int128.cpp index 8ec77f5ce2..d670232aba 100644 --- a/libgnucash/engine/gnc-int128.cpp +++ b/libgnucash/engine/gnc-int128.cpp @@ -21,10 +21,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * *******************************************************************/ -extern "C" -{ #include -} #include "gnc-int128.hpp" diff --git a/libgnucash/engine/gnc-int128.hpp b/libgnucash/engine/gnc-int128.hpp index db463fad82..a352f73eb2 100644 --- a/libgnucash/engine/gnc-int128.hpp +++ b/libgnucash/engine/gnc-int128.hpp @@ -25,8 +25,6 @@ #ifndef GNCINT128_H #define GNCINT128_H -extern "C" -{ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif @@ -37,7 +35,6 @@ extern "C" #define __STDC_FORMAT_MACROS 1 #endif #include -} #include #include diff --git a/libgnucash/engine/gnc-numeric.cpp b/libgnucash/engine/gnc-numeric.cpp index 40a57464ce..a33519855e 100644 --- a/libgnucash/engine/gnc-numeric.cpp +++ b/libgnucash/engine/gnc-numeric.cpp @@ -33,11 +33,8 @@ #include #include -extern "C" -{ #include #include "qof.h" -} #include "gnc-numeric.hpp" #include "gnc-rational.hpp" diff --git a/libgnucash/engine/gnc-numeric.h b/libgnucash/engine/gnc-numeric.h index 64b0bc6251..254d18ca9f 100644 --- a/libgnucash/engine/gnc-numeric.h +++ b/libgnucash/engine/gnc-numeric.h @@ -49,13 +49,14 @@ See \ref gncnumericexample #ifndef GNC_NUMERIC_H #define GNC_NUMERIC_H + +#include + #ifdef __cplusplus extern "C" { #endif -#include - struct _gnc_numeric { gint64 num; diff --git a/libgnucash/engine/gnc-option-date.cpp b/libgnucash/engine/gnc-option-date.cpp index 023ab4f6c3..918ca3ba59 100644 --- a/libgnucash/engine/gnc-option-date.cpp +++ b/libgnucash/engine/gnc-option-date.cpp @@ -27,10 +27,7 @@ #include #include -extern "C" -{ #include "gnc-accounting-period.h" -} #define N_(string) string //So that xgettext will find it diff --git a/libgnucash/engine/gnc-option-date.hpp b/libgnucash/engine/gnc-option-date.hpp index c7da74dad9..98dc0fac07 100644 --- a/libgnucash/engine/gnc-option-date.hpp +++ b/libgnucash/engine/gnc-option-date.hpp @@ -31,10 +31,7 @@ #ifndef GNC_OPTION_DATE_HPP_ #define GNC_OPTION_DATE_HPP_ -extern "C" -{ #include "gnc-date.h" -} #include #include diff --git a/libgnucash/engine/gnc-option-impl.cpp b/libgnucash/engine/gnc-option-impl.cpp index 0dd2813e2d..80f7c5aedd 100644 --- a/libgnucash/engine/gnc-option-impl.cpp +++ b/libgnucash/engine/gnc-option-impl.cpp @@ -29,12 +29,9 @@ #include #include -extern "C" -{ #include "gnc-accounting-period.h" #include "gnc-session.h" #include "gncOwner.h" -} static const QofLogModule log_module{"gnc.options"}; diff --git a/libgnucash/engine/gnc-option-impl.hpp b/libgnucash/engine/gnc-option-impl.hpp index c72b63bed5..c145a430cd 100644 --- a/libgnucash/engine/gnc-option-impl.hpp +++ b/libgnucash/engine/gnc-option-impl.hpp @@ -34,14 +34,12 @@ #define GNC_OPTION_IMPL_HPP_ #include "gnc-option.hpp" -extern "C" -{ + #include #include "qof.h" #include "Account.h" #include "gnc-budget.h" #include "gnc-commodity.h" -} #include "gnc-datetime.hpp" #include #include diff --git a/libgnucash/engine/gnc-option.cpp b/libgnucash/engine/gnc-option.cpp index 0e2392d354..277491645e 100644 --- a/libgnucash/engine/gnc-option.cpp +++ b/libgnucash/engine/gnc-option.cpp @@ -28,10 +28,7 @@ static const char* log_module{"gnc.app-utils.gnc-option"}; -extern "C" -{ #include "qoflog.h" -} template , diff --git a/libgnucash/engine/gnc-option.hpp b/libgnucash/engine/gnc-option.hpp index 8df1a1ca6b..828ebaae29 100644 --- a/libgnucash/engine/gnc-option.hpp +++ b/libgnucash/engine/gnc-option.hpp @@ -50,9 +50,9 @@ using GncOptionUIItemPtr = std::unique_ptr; #ifndef SWIG //SWIG pulls in GncOwner from swig-engine. struct _gncOwner; using GncOwner = _gncOwner; -#endif struct _QofQuery; using QofQuery = _QofQuery; +#endif struct QofInstance_s; using QofInstance = QofInstance_s; template class GncOptionValue; diff --git a/libgnucash/engine/gnc-optiondb-impl.hpp b/libgnucash/engine/gnc-optiondb-impl.hpp index 75c7a82d8c..f6dbc169bb 100644 --- a/libgnucash/engine/gnc-optiondb-impl.hpp +++ b/libgnucash/engine/gnc-optiondb-impl.hpp @@ -39,8 +39,7 @@ #include #include #include -extern "C" -{ + #include #include "qof.h" #include "gncInvoice.h" @@ -49,7 +48,6 @@ extern "C" #include "gncJob.h" #include "gncVendor.h" #include "gncTaxTable.h" -} using GncOptionVec = std::vector; diff --git a/libgnucash/engine/gnc-optiondb.cpp b/libgnucash/engine/gnc-optiondb.cpp index 7f03a44ad4..9251618ca6 100644 --- a/libgnucash/engine/gnc-optiondb.cpp +++ b/libgnucash/engine/gnc-optiondb.cpp @@ -33,10 +33,7 @@ #include "gnc-optiondb-impl.hpp" #include "gnc-option-ui.hpp" -extern "C" -{ #include "gnc-session.h" -} constexpr const char* log_module{G_LOG_DOMAIN}; constexpr auto stream_max = std::numeric_limits::max(); diff --git a/libgnucash/engine/gnc-optiondb.h b/libgnucash/engine/gnc-optiondb.h index a3aa3686d3..61ad9afc5c 100644 --- a/libgnucash/engine/gnc-optiondb.h +++ b/libgnucash/engine/gnc-optiondb.h @@ -63,10 +63,6 @@ typedef struct GncOption GncOption; typedef struct GncOptionDB GncOptionDB; #endif -#ifdef __cplusplus -extern "C" -{ -#endif #include #include "Account.h" #include "gnc-budget.h" @@ -74,6 +70,11 @@ extern "C" #include "gncInvoice.h" #include "gncTaxTable.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /** * Create an empty option database. * diff --git a/libgnucash/engine/gnc-optiondb.hpp b/libgnucash/engine/gnc-optiondb.hpp index 58f550351b..7147001f3c 100644 --- a/libgnucash/engine/gnc-optiondb.hpp +++ b/libgnucash/engine/gnc-optiondb.hpp @@ -38,15 +38,13 @@ #include #include #include -extern "C" -{ + #include #include "Account.h" #include "gnc-budget.h" #include "gnc-commodity.h" #include "gncInvoice.h" #include "gncTaxTable.h" -} #include "gnc-option.hpp" #include "gnc-datetime.hpp" diff --git a/libgnucash/engine/gnc-pricedb-p.h b/libgnucash/engine/gnc-pricedb-p.h index 49eaefc923..d1cfc343a1 100644 --- a/libgnucash/engine/gnc-pricedb-p.h +++ b/libgnucash/engine/gnc-pricedb-p.h @@ -30,6 +30,10 @@ #include "gnc-engine.h" #include "gnc-pricedb.h" +#ifdef __cplusplus +extern "C" { +#endif + struct gnc_price_s { /* 'public' data fields */ @@ -96,4 +100,8 @@ gboolean gnc_pricedb_register (void); QofBackend * xaccPriceDBGetBackend (GNCPriceDB *prdb); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libgnucash/engine/gnc-session.h b/libgnucash/engine/gnc-session.h index fc89e17091..86aa27c8e8 100644 --- a/libgnucash/engine/gnc-session.h +++ b/libgnucash/engine/gnc-session.h @@ -21,7 +21,15 @@ #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + QofSession * gnc_get_current_session (void); void gnc_clear_current_session(void); void gnc_set_current_session (QofSession *session); gboolean gnc_current_session_exist(void); + +#ifdef __cplusplus +} +#endif diff --git a/libgnucash/engine/gnc-timezone.cpp b/libgnucash/engine/gnc-timezone.cpp index 06aedb2974..c5ef090a2c 100644 --- a/libgnucash/engine/gnc-timezone.cpp +++ b/libgnucash/engine/gnc-timezone.cpp @@ -31,11 +31,8 @@ //We'd prefer to use std::codecvt, but it's not supported by gcc until 5.0. #include #endif -extern "C" -{ #include "qoflog.h" static const QofLogModule log_module = "gnc-timezone"; -} using namespace gnc::date; diff --git a/libgnucash/engine/gnc-timezone.hpp b/libgnucash/engine/gnc-timezone.hpp index c533cfdd6f..97254af15e 100644 --- a/libgnucash/engine/gnc-timezone.hpp +++ b/libgnucash/engine/gnc-timezone.hpp @@ -22,13 +22,11 @@ #ifndef __GNC_TIMEZONE_HPP__ #define __GNC_TIMEZONE_HPP__ -extern "C" -{ + #include #if PLATFORM(WINDOWS) #include #endif -} #define BOOST_ERROR_CODE_HEADER_ONLY #include diff --git a/libgnucash/engine/gnc-uri-utils.h b/libgnucash/engine/gnc-uri-utils.h index cd3c1ad099..492c048dde 100644 --- a/libgnucash/engine/gnc-uri-utils.h +++ b/libgnucash/engine/gnc-uri-utils.h @@ -63,6 +63,10 @@ #include "platform.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Checks if the given uri is a valid uri * * A valid uri is defined by having at least a scheme and a path. @@ -310,6 +314,10 @@ gboolean gnc_uri_is_file_protocol (const gchar *protocol) /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* GNCURIUTILS_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncAddress.h b/libgnucash/engine/gncAddress.h index 1473130ce5..34db15eeb9 100644 --- a/libgnucash/engine/gncAddress.h +++ b/libgnucash/engine/gncAddress.h @@ -57,6 +57,10 @@ up to you to pass a suitable entity. #include "qof.h" #include "gncBusiness.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ADDRESS_MODULE_NAME "gncAddress" #define GNC_ID_ADDRESS GNC_ADDRESS_MODULE_NAME /** \struct GncAddress @@ -152,6 +156,10 @@ gboolean gncAddressEqual(const GncAddress *a, const GncAddress *b); #define ADDRESS_EMAIL "email" #define ADDRESS_OWNER "owner" +#ifdef __cplusplus +} +#endif + #endif /* GNC_ADDRESS_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncBillTerm.h b/libgnucash/engine/gncBillTerm.h index 724679cc75..a9b4314343 100644 --- a/libgnucash/engine/gncBillTerm.h +++ b/libgnucash/engine/gncBillTerm.h @@ -37,6 +37,10 @@ typedef struct _gncBillTermClass GncBillTermClass; #include "qof.h" #include "gncBusiness.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ID_BILLTERM "gncBillTerm" /* --- type macros --- */ @@ -168,6 +172,10 @@ time64 gncBillTermComputeDueDate (const GncBillTerm *term, time64 post_date); /* deprecated */ #define gncBillTermGetGUID(x) qof_instance_get_guid (QOF_INSTANCE(x)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_BILLTERM_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncBillTermP.h b/libgnucash/engine/gncBillTermP.h index 7cd456e8ac..16444ab315 100644 --- a/libgnucash/engine/gncBillTermP.h +++ b/libgnucash/engine/gncBillTermP.h @@ -31,6 +31,10 @@ #include "gncBillTerm.h" +#ifdef __cplusplus +extern "C" { +#endif + gboolean gncBillTermRegister (void); void gncBillTermSetParent (GncBillTerm *term, GncBillTerm *parent); @@ -42,5 +46,9 @@ gboolean gncBillTermGetInvisible (const GncBillTerm *term); #define gncBillTermSetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_BILLTERMP_H_ */ diff --git a/libgnucash/engine/gncBusiness.h b/libgnucash/engine/gncBusiness.h index 6fd23f2edd..2fe054d1d4 100644 --- a/libgnucash/engine/gncBusiness.h +++ b/libgnucash/engine/gncBusiness.h @@ -34,11 +34,8 @@ #ifndef GNC_BUSINESS_H_ #define GNC_BUSINESS_H_ -#ifdef __cplusplus -extern "C++" { #include -} -#endif + #include "qof.h" #include "Account.h" diff --git a/libgnucash/engine/gncCustomer.h b/libgnucash/engine/gncCustomer.h index 58ca70b1d5..d569310ffd 100644 --- a/libgnucash/engine/gncCustomer.h +++ b/libgnucash/engine/gncCustomer.h @@ -31,6 +31,10 @@ #ifndef GNC_CUSTOMER_H_ #define GNC_CUSTOMER_H_ +#ifdef __cplusplus +extern "C" { +#endif + /** @struct GncCustomer credit, discount and shipaddr are unique to GncCustomer\n @@ -164,6 +168,11 @@ gboolean gncCustomerEqual(const GncCustomer *a, const GncCustomer *b); GList * gncCustomerGetJoblist (const GncCustomer *customer, gboolean show_all); gboolean gncCustomerIsDirty (GncCustomer *customer); +#ifdef __cplusplus +} +#endif + + #endif /* GNC_CUSTOMER_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncEmployee.h b/libgnucash/engine/gncEmployee.h index 901123b621..0b49fdbf6a 100644 --- a/libgnucash/engine/gncEmployee.h +++ b/libgnucash/engine/gncEmployee.h @@ -31,6 +31,10 @@ #ifndef GNC_EMPLOYEE_H_ #define GNC_EMPLOYEE_H_ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _gncEmployee GncEmployee; typedef struct _gncEmployeeClass GncEmployeeClass; @@ -137,6 +141,10 @@ static inline GncEmployee * gncEmployeeLookup (const QofBook *book, const GncGUI gboolean gncEmployeeEqual(const GncEmployee* e1, const GncEmployee* e2); gboolean gncEmployeeIsDirty (const GncEmployee *employee); +#ifdef __cplusplus +} +#endif + #endif /* GNC_EMPLOYEE_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncEntry.h b/libgnucash/engine/gncEntry.h index bdb4c12128..a6cad18707 100644 --- a/libgnucash/engine/gncEntry.h +++ b/libgnucash/engine/gncEntry.h @@ -31,10 +31,10 @@ #ifndef GNC_ENTRY_H_ #define GNC_ENTRY_H_ -#ifdef __cplusplus -extern "C++" { #include -} + +#ifdef __cplusplus +extern "C" { #endif typedef struct _gncEntry GncEntry; @@ -335,6 +335,10 @@ int gncEntryCompare (const GncEntry *a, const GncEntry *b); /* deprecated functions, should be removed */ #define gncEntryGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_ENTRY_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncEntryP.h b/libgnucash/engine/gncEntryP.h index f34787439b..5a776453ec 100644 --- a/libgnucash/engine/gncEntryP.h +++ b/libgnucash/engine/gncEntryP.h @@ -31,6 +31,10 @@ #include "gncEntry.h" +#ifdef __cplusplus +extern "C" { +#endif + gboolean gncEntryRegister (void); void gncEntrySetGUID (GncEntry *entry, const GncGUID *guid); void gncEntrySetOrder (GncEntry *entry, GncOrder *order); @@ -40,4 +44,8 @@ void gncEntrySetDirty (GncEntry *entry, gboolean dirty); #define gncEntrySetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_ENTRYP_H_ */ diff --git a/libgnucash/engine/gncInvoice.h b/libgnucash/engine/gncInvoice.h index 43cb1865b3..d9b7de9b94 100644 --- a/libgnucash/engine/gncInvoice.h +++ b/libgnucash/engine/gncInvoice.h @@ -36,6 +36,10 @@ transaction and lot for the posted invoice. #ifndef GNC_INVOICE_H_ #define GNC_INVOICE_H_ +#ifdef __cplusplus +extern "C" { +#endif + struct _gncInvoice; typedef struct _gncInvoice GncInvoice; typedef struct _gncInvoiceClass GncInvoiceClass; @@ -316,6 +320,10 @@ QofBook *gncInvoiceGetBook (GncInvoice *x); /** Test support function used by test-dbi-business-stuff.c */ gboolean gncInvoiceEqual (const GncInvoice *a, const GncInvoice *b); +#ifdef __cplusplus +} +#endif + #endif /* GNC_INVOICE_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncInvoiceP.h b/libgnucash/engine/gncInvoiceP.h index e4ad64103e..db8c5a2592 100644 --- a/libgnucash/engine/gncInvoiceP.h +++ b/libgnucash/engine/gncInvoiceP.h @@ -34,6 +34,10 @@ #include "gnc-lot.h" #include "gncOwner.h" +#ifdef __cplusplus +extern "C" { +#endif + gboolean gncInvoiceRegister (void); gchar *gncInvoiceNextID (QofBook *book, const GncOwner *owner); void gncInvoiceSetPostedAcc (GncInvoice *invoice, Account *acc); @@ -46,4 +50,9 @@ void gncInvoiceDetachFromLot (GNCLot *lot); void gncInvoiceAttachToTxn (GncInvoice *invoice, Transaction *txn); #define gncInvoiceSetGUID(I,G) qof_instance_set_guid(QOF_INSTANCE(I),(G)) + +#ifdef __cplusplus +} +#endif + #endif /* GNC_INVOICEP_H_ */ diff --git a/libgnucash/engine/gncJob.h b/libgnucash/engine/gncJob.h index b40cdbcab4..72efe358dd 100644 --- a/libgnucash/engine/gncJob.h +++ b/libgnucash/engine/gncJob.h @@ -37,6 +37,10 @@ typedef struct _gncJobClass GncJobClass; #include "gncAddress.h" #include "gncOwner.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ID_JOB "gncJob" /* --- type macros --- */ @@ -116,6 +120,10 @@ gboolean gncJobEqual(const GncJob *a, const GncJob *b); #define gncJobRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())) #define gncJobLookupDirect(G,B) gncJobLookup((B),&(G)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_JOB_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncOrder.h b/libgnucash/engine/gncOrder.h index 7e77969640..f58d9ca579 100644 --- a/libgnucash/engine/gncOrder.h +++ b/libgnucash/engine/gncOrder.h @@ -41,6 +41,10 @@ typedef struct _gncOrderClass GncOrderClass; #include "gncOwner.h" #include "qof.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ID_ORDER "gncOrder" /* --- type macros --- */ @@ -118,6 +122,10 @@ static inline GncOrder * gncOrderLookup (const QofBook *book, const GncGUID *gui #define gncOrderGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x)) #define gncOrderGetBook(x) qof_instance_get_book(QOF_INSTANCE(x)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_ORDER_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncOwner.h b/libgnucash/engine/gncOwner.h index 81cfc8c090..f592f6bce9 100644 --- a/libgnucash/engine/gncOwner.h +++ b/libgnucash/engine/gncOwner.h @@ -33,6 +33,11 @@ #ifndef GNC_OWNER_H_ #define GNC_OWNER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _gncOwner GncOwner; #define GNC_ID_OWNER "gncOwner" @@ -346,6 +351,10 @@ void gncOwnerBeginEdit (GncOwner *owner); void gncOwnerCommitEdit (GncOwner *owner); void gncOwnerDestroy (GncOwner *owner); +#ifdef __cplusplus +} +#endif + #endif /* GNC_OWNER_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncTaxTable.h b/libgnucash/engine/gncTaxTable.h index 4ec0dafb23..2663d86e8d 100644 --- a/libgnucash/engine/gncTaxTable.h +++ b/libgnucash/engine/gncTaxTable.h @@ -31,6 +31,10 @@ #ifndef GNC_TAXTABLE_H_ #define GNC_TAXTABLE_H_ +#ifdef __cplusplus +extern "C" { +#endif + /** @struct GncTaxTable modtime is the internal date of the last modtime\n @@ -206,6 +210,10 @@ void gncAccountValueDestroy (GList *list); #define gncTaxTableRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())) #define gncTaxTableLookupDirect(G,B) gncTaxTableLookup((B), &(G)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_TAXTABLE_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/gncTaxTableP.h b/libgnucash/engine/gncTaxTableP.h index bf0074505e..edb9cdcbba 100644 --- a/libgnucash/engine/gncTaxTableP.h +++ b/libgnucash/engine/gncTaxTableP.h @@ -31,6 +31,10 @@ #include "gncTaxTable.h" +#ifdef __cplusplus +extern "C" { +#endif + gboolean gncTaxTableRegister (void); void gncTaxTableSetParent (GncTaxTable *table, GncTaxTable *parent); @@ -44,4 +48,8 @@ GncTaxTable* gncTaxTableEntryGetTable( const GncTaxTableEntry* entry ); #define gncTaxTableSetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G)) +#ifdef __cplusplus +} +#endif + #endif /* GNC_TAXTABLEP_H_ */ diff --git a/libgnucash/engine/gncVendor.h b/libgnucash/engine/gncVendor.h index 3bcdf6272c..2da073ea2b 100644 --- a/libgnucash/engine/gncVendor.h +++ b/libgnucash/engine/gncVendor.h @@ -31,6 +31,10 @@ #ifndef GNC_VENDOR_H_ #define GNC_VENDOR_H_ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _gncVendor GncVendor; typedef struct _gncVendorClass GncVendorClass; @@ -134,6 +138,11 @@ static inline GncVendor * gncVendorLookup (const QofBook *book, const GncGUID *g /** Test support function, used by test-dbi-business-stuff.c */ gboolean gncVendorEqual(const GncVendor *a, const GncVendor *b); gboolean gncVendorIsDirty (const GncVendor *vendor); + +#ifdef __cplusplus +} +#endif + #endif /* GNC_VENDOR_H_ */ /** @} */ /** @} */ diff --git a/libgnucash/engine/guid.cpp b/libgnucash/engine/guid.cpp index c58b49ac95..9202422a9c 100644 --- a/libgnucash/engine/guid.cpp +++ b/libgnucash/engine/guid.cpp @@ -23,8 +23,6 @@ \********************************************************************/ #include "guid.hpp" -extern "C" -{ #ifdef HAVE_CONFIG_H # include @@ -52,7 +50,6 @@ extern "C" #endif #include "qof.h" -} #include #include #include diff --git a/libgnucash/engine/guid.hpp b/libgnucash/engine/guid.hpp index 3a79852af7..ed1f460c79 100644 --- a/libgnucash/engine/guid.hpp +++ b/libgnucash/engine/guid.hpp @@ -24,9 +24,8 @@ #include #include -extern "C" { + #include "guid.h" -} namespace gnc { struct guid_syntax_exception : public std::invalid_argument diff --git a/libgnucash/engine/kvp-frame.cpp b/libgnucash/engine/kvp-frame.cpp index 56be042d4c..9066a8aad6 100644 --- a/libgnucash/engine/kvp-frame.cpp +++ b/libgnucash/engine/kvp-frame.cpp @@ -21,16 +21,12 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * ********************************************************************/ - -extern "C" -{ #include #include "qof.h" #include #include #include #include -} #include "kvp-value.hpp" #include "kvp-frame.hpp" diff --git a/libgnucash/engine/kvp-value.hpp b/libgnucash/engine/kvp-value.hpp index f5f1768709..515f69240a 100644 --- a/libgnucash/engine/kvp-value.hpp +++ b/libgnucash/engine/kvp-value.hpp @@ -24,11 +24,8 @@ #ifndef GNC_KVP_VALUE_TYPE #define GNC_KVP_VALUE_TYPE -extern "C" -{ #include #include "qof.h" -} #include #if BOOST_VERSION == 105600 #include diff --git a/libgnucash/engine/mocks/fake-qofquery.cpp b/libgnucash/engine/mocks/fake-qofquery.cpp index a82dadebf0..43542add27 100644 --- a/libgnucash/engine/mocks/fake-qofquery.cpp +++ b/libgnucash/engine/mocks/fake-qofquery.cpp @@ -124,8 +124,6 @@ qof_query_set_book (QofQuery *query, QofBook *book) ((QofFakeQuery*)query)->set_book(book); } -extern "C" -{ void xaccQueryAddDateMatchTT ( QofQuery *query, @@ -146,7 +144,6 @@ xaccQueryAddSingleAccountMatch(QofQuery *query, Account *acc, QofQueryOp op) ((QofFakeQuery*)query)->add_single_account_match(acc, op); } -} // extern "C" GList * qof_query_run (QofQuery *query) diff --git a/libgnucash/engine/mocks/gmock-qofinstance.cpp b/libgnucash/engine/mocks/gmock-qofinstance.cpp index e6e0c2c822..cd253b199d 100644 --- a/libgnucash/engine/mocks/gmock-qofinstance.cpp +++ b/libgnucash/engine/mocks/gmock-qofinstance.cpp @@ -2,10 +2,7 @@ #include -extern "C" -{ #include -} #include @@ -23,8 +20,6 @@ qof_instance_class_init(QofInstanceClass *klass) // function is unused, class functions are defined in C++ code } -extern "C" -{ // This is a reimplementation of the function from qofinstance.cpp void qof_instance_get (const QofInstance *inst, const gchar *first_prop, ...) @@ -50,4 +45,3 @@ qof_instance_set (QofInstance *inst, const gchar *first_prop, ...) va_end (ap); } -} // extern "C" diff --git a/libgnucash/engine/qof-backend.cpp b/libgnucash/engine/qof-backend.cpp index 6a5153a99c..db03d0831e 100644 --- a/libgnucash/engine/qof-backend.cpp +++ b/libgnucash/engine/qof-backend.cpp @@ -22,14 +22,11 @@ * * \********************************************************************/ -extern "C" -{ #include #include "qof.h" #include #include "gncla-dir.h" -} #include #include diff --git a/libgnucash/engine/qof-backend.hpp b/libgnucash/engine/qof-backend.hpp index aac960252e..9a66e03c79 100644 --- a/libgnucash/engine/qof-backend.hpp +++ b/libgnucash/engine/qof-backend.hpp @@ -41,14 +41,12 @@ #ifndef __QOF_BACKEND_HPP__ #define __QOF_BACKEND_HPP__ -extern "C" -{ + #include "qofbackend.h" #include "qofbook.h" #include "qofquery.h" #include "qofsession.h" #include -} #include "qofinstance-p.h" #include diff --git a/libgnucash/engine/qof-string-cache.cpp b/libgnucash/engine/qof-string-cache.cpp index eb236ebd0e..d3c9dce441 100644 --- a/libgnucash/engine/qof-string-cache.cpp +++ b/libgnucash/engine/qof-string-cache.cpp @@ -27,15 +27,12 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include #include "qof.h" -} /* Uncomment if you need to log anything. static QofLogModule log_module = QOF_MOD_UTIL; diff --git a/libgnucash/engine/qof.h b/libgnucash/engine/qof.h index ac3fbf569c..1549a2dd1f 100644 --- a/libgnucash/engine/qof.h +++ b/libgnucash/engine/qof.h @@ -68,11 +68,8 @@ */ /** @} */ -#ifdef __cplusplus -extern "C++" { #include -} -#endif + #include "qofid.h" #include "qoflog.h" #include "gnc-date.h" diff --git a/libgnucash/engine/qofbook.cpp b/libgnucash/engine/qofbook.cpp index f523368e94..ba73cdc947 100644 --- a/libgnucash/engine/qofbook.cpp +++ b/libgnucash/engine/qofbook.cpp @@ -34,9 +34,6 @@ */ #include -extern "C" -{ - #include #include @@ -48,8 +45,6 @@ extern "C" #endif #include -} - #include "qof.h" #include "qofevent-p.h" #include "qofbackend.h" diff --git a/libgnucash/engine/qofbook.h b/libgnucash/engine/qofbook.h index df6628e4a5..3dba3e9576 100644 --- a/libgnucash/engine/qofbook.h +++ b/libgnucash/engine/qofbook.h @@ -40,8 +40,8 @@ #ifndef QOF_BOOK_H #define QOF_BOOK_H +#include #ifdef __cplusplus -#include //To preempt it being included extern "C" in a later header. class GncOptionDB; #else typedef struct GncOptionDB GncOptionDB; diff --git a/libgnucash/engine/qofid.cpp b/libgnucash/engine/qofid.cpp index 83dfa52211..d48e55f9e7 100644 --- a/libgnucash/engine/qofid.cpp +++ b/libgnucash/engine/qofid.cpp @@ -24,11 +24,8 @@ #include -extern "C" -{ #include #include -} #include "qof.h" #include "qofid-p.h" diff --git a/libgnucash/engine/qofid.h b/libgnucash/engine/qofid.h index 6c1caac858..ff8de1b448 100644 --- a/libgnucash/engine/qofid.h +++ b/libgnucash/engine/qofid.h @@ -23,11 +23,6 @@ #ifndef QOF_ID_H #define QOF_ID_H -#ifdef __cplusplus -extern "C" -{ -#endif - /** @addtogroup Entity @{ */ /** @addtogroup Entities @@ -81,6 +76,11 @@ extern "C" #include #include "guid.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /** QofIdType declaration */ typedef const gchar * QofIdType; /** QofIdTypeConst declaration */ diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp index 12b7dcbfed..c79663741b 100644 --- a/libgnucash/engine/qofinstance.cpp +++ b/libgnucash/engine/qofinstance.cpp @@ -30,11 +30,8 @@ */ #include "guid.hpp" -extern "C" -{ #include #include -} #include #include "qof.h" diff --git a/libgnucash/engine/qofinstance.h b/libgnucash/engine/qofinstance.h index 5bc1513e1d..37dfe310dc 100644 --- a/libgnucash/engine/qofinstance.h +++ b/libgnucash/engine/qofinstance.h @@ -48,6 +48,10 @@ typedef struct _QofBook QofBook; #include "gnc-date.h" #include "qof-gobject.h" +#ifdef __cplusplus +extern "C" { +#endif + /* --- type macros --- */ #define QOF_TYPE_INSTANCE (qof_instance_get_type ()) #define QOF_INSTANCE(o) \ @@ -206,6 +210,10 @@ GList* qof_instance_get_typed_referring_object_list(const QofInstance* inst, con */ GList* qof_instance_get_referring_object_list_from_collection(const QofCollection* coll, const QofInstance* ref); +#ifdef __cplusplus +} +#endif + /* @} */ /* @} */ #endif /* QOF_INSTANCE_H */ diff --git a/libgnucash/engine/qoflog.cpp b/libgnucash/engine/qoflog.cpp index 993d9c208d..3766e1f139 100644 --- a/libgnucash/engine/qoflog.cpp +++ b/libgnucash/engine/qoflog.cpp @@ -27,8 +27,6 @@ #include #include -extern "C" -{ #include #include @@ -48,8 +46,6 @@ extern "C" #include #include -} - #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "qof.log" #include "qof.h" diff --git a/libgnucash/engine/qofobject.cpp b/libgnucash/engine/qofobject.cpp index 0138aad159..ab803e2994 100644 --- a/libgnucash/engine/qofobject.cpp +++ b/libgnucash/engine/qofobject.cpp @@ -40,18 +40,13 @@ static GList *book_list = NULL; * They should be removed when no longer needed */ -#ifdef __cplusplus extern "C" { -#endif gboolean get_object_is_initialized( void ); GList* get_object_modules( void ); GList* get_book_list( void ); - -#ifdef __cplusplus } -#endif gboolean get_object_is_initialized( void ) diff --git a/libgnucash/engine/qofquery.cpp b/libgnucash/engine/qofquery.cpp index f531857f01..b51027f379 100644 --- a/libgnucash/engine/qofquery.cpp +++ b/libgnucash/engine/qofquery.cpp @@ -22,15 +22,12 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include #include #include -} #include "qof.h" #include "qof-backend.hpp" diff --git a/libgnucash/engine/qofsession.cpp b/libgnucash/engine/qofsession.cpp index 2264712419..5ae072fc8f 100644 --- a/libgnucash/engine/qofsession.cpp +++ b/libgnucash/engine/qofsession.cpp @@ -33,9 +33,6 @@ */ #include -extern "C" -{ - #include #include @@ -53,7 +50,6 @@ extern "C" #include "qofobject-p.h" static QofLogModule log_module = QOF_MOD_SESSION; -} //extern 'C' #include "qofbook-p.h" #include "qof-backend.hpp" diff --git a/libgnucash/engine/test-core/test-engine-stuff.cpp b/libgnucash/engine/test-core/test-engine-stuff.cpp index bd0b862163..92a3864890 100644 --- a/libgnucash/engine/test-core/test-engine-stuff.cpp +++ b/libgnucash/engine/test-core/test-engine-stuff.cpp @@ -38,8 +38,6 @@ #include #include -extern "C" -{ #include #if PLATFORM(WINDOWS) #define __STDC_FORMAT_MACROS @@ -69,7 +67,6 @@ extern "C" #include "test-engine-stuff.h" #include "test-stuff.h" #include "test-engine-strings.h" -} #include static gboolean glist_strings_only = FALSE; diff --git a/libgnucash/engine/test/gtest-gnc-euro.cpp b/libgnucash/engine/test/gtest-gnc-euro.cpp index 4777d09aaf..57585d5975 100644 --- a/libgnucash/engine/test/gtest-gnc-euro.cpp +++ b/libgnucash/engine/test/gtest-gnc-euro.cpp @@ -22,13 +22,10 @@ #include #include "../gnc-numeric.hpp" -extern "C" -{ #include #include "../gnc-euro.h" #include "../gnc-commodity.h" #include "../gnc-session.h" -} class Currencies : public ::testing::Test { diff --git a/libgnucash/engine/test/gtest-gnc-option.cpp b/libgnucash/engine/test/gtest-gnc-option.cpp index 2e66c0ab98..29d6fee316 100644 --- a/libgnucash/engine/test/gtest-gnc-option.cpp +++ b/libgnucash/engine/test/gtest-gnc-option.cpp @@ -26,8 +26,6 @@ #include "gnc-option-impl.hpp" #include "gnc-option-ui.hpp" #include "guid.hpp" -extern "C" -{ #include #include "qof.h" #include "Account.h" @@ -36,7 +34,6 @@ extern "C" #include "gnc-date.h" #include #include "gnc-session.h" -} TEST(GncOption, test_string_ctor) { diff --git a/libgnucash/engine/test/gtest-gnc-optiondb.cpp b/libgnucash/engine/test/gtest-gnc-optiondb.cpp index ecedeff80e..68070d5f76 100644 --- a/libgnucash/engine/test/gtest-gnc-optiondb.cpp +++ b/libgnucash/engine/test/gtest-gnc-optiondb.cpp @@ -28,10 +28,7 @@ #include "kvp-value.hpp" #include -extern "C" -{ #include "gnc-session.h" -} using GncOptionDBPtr = std::unique_ptr; diff --git a/libgnucash/engine/test/gtest-import-map.cpp b/libgnucash/engine/test/gtest-import-map.cpp index c7a769b580..a7f83e03ed 100644 --- a/libgnucash/engine/test/gtest-import-map.cpp +++ b/libgnucash/engine/test/gtest-import-map.cpp @@ -20,12 +20,9 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ -extern "C" -{ #include #include "../Account.h" #include -} #include #include diff --git a/libgnucash/engine/test/test-account-object.cpp b/libgnucash/engine/test/test-account-object.cpp index f1d21a5706..004abb054c 100644 --- a/libgnucash/engine/test/test-account-object.cpp +++ b/libgnucash/engine/test/test-account-object.cpp @@ -26,15 +26,12 @@ */ #include -extern "C" -{ #include #include #include "qof.h" #include "Account.h" #include "cashobjects.h" #include "test-engine-stuff.h" -} #include #include "test-stuff.h" diff --git a/libgnucash/engine/test/test-commodities.cpp b/libgnucash/engine/test/test-commodities.cpp index 24118277fb..089880f9dc 100644 --- a/libgnucash/engine/test/test-commodities.cpp +++ b/libgnucash/engine/test/test-commodities.cpp @@ -24,14 +24,11 @@ */ #include -extern "C" -{ #include #include "gnc-commodity.h" #include "qof.h" #include "test-engine-stuff.h" #include "test-stuff.h" -} static void test_commodity(void) diff --git a/libgnucash/engine/test/test-gnc-date.c b/libgnucash/engine/test/test-gnc-date.c index 991d36918b..aa4587269a 100644 --- a/libgnucash/engine/test/test-gnc-date.c +++ b/libgnucash/engine/test/test-gnc-date.c @@ -21,11 +21,6 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - #include #include "platform.h" #include @@ -35,9 +30,6 @@ extern "C" #include /* Add specific headers for this class */ -#ifdef __cplusplus -} -#endif #include "../gnc-date.h" #include "../gnc-date-p.h" #include diff --git a/libgnucash/engine/test/test-group-vs-book.cpp b/libgnucash/engine/test/test-group-vs-book.cpp index 010913ebba..45016a4ef6 100644 --- a/libgnucash/engine/test/test-group-vs-book.cpp +++ b/libgnucash/engine/test/test-group-vs-book.cpp @@ -22,8 +22,6 @@ */ #include -extern "C" -{ #include #include "qof.h" #include "cashobjects.h" @@ -32,7 +30,6 @@ extern "C" #include "gnc-engine.h" #include "test-engine-stuff.h" #include "test-stuff.h" -} static gboolean account_tree_has_book (Account *parent, QofBook *book) diff --git a/libgnucash/engine/test/test-guid.cpp b/libgnucash/engine/test/test-guid.cpp index ad42ec49c7..bc90905e3d 100644 --- a/libgnucash/engine/test/test-guid.cpp +++ b/libgnucash/engine/test/test-guid.cpp @@ -28,15 +28,12 @@ #include #include -extern "C" -{ #include #include #include "cashobjects.h" #include "test-stuff.h" #include "test-engine-stuff.h" #include "qof.h" -} #define NENT 50123 static void test_null_guid(void) diff --git a/libgnucash/engine/test/test-lots.cpp b/libgnucash/engine/test/test-lots.cpp index c02c7ab49d..7bf3a3857d 100644 --- a/libgnucash/engine/test/test-lots.cpp +++ b/libgnucash/engine/test/test-lots.cpp @@ -26,8 +26,6 @@ */ #include -extern "C" -{ #include #include #include "qof.h" @@ -38,7 +36,6 @@ extern "C" #include "test-stuff.h" #include "test-engine-stuff.h" #include "Transaction.h" -} static gint transaction_num = 32; static gint max_iterate = 1; diff --git a/libgnucash/engine/test/test-numeric.cpp b/libgnucash/engine/test/test-numeric.cpp index d6e19f4eb3..41ef28fa08 100644 --- a/libgnucash/engine/test/test-numeric.cpp +++ b/libgnucash/engine/test/test-numeric.cpp @@ -23,15 +23,12 @@ */ #include -extern "C" -{ #include #include #include "cashobjects.h" #include "test-stuff.h" #include "test-engine-stuff.h" #include "gnc-numeric.h" -} #define NREPS 2 diff --git a/libgnucash/engine/test/test-qofbook.c b/libgnucash/engine/test/test-qofbook.c index 9f3bca22b6..9691dfa125 100644 --- a/libgnucash/engine/test/test-qofbook.c +++ b/libgnucash/engine/test/test-qofbook.c @@ -19,19 +19,11 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - #include #include #include #include #include -#ifdef __cplusplus -} -#endif #include "../qof.h" #include "../gnc-features.h" diff --git a/libgnucash/engine/test/test-qofinstance.cpp b/libgnucash/engine/test/test-qofinstance.cpp index 9299e42239..ee585e45a2 100644 --- a/libgnucash/engine/test/test-qofinstance.cpp +++ b/libgnucash/engine/test/test-qofinstance.cpp @@ -23,12 +23,9 @@ #include #include -extern "C" -{ #include #include #include "../qof.h" -} #include "../qof-backend.hpp" #include "../kvp-frame.hpp" static const gchar *suitename = "/qof/qofinstance"; diff --git a/libgnucash/engine/test/test-qofobject.c b/libgnucash/engine/test/test-qofobject.c index fae5bc8435..0016cc62e8 100644 --- a/libgnucash/engine/test/test-qofobject.c +++ b/libgnucash/engine/test/test-qofobject.c @@ -19,18 +19,10 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - #include #include #include #include -#ifdef __cplusplus -} -#endif #include "../qof.h" #include "../qofobject-p.h" @@ -85,19 +77,10 @@ new_object( QofIdType e_type, const char *type_label, MockFields field) return object; } -#ifdef __cplusplus -extern "C" -{ -#endif - extern gboolean get_object_is_initialized( void ); extern GList* get_object_modules( void ); extern GList* get_book_list( void ); -#ifdef __cplusplus -} -#endif - static void setup( Fixture *fixture, gconstpointer pData ) { diff --git a/libgnucash/engine/test/test-query.cpp b/libgnucash/engine/test/test-query.cpp index 94ab2c0d83..112a1ad6b1 100644 --- a/libgnucash/engine/test/test-query.cpp +++ b/libgnucash/engine/test/test-query.cpp @@ -22,8 +22,6 @@ */ #include -extern "C" -{ #include #include "qof.h" #include "cashobjects.h" @@ -32,7 +30,6 @@ extern "C" #include "gnc-engine.h" #include "test-engine-stuff.h" #include "test-stuff.h" -} static int test_trans_query (Transaction *trans, gpointer data) diff --git a/libgnucash/engine/test/test-split-vs-account.cpp b/libgnucash/engine/test/test-split-vs-account.cpp index 81c42d635a..9e2f97b6e7 100644 --- a/libgnucash/engine/test/test-split-vs-account.cpp +++ b/libgnucash/engine/test/test-split-vs-account.cpp @@ -23,8 +23,6 @@ */ #include -extern "C" -{ #include #include "qof.h" #include "cashobjects.h" @@ -34,7 +32,6 @@ extern "C" #include "test-engine-stuff.h" #include "test-stuff.h" #include "Transaction.h" -} static void run_test (void) diff --git a/libgnucash/engine/test/test-transaction-reversal.cpp b/libgnucash/engine/test/test-transaction-reversal.cpp index e5183cc5af..191f630366 100644 --- a/libgnucash/engine/test/test-transaction-reversal.cpp +++ b/libgnucash/engine/test/test-transaction-reversal.cpp @@ -22,8 +22,6 @@ */ #include -extern "C" -{ #include #include #include "cashobjects.h" @@ -32,7 +30,6 @@ extern "C" #include "TransLog.h" #include "test-engine-stuff.h" #include "test-stuff.h" -} #define print_gnc_numeric(num) fprintf(stderr, "%s\n", gnc_numeric_to_string(num)) diff --git a/libgnucash/engine/test/test-transaction-voiding.cpp b/libgnucash/engine/test/test-transaction-voiding.cpp index e4aa60c63e..7ae5264b5b 100644 --- a/libgnucash/engine/test/test-transaction-voiding.cpp +++ b/libgnucash/engine/test/test-transaction-voiding.cpp @@ -22,8 +22,6 @@ */ #include -extern "C" -{ #include #include #include "cashobjects.h" @@ -32,7 +30,6 @@ extern "C" #include "test-engine-stuff.h" #include "test-stuff.h" #include "Transaction.h" -} #define print_gnc_numeric(num) fprintf(stderr, "%s\n", gnc_numeric_to_string(num)) diff --git a/libgnucash/engine/test/utest-Account.cpp b/libgnucash/engine/test/utest-Account.cpp index 6e4a176616..2223d8a700 100644 --- a/libgnucash/engine/test/utest-Account.cpp +++ b/libgnucash/engine/test/utest-Account.cpp @@ -21,8 +21,6 @@ ********************************************************************/ #include -extern "C" -{ #include #include #include @@ -40,8 +38,7 @@ extern "C" #define USE_CLANG_FUNC_SIG 1 #endif static const gchar *suitename = "/engine/Account"; -void test_suite_account (void); -} +extern "C" void test_suite_account (void); #include #include diff --git a/libgnucash/engine/test/utest-Split.cpp b/libgnucash/engine/test/utest-Split.cpp index c0fa7400f6..059c483b79 100644 --- a/libgnucash/engine/test/utest-Split.cpp +++ b/libgnucash/engine/test/utest-Split.cpp @@ -23,8 +23,6 @@ ********************************************************************/ #include -extern "C" -{ #include #include #include @@ -42,8 +40,7 @@ extern "C" #endif static const gchar *suitename = "/engine/Split"; -void test_suite_split ( void ); -} +extern "C" void test_suite_split ( void ); #include #include diff --git a/libgnucash/engine/test/utest-Transaction.cpp b/libgnucash/engine/test/utest-Transaction.cpp index 878b5b6bcd..3a9412bbb2 100644 --- a/libgnucash/engine/test/utest-Transaction.cpp +++ b/libgnucash/engine/test/utest-Transaction.cpp @@ -23,8 +23,6 @@ ********************************************************************/ #include -extern "C" -{ #include #include #include @@ -42,8 +40,7 @@ extern "C" #endif static const gchar *suitename = "/engine/Transaction"; -void test_suite_transaction ( void ); -} +extern "C" void test_suite_transaction ( void ); #include #include diff --git a/libgnucash/gnc-module/gnc-module.h b/libgnucash/gnc-module/gnc-module.h index 248ab6aef4..74a8a938f3 100644 --- a/libgnucash/gnc-module/gnc-module.h +++ b/libgnucash/gnc-module/gnc-module.h @@ -28,6 +28,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef void * GNCModule; #define DEFAULT_MODULE_PATH "/usr/local/gnucash/lib/modules" @@ -47,4 +51,8 @@ GNCModule gnc_module_load(const gchar * module_name, gint iface); GNCModule gnc_module_load_optional(const gchar * module_name, gint iface); int gnc_module_unload(GNCModule mod); +#ifdef __cplusplus +} +#endif + #endif