diff --git a/gnucash/gnome-utils/gnc-main-window.h b/gnucash/gnome-utils/gnc-main-window.h index ba5284e40b..7216fc3e08 100644 --- a/gnucash/gnome-utils/gnc-main-window.h +++ b/gnucash/gnome-utils/gnc-main-window.h @@ -35,14 +35,15 @@ #ifndef __GNC_MAIN_WINDOW_H #define __GNC_MAIN_WINDOW_H + +#include +#include "gnc-plugin-page.h" + #ifdef __cplusplus extern "C" { #endif -#include -#include "gnc-plugin-page.h" - /* type macros */ #define GNC_TYPE_MAIN_WINDOW (gnc_main_window_get_type ()) #define GNC_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow)) diff --git a/gnucash/gnome-utils/gnc-report-combo.h b/gnucash/gnome-utils/gnc-report-combo.h index e71566405f..cc2b0792e1 100644 --- a/gnucash/gnome-utils/gnc-report-combo.h +++ b/gnucash/gnome-utils/gnc-report-combo.h @@ -51,6 +51,11 @@ typedef struct char *report_name; } ReportListEntry; +#ifdef __cplusplus +extern "C" +{ +#endif + /** Return the GType for the GncReportCombo widget. * * @return A GType value. @@ -128,4 +133,8 @@ gchar * gnc_report_combo_get_active_guid_name (GncReportCombo *grc); */ gboolean gnc_report_combo_is_warning_visible_for_active (GncReportCombo *grc); +#ifdef __cplusplus +} +#endif + #endif /* __GNC_REPORT_COMBO_H__ */ diff --git a/gnucash/gnome/business-options-gnome.cpp b/gnucash/gnome/business-options-gnome.cpp index f8155ab779..e28c667f1d 100644 --- a/gnucash/gnome/business-options-gnome.cpp +++ b/gnucash/gnome/business-options-gnome.cpp @@ -33,10 +33,7 @@ #include // for GNC_GENERAL_SEARCH #include "dialog-utils.h" // for gnc_builder_add_from_file -extern "C" -{ #include "gnc-report-combo.h" -} #include #include diff --git a/gnucash/gnome/dialog-new-user.h b/gnucash/gnome/dialog-new-user.h index b92ade6b81..78fab780fa 100644 --- a/gnucash/gnome/dialog-new-user.h +++ b/gnucash/gnome/dialog-new-user.h @@ -23,6 +23,8 @@ #ifndef DIALOG_NEW_USER_H #define DIALOG_NEW_USER_H +#include + #ifdef __cplusplus extern "C" { #endif @@ -30,8 +32,6 @@ extern "C" { #define GNC_PREFS_GROUP_NEW_USER "dialogs.new-user" #define GNC_PREF_FIRST_STARTUP "first-startup" -#include - typedef struct _GNCNewUserDialog GNCNewUserDialog; void gnc_ui_new_user_dialog (void); diff --git a/gnucash/gnome/gnc-plugin-page-report.h b/gnucash/gnome/gnc-plugin-page-report.h index 46ba3ca507..9e1b914a56 100644 --- a/gnucash/gnome/gnc-plugin-page-report.h +++ b/gnucash/gnome/gnc-plugin-page-report.h @@ -34,16 +34,14 @@ #ifndef __GNC_PLUGIN_PAGE_REPORT_H #define __GNC_PLUGIN_PAGE_REPORT_H +#include +#include "gnc-plugin.h" + #ifdef __cplusplus extern "C" { #endif -#include -#include "gnc-plugin.h" - -G_BEGIN_DECLS - /* type macros */ #define GNC_TYPE_PLUGIN_PAGE_REPORT (gnc_plugin_page_report_get_type ()) #define GNC_PLUGIN_PAGE_REPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_PAGE_REPORT, GncPluginPageReport)) @@ -89,10 +87,10 @@ void gnc_main_window_open_report (int report_id, GncMainWindow *window); // directly called through from above void gnc_main_window_open_report_url (const char * url, GncMainWindow *window); -G_END_DECLS #ifdef __cplusplus } #endif + #endif /* __GNC_PLUGIN_PAGE_REPORT_H */ /** @} */ /** @} */ diff --git a/gnucash/gnome/window-report.h b/gnucash/gnome/window-report.h index d21ef6aca8..30362254af 100644 --- a/gnucash/gnome/window-report.h +++ b/gnucash/gnome/window-report.h @@ -24,16 +24,16 @@ #define GNC_REPORT_WINDOW_H #include -#ifdef __cplusplus -extern "C" -{ -#endif //#include "gnc-html.h" #include "qof.h" #include "gnc-optiondb.h" typedef struct gnc_report_window_s gnc_report_window; +#ifdef __cplusplus +extern "C" +{ +#endif /** PROTOTYPES ******************************************************/ // scm-exposed diff --git a/gnucash/gnucash-locale-macos.mm b/gnucash/gnucash-locale-macos.mm index dc33b596c0..80ca5b3311 100644 --- a/gnucash/gnucash-locale-macos.mm +++ b/gnucash/gnucash-locale-macos.mm @@ -28,10 +28,8 @@ #include #include -extern "C" { #include #include "gnucash-locale-platform.h" -} /* This static indicates the debugging module that this .o belongs to. */ static QofLogModule log_module = GNC_MOD_GUI; diff --git a/gnucash/import-export/import-backend.cpp b/gnucash/import-export/import-backend.cpp index e4a81b8a61..df80be0965 100644 --- a/gnucash/import-export/import-backend.cpp +++ b/gnucash/import-export/import-backend.cpp @@ -35,7 +35,6 @@ #include -extern "C" { #include "import-backend.h" #include "import-utilities.h" #include "Account.h" @@ -44,7 +43,6 @@ extern "C" { #include "engine-helpers.h" #include "gnc-prefs.h" #include "gnc-ui-util.h" -} #include diff --git a/gnucash/import-export/import-main-matcher.h b/gnucash/import-export/import-main-matcher.h index 8320e3a6f2..1c75a47a3d 100644 --- a/gnucash/import-export/import-main-matcher.h +++ b/gnucash/import-export/import-main-matcher.h @@ -36,12 +36,12 @@ #include "Transaction.h" #include "import-backend.h" +#include + #ifdef __cplusplus extern "C" { #endif -#include - typedef struct _main_matcher_info GNCImportMainMatcher; typedef void (*GNCTransactionProcessedCB) (GNCImportTransInfo *trans_info, diff --git a/gnucash/import-export/import-settings.h b/gnucash/import-export/import-settings.h index 133699bcaf..8c7fd67fe4 100644 --- a/gnucash/import-export/import-settings.h +++ b/gnucash/import-export/import-settings.h @@ -30,6 +30,11 @@ #include "import-utilities.h" +#ifdef __cplusplus +extern "C" +{ +#endif + typedef struct _genimportsettings GNCImportSettings; /************************************************************************ @@ -103,6 +108,11 @@ void gnc_import_Settings_set_match_date_hardlimit (GNCImportSettings *settings, gint gnc_import_Settings_get_match_date_hardlimit (const GNCImportSettings *settings); /**@}*/ + +#ifdef __cplusplus +} +#endif + /**@}*/ #endif diff --git a/gnucash/import-export/import-utilities.h b/gnucash/import-export/import-utilities.h index 204643bf64..3f20886a6d 100644 --- a/gnucash/import-export/import-utilities.h +++ b/gnucash/import-export/import-utilities.h @@ -40,6 +40,11 @@ #include "Account.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /** @name Setter-getters Setter and getter functions for the online_id field for Accounts. @@ -73,6 +78,10 @@ void gnc_import_set_split_online_id(Split * split, gboolean gnc_import_split_has_online_id(Split * split); +#ifdef __cplusplus +} +#endif + #endif /** @} */ diff --git a/libgnucash/app-utils/mocks/gmock-gnc-prefs.h b/libgnucash/app-utils/mocks/gmock-gnc-prefs.h index 56da9e6c44..2ea6abb516 100644 --- a/libgnucash/app-utils/mocks/gmock-gnc-prefs.h +++ b/libgnucash/app-utils/mocks/gmock-gnc-prefs.h @@ -3,10 +3,7 @@ #include -extern "C" -{ #include -} // mock up class implementing preferences backend (see struct PrefBackend in gnc-prefs-p.h) diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.h b/libgnucash/backend/dbi/gnc-backend-dbi.h index 1c53d03fba..78ccbef473 100644 --- a/libgnucash/backend/dbi/gnc-backend-dbi.h +++ b/libgnucash/backend/dbi/gnc-backend-dbi.h @@ -28,10 +28,11 @@ #ifndef GNC_BACKEND_DBI_H_ #define GNC_BACKEND_DBI_H_ -extern "C" -{ + #include +extern "C" +{ /** Initialization function which can be used when this module is * statically linked into the application. */ void gnc_module_init_backend_dbi (void); diff --git a/libgnucash/backend/dbi/test/test-dbi-stuff.h b/libgnucash/backend/dbi/test/test-dbi-stuff.h index 81f3fe1d42..5b128145a5 100644 --- a/libgnucash/backend/dbi/test/test-dbi-stuff.h +++ b/libgnucash/backend/dbi/test/test-dbi-stuff.h @@ -25,10 +25,6 @@ #ifndef _TEST_DBI_STUFF_H_ #define _TEST_DBI_STUFF_H_ -#ifdef __cplusplus -extern "C" -{ -#endif #include "qof.h" typedef struct @@ -37,10 +33,17 @@ typedef struct QofBook* book_2; gboolean result; } CompareInfoStruct; + +#ifdef __cplusplus +extern "C" +{ +#endif + void compare_books (QofBook* book_1, QofBook* book_2); void do_compare (QofBook* book_1, QofBook* book_2, const gchar* id, QofInstanceForeachCB cb, const gchar* msg); + #ifdef __cplusplus } #endif diff --git a/libgnucash/backend/sql/gnc-commodity-sql.h b/libgnucash/backend/sql/gnc-commodity-sql.h index ba32b3f363..559b25e54d 100644 --- a/libgnucash/backend/sql/gnc-commodity-sql.h +++ b/libgnucash/backend/sql/gnc-commodity-sql.h @@ -32,10 +32,7 @@ #include "gnc-sql-backend.hpp" #include "gnc-sql-object-backend.hpp" -extern "C" -{ #include "gnc-commodity.h" -} class GncSqlCommodityBackend : public GncSqlObjectBackend { diff --git a/libgnucash/backend/sql/gnc-recurrence-sql.h b/libgnucash/backend/sql/gnc-recurrence-sql.h index a29a97fb02..23f8e82a66 100644 --- a/libgnucash/backend/sql/gnc-recurrence-sql.h +++ b/libgnucash/backend/sql/gnc-recurrence-sql.h @@ -28,12 +28,11 @@ #ifndef GNC_RECURRENCE_SQL_H #define GNC_RECURRENCE_SQL_H -extern "C" -{ + #include + #include "Recurrence.h" #include "guid.h" -} #include "gnc-sql-object-backend.hpp" class GncSqlRecurrenceBackend : public GncSqlObjectBackend diff --git a/libgnucash/backend/sql/gnc-schedxaction-sql.h b/libgnucash/backend/sql/gnc-schedxaction-sql.h index 848180dd70..0fa4f8ffb9 100644 --- a/libgnucash/backend/sql/gnc-schedxaction-sql.h +++ b/libgnucash/backend/sql/gnc-schedxaction-sql.h @@ -28,10 +28,8 @@ #ifndef GNC_SCHEDXACTION_SQL_H #define GNC_SCHEDXACTION_SQL_H -extern "C" -{ + #include "qof.h" -} #include "gnc-sql-object-backend.hpp" class GncSqlSchedXactionBackend : public GncSqlObjectBackend diff --git a/libgnucash/backend/sql/gnc-slots-sql.h b/libgnucash/backend/sql/gnc-slots-sql.h index b7b9891537..49d162b2ce 100644 --- a/libgnucash/backend/sql/gnc-slots-sql.h +++ b/libgnucash/backend/sql/gnc-slots-sql.h @@ -28,12 +28,10 @@ #ifndef GNC_SLOTS_SQL_H #define GNC_SLOTS_SQL_H -extern "C" -{ + #include #include "guid.h" #include "qof.h" -} #include "gnc-sql-object-backend.hpp" /** diff --git a/libgnucash/backend/sql/gnc-transaction-sql.h b/libgnucash/backend/sql/gnc-transaction-sql.h index 78d35b2c0e..8aac7f8b57 100644 --- a/libgnucash/backend/sql/gnc-transaction-sql.h +++ b/libgnucash/backend/sql/gnc-transaction-sql.h @@ -29,12 +29,10 @@ #ifndef GNC_TRANSACTION_SQL_H #define GNC_TRANSACTION_SQL_H -extern "C" -{ #include "Transaction.h" #include "qof.h" #include "Account.h" -} + class GncSqlTransBackend : public GncSqlObjectBackend { public: diff --git a/libgnucash/backend/xml/gnc-backend-xml.h b/libgnucash/backend/xml/gnc-backend-xml.h index a3aa1a09bd..aaaac5ea4d 100644 --- a/libgnucash/backend/xml/gnc-backend-xml.h +++ b/libgnucash/backend/xml/gnc-backend-xml.h @@ -30,10 +30,7 @@ #ifndef GNC_BACKEND_XML_H_ #define GNC_BACKEND_XML_H_ -#ifdef __cplusplus -extern "C" -{ -#endif + #include #include @@ -55,6 +52,10 @@ typedef enum GNC_BOOK_POST_XML2_0_0_FILE } QofBookFileType; +#ifdef __cplusplus +extern "C" +{ +#endif /** Initialization function which can be used when this module is * statically linked into the application. */ void gnc_module_init_backend_xml (void); diff --git a/libgnucash/backend/xml/gnc-bill-term-xml-v2.h b/libgnucash/backend/xml/gnc-bill-term-xml-v2.h index 8c007763c0..de6eacb59c 100644 --- a/libgnucash/backend/xml/gnc-bill-term-xml-v2.h +++ b/libgnucash/backend/xml/gnc-bill-term-xml-v2.h @@ -23,10 +23,7 @@ #ifndef GNC_BILLTERM_XML_V2_H #define GNC_BILLTERM_XML_V2_H -extern "C" -{ #include "gncBillTerm.h" -} void gnc_billterm_xml_initialize (void); GncBillTerm* gnc_billterm_xml_find_or_create (QofBook* book, GncGUID* guid); diff --git a/libgnucash/backend/xml/gnc-owner-xml-v2.h b/libgnucash/backend/xml/gnc-owner-xml-v2.h index 1b956a2b70..a68a633b64 100644 --- a/libgnucash/backend/xml/gnc-owner-xml-v2.h +++ b/libgnucash/backend/xml/gnc-owner-xml-v2.h @@ -22,11 +22,8 @@ #ifndef GNC_OWNER_XML_V2_H #define GNC_OWNER_XML_V2_H -extern "C" -{ #include "gncOwner.h" #include "qof.h" -} gboolean gnc_dom_tree_to_owner (xmlNodePtr node, GncOwner* owner, QofBook* book); xmlNodePtr gnc_owner_to_dom_tree (const char* tag, const GncOwner* addr); diff --git a/libgnucash/backend/xml/gnc-xml-helper.h b/libgnucash/backend/xml/gnc-xml-helper.h index 6c0f91d8d4..b508c1ce68 100644 --- a/libgnucash/backend/xml/gnc-xml-helper.h +++ b/libgnucash/backend/xml/gnc-xml-helper.h @@ -27,8 +27,6 @@ #include -extern "C" -{ #include # include @@ -36,7 +34,7 @@ extern "C" # include # include # include -} + # ifndef xmlChildrenNode # define xmlChildrenNode children # endif /* ifndef xmlChildrenNode */ diff --git a/libgnucash/backend/xml/gnc-xml.h b/libgnucash/backend/xml/gnc-xml.h index 164a124810..b51ff08377 100644 --- a/libgnucash/backend/xml/gnc-xml.h +++ b/libgnucash/backend/xml/gnc-xml.h @@ -25,13 +25,10 @@ #ifndef GNC_XML_H #define GNC_XML_H -extern "C" -{ #include "SchedXaction.h" #include "gnc-engine.h" #include "gnc-pricedb.h" #include "gnc-budget.h" -} #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/io-example-account.h b/libgnucash/backend/xml/io-example-account.h index 3924ca2714..b72fb55799 100644 --- a/libgnucash/backend/xml/io-example-account.h +++ b/libgnucash/backend/xml/io-example-account.h @@ -24,10 +24,6 @@ #ifndef IO_EXAMPLE_ACCOUNT_H #define IO_EXAMPLE_ACCOUNT_H -#ifdef __cplusplus -extern "C" -{ -#endif #include #include "gnc-engine.h" @@ -45,6 +41,10 @@ struct GncExampleAccount_struct }; typedef struct GncExampleAccount_struct GncExampleAccount; +#ifdef __cplusplus +extern "C" +{ +#endif void gnc_destroy_example_account (GncExampleAccount* gea); gboolean gnc_write_example_account (GncExampleAccount* gea, diff --git a/libgnucash/backend/xml/io-gncxml-v2.h b/libgnucash/backend/xml/io-gncxml-v2.h index ccfb4b3a0b..26647a51f6 100644 --- a/libgnucash/backend/xml/io-gncxml-v2.h +++ b/libgnucash/backend/xml/io-gncxml-v2.h @@ -30,15 +30,12 @@ #ifndef IO_GNCXML_V2_H #define IO_GNCXML_V2_H -#ifdef __cplusplus -extern "C" -{ -#endif + #include #include "gnc-engine.h" + #ifdef __cplusplus -} #include "gnc-backend-xml.h" #include "sixtp.h" #include diff --git a/libgnucash/backend/xml/io-gncxml.h b/libgnucash/backend/xml/io-gncxml.h index 1ee52128af..24a8fb1a39 100644 --- a/libgnucash/backend/xml/io-gncxml.h +++ b/libgnucash/backend/xml/io-gncxml.h @@ -32,14 +32,15 @@ #ifndef IO_GNCXML_H #define IO_GNCXML_H -#ifdef __cplusplus -extern "C" -{ -#endif #include #include "qof.h" +#ifdef __cplusplus +extern "C" +{ + +#endif /* FIXME: eventually, we probably need to add an error stack accessible via gnc_book_get_xml_io_error() a la binfile. */ diff --git a/libgnucash/backend/xml/io-utils.h b/libgnucash/backend/xml/io-utils.h index c6a4ba4421..cda12393bd 100644 --- a/libgnucash/backend/xml/io-utils.h +++ b/libgnucash/backend/xml/io-utils.h @@ -24,11 +24,8 @@ #ifndef IO_UTILS_H #define IO_UTILS_H -extern "C" -{ #include #include "qof.h" -} #include "io-gncxml-v2.h" diff --git a/libgnucash/backend/xml/sixtp-dom-generators.h b/libgnucash/backend/xml/sixtp-dom-generators.h index daf5bacd53..79c13f505a 100644 --- a/libgnucash/backend/xml/sixtp-dom-generators.h +++ b/libgnucash/backend/xml/sixtp-dom-generators.h @@ -24,14 +24,11 @@ #ifndef SIXTP_DOM_GENERATORS_H #define SIXTP_DOM_GENERATORS_H -extern "C" -{ #include #include "gnc-commodity.h" #include "qof.h" #include "Recurrence.h" -} #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/sixtp-dom-parsers.h b/libgnucash/backend/xml/sixtp-dom-parsers.h index c630296507..cc1d2544dc 100644 --- a/libgnucash/backend/xml/sixtp-dom-parsers.h +++ b/libgnucash/backend/xml/sixtp-dom-parsers.h @@ -23,14 +23,11 @@ #ifndef SIXTP_DOM_PARSERS_H #define SIXTP_DOM_PARSERS_H -extern "C" -{ #include #include "gnc-commodity.h" #include "qof.h" #include "gnc-budget.h" -} #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/sixtp-stack.h b/libgnucash/backend/xml/sixtp-stack.h index 3803afd895..ab487ffa02 100644 --- a/libgnucash/backend/xml/sixtp-stack.h +++ b/libgnucash/backend/xml/sixtp-stack.h @@ -23,10 +23,7 @@ #ifndef SIXTP_STACK_H #define SIXTP_STACK_H -extern "C" -{ #include -} #include "sixtp.h" diff --git a/libgnucash/backend/xml/sixtp-utils.h b/libgnucash/backend/xml/sixtp-utils.h index 2ee7aa16ae..ef7b0f03f0 100644 --- a/libgnucash/backend/xml/sixtp-utils.h +++ b/libgnucash/backend/xml/sixtp-utils.h @@ -23,10 +23,7 @@ #ifndef SIXTP_UTILS_H #define SIXTP_UTILS_H -extern "C" -{ #include "qof.h" -} #include "sixtp.h" typedef struct diff --git a/libgnucash/backend/xml/sixtp.h b/libgnucash/backend/xml/sixtp.h index 82d6e8f5d3..15e61595e4 100644 --- a/libgnucash/backend/xml/sixtp.h +++ b/libgnucash/backend/xml/sixtp.h @@ -26,13 +26,10 @@ #include -extern "C" -{ #include #include #include "gnc-engine.h" -} #include "gnc-xml-helper.h" #include "gnc-backend-xml.h" diff --git a/libgnucash/backend/xml/test/test-dom-parser1.cpp b/libgnucash/backend/xml/test/test-dom-parser1.cpp index 28de9542cb..7c2923f102 100644 --- a/libgnucash/backend/xml/test/test-dom-parser1.cpp +++ b/libgnucash/backend/xml/test/test-dom-parser1.cpp @@ -19,14 +19,11 @@ \********************************************************************/ #include -extern "C" -{ #include #include #include "test-stuff.h" -} #include diff --git a/libgnucash/backend/xml/test/test-file-stuff.h b/libgnucash/backend/xml/test/test-file-stuff.h index 158d8cddf3..c73168b0d0 100644 --- a/libgnucash/backend/xml/test/test-file-stuff.h +++ b/libgnucash/backend/xml/test/test-file-stuff.h @@ -26,11 +26,8 @@ #define TEST_FILE_STUFF_H #include -extern "C" -{ #include #include -} #include #include #include diff --git a/libgnucash/backend/xml/test/test-save-in-lang.cpp b/libgnucash/backend/xml/test/test-save-in-lang.cpp index 78cc644b6b..00acb770bd 100644 --- a/libgnucash/backend/xml/test/test-save-in-lang.cpp +++ b/libgnucash/backend/xml/test/test-save-in-lang.cpp @@ -20,8 +20,6 @@ #include #include -extern "C" -{ #include #include #include @@ -34,7 +32,6 @@ extern "C" #include "gnc-engine.h" #include "TransLog.h" -} #include diff --git a/libgnucash/core-utils/gnc-locale-utils.h b/libgnucash/core-utils/gnc-locale-utils.h index b87f3b7406..6683481765 100644 --- a/libgnucash/core-utils/gnc-locale-utils.h +++ b/libgnucash/core-utils/gnc-locale-utils.h @@ -25,6 +25,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + /* The gnc_localeconv() subroutine returns an lconv structure * containing locale information. If no locale is set, the structure * is given default (en_US) values. */ @@ -41,4 +46,8 @@ int gnc_locale_decimal_places (void); * The returned string should be freed by the caller. */ gchar *gnc_locale_name (void); +#ifdef __cplusplus +} +#endif + #endif /* GNC_LOCALE_UTILS_H */ diff --git a/libgnucash/engine/gnc-aqbanking-templates.h b/libgnucash/engine/gnc-aqbanking-templates.h index 9350d5c3b6..ea95b298e2 100644 --- a/libgnucash/engine/gnc-aqbanking-templates.h +++ b/libgnucash/engine/gnc-aqbanking-templates.h @@ -33,16 +33,14 @@ #ifndef GNC_AB_TRANS_TEMPL_H #define GNC_AB_TRANS_TEMPL_H -#ifdef __cplusplus -extern "C" -{ -#endif - #include #include #include "qof.h" -G_BEGIN_DECLS +#ifdef __cplusplus +extern "C" +{ +#endif /** A template for an AqBanking transaction */ typedef struct _GncABTransTempl GncABTransTempl; @@ -204,7 +202,6 @@ void gnc_ab_trans_templ_set_purpose(GncABTransTempl *t, const gchar *purpose); void gnc_ab_trans_templ_set_purpose_cont(GncABTransTempl *t, const gchar *purpose_cont); -G_END_DECLS #ifdef __cplusplus } #endif diff --git a/libgnucash/engine/gnc-budget.h b/libgnucash/engine/gnc-budget.h index eee615303d..58d4317a60 100644 --- a/libgnucash/engine/gnc-budget.h +++ b/libgnucash/engine/gnc-budget.h @@ -64,11 +64,6 @@ #ifndef __GNC_BUDGET_H__ #define __GNC_BUDGET_H__ -#ifdef __cplusplus -extern "C" -{ -#endif - #include /** The budget data.*/ @@ -79,6 +74,11 @@ typedef struct _GncBudgetClass GncBudgetClass; #include "Account.h" #include "Recurrence.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /* --- type macros --- */ #define GNC_TYPE_BUDGET (gnc_budget_get_type ()) #define GNC_BUDGET(o) \ diff --git a/libgnucash/engine/gnc-date-p.h b/libgnucash/engine/gnc-date-p.h index 94f3639ad1..f8498cd8e9 100644 --- a/libgnucash/engine/gnc-date-p.h +++ b/libgnucash/engine/gnc-date-p.h @@ -23,14 +23,15 @@ #ifndef __GNC_DATE_P_H__ #define __GNC_DATE_P_H__ + +#include +#include "gnc-date.h" + #ifdef __cplusplus extern "C" { #endif -#include -#include "gnc-date.h" - /** Convert a given date/time format from UTF-8 to an encoding suitable for the * strftime system call. * diff --git a/libgnucash/engine/gncBusiness.h b/libgnucash/engine/gncBusiness.h index 2fe054d1d4..ecdd785fb4 100644 --- a/libgnucash/engine/gncBusiness.h +++ b/libgnucash/engine/gncBusiness.h @@ -39,6 +39,11 @@ #include "qof.h" #include "Account.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /* KVP key for report PDF directories */ #define OWNER_EXPORT_PDF_DIRNAME "export-pdf-directory" #define LAST_POSTED_TO_ACCT "last-posted-to-acct" @@ -93,5 +98,8 @@ OwnerList * gncBusinessGetOwnerList (QofBook *book, QofIdTypeConst type_name, * liabilities and equity accounts. */ gboolean gncBusinessIsPaymentAcctType (GNCAccountType type); +#ifdef __cplusplus +} +#endif #endif /* GNC_BUSINESS_H_ */ diff --git a/libgnucash/engine/gncCustomer.h b/libgnucash/engine/gncCustomer.h index adf6eb7805..fa7c6e1ae6 100644 --- a/libgnucash/engine/gncCustomer.h +++ b/libgnucash/engine/gncCustomer.h @@ -31,10 +31,6 @@ #ifndef GNC_CUSTOMER_H_ #define GNC_CUSTOMER_H_ -#ifdef __cplusplus -extern "C" { -#endif - /** @struct GncCustomer credit, discount and shipaddr are unique to GncCustomer\n @@ -66,6 +62,10 @@ typedef struct _gncCustomerClass GncCustomerClass; #include "gncTaxTable.h" #include "gncJob.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ID_CUSTOMER "gncCustomer" /* --- type macros --- */ diff --git a/libgnucash/engine/gncEmployee.h b/libgnucash/engine/gncEmployee.h index b9399b2008..17060592bb 100644 --- a/libgnucash/engine/gncEmployee.h +++ b/libgnucash/engine/gncEmployee.h @@ -31,16 +31,16 @@ #ifndef GNC_EMPLOYEE_H_ #define GNC_EMPLOYEE_H_ -#ifdef __cplusplus -extern "C" { -#endif - typedef struct _gncEmployee GncEmployee; typedef struct _gncEmployeeClass GncEmployeeClass; #include "gncAddress.h" #include "Account.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ID_EMPLOYEE "gncEmployee" /* --- type macros --- */ diff --git a/libgnucash/engine/gncInvoice.h b/libgnucash/engine/gncInvoice.h index b78f3dfd2c..3a5f71d6e8 100644 --- a/libgnucash/engine/gncInvoice.h +++ b/libgnucash/engine/gncInvoice.h @@ -36,10 +36,6 @@ 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; @@ -54,6 +50,10 @@ typedef GList GncInvoiceList; #include "qofbook.h" #include "gnc-pricedb.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ID_INVOICE "gncInvoice" typedef enum diff --git a/libgnucash/engine/gncVendor.h b/libgnucash/engine/gncVendor.h index 314ebe1648..c7d2f63ccb 100644 --- a/libgnucash/engine/gncVendor.h +++ b/libgnucash/engine/gncVendor.h @@ -31,10 +31,6 @@ #ifndef GNC_VENDOR_H_ #define GNC_VENDOR_H_ -#ifdef __cplusplus -extern "C" { -#endif - typedef struct _gncVendor GncVendor; typedef struct _gncVendorClass GncVendorClass; @@ -43,6 +39,10 @@ typedef struct _gncVendorClass GncVendorClass; #include "gncTaxTable.h" #include "gncJob.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GNC_ID_VENDOR "gncVendor" /* --- type macros --- */ diff --git a/libgnucash/engine/guid.h b/libgnucash/engine/guid.h index f43f194d16..850fe9a56b 100644 --- a/libgnucash/engine/guid.h +++ b/libgnucash/engine/guid.h @@ -26,13 +26,13 @@ #define GUID_H #include +#include + #ifdef __cplusplus extern "C" { #endif -#include - /** @addtogroup Entity @{ */ /** @addtogroup GncGUID diff --git a/libgnucash/engine/mocks/fake-qofquery.h b/libgnucash/engine/mocks/fake-qofquery.h index 803f56dbd6..69f418e1e6 100644 --- a/libgnucash/engine/mocks/fake-qofquery.h +++ b/libgnucash/engine/mocks/fake-qofquery.h @@ -11,10 +11,7 @@ #include -extern "C" -{ #include -} /** Fake object providing functionality similar to QofQuery * diff --git a/libgnucash/engine/mocks/gmock-Split.h b/libgnucash/engine/mocks/gmock-Split.h index 62cbf52ed6..ce022fb2d0 100644 --- a/libgnucash/engine/mocks/gmock-Split.h +++ b/libgnucash/engine/mocks/gmock-Split.h @@ -4,10 +4,7 @@ #include #include -extern "C" -{ #include -} #include "gmock-qofbook.h" #include "gmock-gobject.h" diff --git a/libgnucash/engine/mocks/gmock-Transaction.h b/libgnucash/engine/mocks/gmock-Transaction.h index e866c7d8fb..b0537ed50f 100644 --- a/libgnucash/engine/mocks/gmock-Transaction.h +++ b/libgnucash/engine/mocks/gmock-Transaction.h @@ -4,10 +4,7 @@ #include #include -extern "C" -{ #include -} #include "gmock-gobject.h" diff --git a/libgnucash/engine/qof-win32.cpp b/libgnucash/engine/qof-win32.cpp index 2c83e25c31..ecae138c6f 100644 --- a/libgnucash/engine/qof-win32.cpp +++ b/libgnucash/engine/qof-win32.cpp @@ -21,13 +21,8 @@ * Boston, MA 02110-1301, USA gnu@gnu.org */ -#ifdef __cplusplus #include -extern "C" -{ -#endif - #include #include "gnc-date-p.h" @@ -35,10 +30,6 @@ extern "C" #include #include -#ifdef __cplusplus -} -#endif - static GHashTable *picture_to_format = NULL; G_LOCK_DEFINE_STATIC(picture_to_format); diff --git a/libgnucash/engine/qofbook.h b/libgnucash/engine/qofbook.h index dc52cf4aad..0b2d663639 100644 --- a/libgnucash/engine/qofbook.h +++ b/libgnucash/engine/qofbook.h @@ -46,11 +46,6 @@ class GncOptionDB; #else typedef struct GncOptionDB GncOptionDB; #endif -#ifdef __cplusplus -extern "C" -{ -#endif - /* We only want a few things exported to Guile */ #ifndef SWIG @@ -64,6 +59,11 @@ typedef struct KvpValueImpl KvpValue; #include "qofinstance.h" #include "qofbackend.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /* --- type macros --- */ #define QOF_TYPE_BOOK (qof_book_get_type ()) #define QOF_BOOK(o) \ @@ -440,11 +440,11 @@ void qof_book_options_delete (QofBook *book, GSList *path); /** deprecated */ #define qof_book_get_guid(X) qof_entity_get_guid (QOF_INSTANCE(X)) -#endif /* SWIG */ #ifdef __cplusplus } #endif +#endif /* SWIG */ #endif /* QOF_BOOK_H */ /** @} */ /** @} */ diff --git a/libgnucash/engine/qofid.h b/libgnucash/engine/qofid.h index ff8de1b448..a7c9bc0bcf 100644 --- a/libgnucash/engine/qofid.h +++ b/libgnucash/engine/qofid.h @@ -76,11 +76,6 @@ #include #include "guid.h" -#ifdef __cplusplus -extern "C" -{ -#endif - /** QofIdType declaration */ typedef const gchar * QofIdType; /** QofIdTypeConst declaration */ @@ -90,6 +85,11 @@ typedef struct QofCollection_s QofCollection; #include "qofinstance.h" +#ifdef __cplusplus +extern "C" +{ +#endif + #define QOF_ID_NONE NULL #define QOF_ID_NULL "null" diff --git a/libgnucash/engine/qoflog.h b/libgnucash/engine/qoflog.h index 2597e9d8fe..348891c5fe 100644 --- a/libgnucash/engine/qoflog.h +++ b/libgnucash/engine/qoflog.h @@ -85,16 +85,16 @@ #ifndef _QOF_LOG_H #define _QOF_LOG_H -#ifdef __cplusplus -extern "C" -{ -#endif - #include #include #include #include "qofutil.h" +#ifdef __cplusplus +extern "C" +{ +#endif + typedef const gchar* QofLogModule; #define QOF_MOD_ENGINE "qof.engine" diff --git a/libgnucash/engine/qofutil.h b/libgnucash/engine/qofutil.h index 0ce7cb168c..ddbd39d2f0 100644 --- a/libgnucash/engine/qofutil.h +++ b/libgnucash/engine/qofutil.h @@ -32,11 +32,6 @@ #ifndef QOF_UTIL_H #define QOF_UTIL_H -#ifdef __cplusplus -extern "C" -{ -#endif - #include #include "qof.h" #include "qoflog.h" @@ -45,6 +40,11 @@ extern "C" #include "qofbook.h" #include "qofinstance.h" +#ifdef __cplusplus +extern "C" +{ +#endif + /** Do not use these for printf, only scanf */ #if HAVE_SCANF_LLD # define QOF_SCANF_LLD "%lld" diff --git a/libgnucash/engine/test-core/test-engine-stuff.h b/libgnucash/engine/test-core/test-engine-stuff.h index b988250455..9c70ec419b 100644 --- a/libgnucash/engine/test-core/test-engine-stuff.h +++ b/libgnucash/engine/test-core/test-engine-stuff.h @@ -24,11 +24,8 @@ #ifndef TEST_ENGINE_STUFF_H #define TEST_ENGINE_STUFF_H + #include -#ifdef __cplusplus -extern "C" -{ -#endif #include #include @@ -46,6 +43,10 @@ typedef struct KvpFrameImpl KvpFrame; #define __KVP_FRAME #endif +#ifdef __cplusplus +extern "C" +{ +#endif time64 get_random_time(void); KvpValue* get_random_kvp_value(int type); diff --git a/libgnucash/engine/test/test-gnc-guid-old.cpp b/libgnucash/engine/test/test-gnc-guid-old.cpp index a64adb3361..422a0ae900 100644 --- a/libgnucash/engine/test/test-gnc-guid-old.cpp +++ b/libgnucash/engine/test/test-gnc-guid-old.cpp @@ -24,13 +24,11 @@ #include #include "../guid.hpp" -extern "C" -{ #include #include #include -void test_suite_gnc_guid (void); -} + +extern "C" void test_suite_gnc_guid (void); /*Can be included as c++, because it's c++ tolerant*/ #include "../guid.h" diff --git a/libgnucash/engine/test/test-qofsession-old.cpp b/libgnucash/engine/test/test-qofsession-old.cpp index 4c73365eab..827392541f 100644 --- a/libgnucash/engine/test/test-qofsession-old.cpp +++ b/libgnucash/engine/test/test-qofsession-old.cpp @@ -23,11 +23,8 @@ #include "../guid.hpp" #include -extern "C" -{ #include #include -} #include "../qof.h" #include "../qofbackend-p.h"