diff --git a/gnucash/gnome-utils/gnc-amount-edit.h b/gnucash/gnome-utils/gnc-amount-edit.h index b107af1a31..45d88dd4a8 100644 --- a/gnucash/gnome-utils/gnc-amount-edit.h +++ b/gnucash/gnome-utils/gnc-amount-edit.h @@ -32,6 +32,8 @@ #include "qof.h" #include "gnc-ui-util.h" +#include + #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) diff --git a/gnucash/gnome-utils/gnc-gobject-utils.h b/gnucash/gnome-utils/gnc-gobject-utils.h index 11485def03..e84e06d57d 100644 --- a/gnucash/gnome-utils/gnc-gobject-utils.h +++ b/gnucash/gnome-utils/gnc-gobject-utils.h @@ -145,8 +145,8 @@ type_name##_get_instance_private (TypeName *self) \ GType \ type_name##_get_type (void) \ { \ - static volatile gsize g_define_type_id__volatile = 0; \ - if (g_once_init_enter (&g_define_type_id__volatile)) \ + static gsize g_define_type_id_static = 0; \ + if (g_once_init_enter (&g_define_type_id_static)) \ { \ GType g_define_type_id = \ g_type_register_static_simple (TYPE_PARENT, \ @@ -160,9 +160,9 @@ type_name##_get_type (void) \ #define _GNC_DEFINE_TYPE_EXTENDED_END() \ /* following custom code */ \ } \ - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ + g_once_init_leave (&g_define_type_id_static, g_define_type_id); \ } \ - return g_define_type_id__volatile; \ + return g_define_type_id_static; \ } /* closes type_name##_get_type() */ diff --git a/gnucash/gnome-utils/gnc-tree-model-commodity.c b/gnucash/gnome-utils/gnc-tree-model-commodity.c index dbf1c5ccad..cdb6e297d7 100644 --- a/gnucash/gnome-utils/gnc-tree-model-commodity.c +++ b/gnucash/gnome-utils/gnc-tree-model-commodity.c @@ -36,6 +36,7 @@ #include +#include #include #include diff --git a/gnucash/gnome/assistant-loan.cpp b/gnucash/gnome/assistant-loan.cpp index 8dd8e0f035..aed5ba46e6 100644 --- a/gnucash/gnome/assistant-loan.cpp +++ b/gnucash/gnome/assistant-loan.cpp @@ -26,8 +26,6 @@ extern "C" { #include -#include -#include #include #include #include @@ -52,6 +50,9 @@ extern "C" #endif } +#include +#include +#include #include #include #include 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 5419b17261..1116daeb61 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp +++ b/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp @@ -27,13 +27,13 @@ extern "C" { #include #endif -#include -#include - #include "engine-helpers.h" #include "gnc-ui-util.h" } +#include +#include + #include #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 4129c317a3..dac6baf8e2 100644 --- a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp +++ b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp @@ -26,8 +26,6 @@ extern "C" { #include #endif -#include -#include #include "engine-helpers.h" #include "gnc-csv-account-map.h" @@ -39,6 +37,9 @@ extern "C" { } +#include +#include + #include #include #include diff --git a/gnucash/import-export/test/test-import-pending-matches.cpp b/gnucash/import-export/test/test-import-pending-matches.cpp index e5dccc441f..3d3d61dfcd 100644 --- a/gnucash/import-export/test/test-import-pending-matches.cpp +++ b/gnucash/import-export/test/test-import-pending-matches.cpp @@ -1,9 +1,10 @@ +#include +#include /* for references in import-backend.h */ + extern "C" { #include #include -#include -#include /* for references in import-backend.h */ #include "import-backend.h" #include "import-pending-matches.h" #include "Split.h" diff --git a/gnucash/register/register-gnome/datecell-gnome.c b/gnucash/register/register-gnome/datecell-gnome.c index c716465b43..ca0b961f79 100644 --- a/gnucash/register/register-gnome/datecell-gnome.c +++ b/gnucash/register/register-gnome/datecell-gnome.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "datecell.h" diff --git a/libgnucash/app-utils/gnc-sx-instance-model.c b/libgnucash/app-utils/gnc-sx-instance-model.c index 98bb1757c4..465cf68df7 100644 --- a/libgnucash/app-utils/gnc-sx-instance-model.c +++ b/libgnucash/app-utils/gnc-sx-instance-model.c @@ -32,6 +32,7 @@ #include #include +#include #include #include diff --git a/libgnucash/app-utils/gnc-ui-balances.c b/libgnucash/app-utils/gnc-ui-balances.c index 27ce976666..86b747cbc6 100644 --- a/libgnucash/app-utils/gnc-ui-balances.c +++ b/libgnucash/app-utils/gnc-ui-balances.c @@ -29,6 +29,7 @@ #include "gnc-ui-util.h" #include +#include #include "Account.h" #include "Split.h" diff --git a/libgnucash/app-utils/test/test-autoclear.cpp b/libgnucash/app-utils/test/test-autoclear.cpp index abb84e1c56..9a44e3c9da 100644 --- a/libgnucash/app-utils/test/test-autoclear.cpp +++ b/libgnucash/app-utils/test/test-autoclear.cpp @@ -22,7 +22,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ #include "config.h" - +#include // GoogleTest is written in C++, however, the function we test in C. extern "C" { #include "../gnc-ui-balances.h" diff --git a/libgnucash/app-utils/test/test-print-parse-amount.cpp b/libgnucash/app-utils/test/test-print-parse-amount.cpp index 62d3785302..ac6b4c27b5 100644 --- a/libgnucash/app-utils/test/test-print-parse-amount.cpp +++ b/libgnucash/app-utils/test/test-print-parse-amount.cpp @@ -21,9 +21,7 @@ extern "C" { #include -#include #include -#include #include "gnc-ui-util.h" #include "gnc-numeric.h" @@ -32,6 +30,9 @@ extern "C" #include } +#include +#include + static void test_num_print_info (gnc_numeric n, GNCPrintAmountInfo print_info, int line) { diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp index fdb7a3357c..e10c5b84ca 100644 --- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp +++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp @@ -37,9 +37,6 @@ extern "C" #include #include -#include -#include - #include "qof.h" #include "qofquery-p.h" #include "qofquerycore-p.h" @@ -61,6 +58,10 @@ extern "C" #endif } + +#include +#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 4ba484448a..acb21e40c0 100644 --- a/libgnucash/backend/dbi/test/test-backend-dbi.cpp +++ b/libgnucash/backend/dbi/test/test-backend-dbi.cpp @@ -19,11 +19,11 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ +#include extern "C" { #include -#include #include "qof.h" #include "cashobjects.h" } diff --git a/libgnucash/backend/sql/gnc-address-sql.cpp b/libgnucash/backend/sql/gnc-address-sql.cpp index e3c18ca9bc..8e78f08764 100644 --- a/libgnucash/backend/sql/gnc-address-sql.cpp +++ b/libgnucash/backend/sql/gnc-address-sql.cpp @@ -31,12 +31,12 @@ extern "C" { #include -#include - #include "gnc-engine.h" #include "gncAddress.h" } +#include + #include #include #include diff --git a/libgnucash/backend/sql/gnc-book-sql.cpp b/libgnucash/backend/sql/gnc-book-sql.cpp index d38487deb7..580708f373 100644 --- a/libgnucash/backend/sql/gnc-book-sql.cpp +++ b/libgnucash/backend/sql/gnc-book-sql.cpp @@ -29,8 +29,6 @@ extern "C" { #include -#include - #include "qof.h" #include "gnc-engine.h" @@ -42,6 +40,8 @@ extern "C" #endif } +#include + #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" #include "gnc-sql-object-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-customer-sql.cpp b/libgnucash/backend/sql/gnc-customer-sql.cpp index 6d3d84a9c8..7fbc5c83c0 100644 --- a/libgnucash/backend/sql/gnc-customer-sql.cpp +++ b/libgnucash/backend/sql/gnc-customer-sql.cpp @@ -31,7 +31,6 @@ extern "C" { #include -#include #include #include @@ -40,6 +39,8 @@ extern "C" #include "gncTaxTableP.h" } +#include + #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" #include "gnc-sql-object-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-employee-sql.cpp b/libgnucash/backend/sql/gnc-employee-sql.cpp index 20c7fb526d..c5b17fdb7c 100644 --- a/libgnucash/backend/sql/gnc-employee-sql.cpp +++ b/libgnucash/backend/sql/gnc-employee-sql.cpp @@ -31,13 +31,13 @@ extern "C" { #include -#include #include #include #include "gnc-commodity.h" #include "gncEmployeeP.h" } +#include #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 554a50e6cc..f7b9ef4a3a 100644 --- a/libgnucash/backend/sql/gnc-entry-sql.cpp +++ b/libgnucash/backend/sql/gnc-entry-sql.cpp @@ -31,7 +31,6 @@ extern "C" { #include -#include #include #include @@ -40,6 +39,7 @@ extern "C" #include "gncInvoiceP.h" #include "gncTaxTableP.h" } +#include #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 c688271525..421992ffd8 100644 --- a/libgnucash/backend/sql/gnc-job-sql.cpp +++ b/libgnucash/backend/sql/gnc-job-sql.cpp @@ -31,12 +31,12 @@ extern "C" { #include -#include #include #include #include "gncJobP.h" } +#include #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-price-sql.cpp b/libgnucash/backend/sql/gnc-price-sql.cpp index 1fcc5d5d96..95233b342f 100644 --- a/libgnucash/backend/sql/gnc-price-sql.cpp +++ b/libgnucash/backend/sql/gnc-price-sql.cpp @@ -29,8 +29,6 @@ extern "C" { #include -#include - #include "qof.h" #include "gnc-pricedb.h" @@ -38,6 +36,7 @@ extern "C" #include "splint-defs.h" #endif } +#include #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 892b83d1a5..3aa33e54a7 100644 --- a/libgnucash/backend/sql/gnc-recurrence-sql.cpp +++ b/libgnucash/backend/sql/gnc-recurrence-sql.cpp @@ -29,8 +29,6 @@ extern "C" { #include -#include - #include "qof.h" #include "gnc-engine.h" #include "Recurrence.h" @@ -39,6 +37,7 @@ extern "C" #include "splint-defs.h" #endif } +#include #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 c883a92085..c9147ec3aa 100644 --- a/libgnucash/backend/sql/gnc-schedxaction-sql.cpp +++ b/libgnucash/backend/sql/gnc-schedxaction-sql.cpp @@ -29,8 +29,6 @@ extern "C" { #include -#include - #include "qof.h" #include "SchedXaction.h" #include "SX-book.h" @@ -41,6 +39,8 @@ extern "C" #endif } +#include + #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" #include "gnc-sql-object-backend.hpp" diff --git a/libgnucash/backend/sql/gnc-vendor-sql.cpp b/libgnucash/backend/sql/gnc-vendor-sql.cpp index 11b27686d1..57dd78b4af 100644 --- a/libgnucash/backend/sql/gnc-vendor-sql.cpp +++ b/libgnucash/backend/sql/gnc-vendor-sql.cpp @@ -30,8 +30,6 @@ extern "C" { #include - -#include #include #include @@ -41,6 +39,8 @@ extern "C" #include "gncTaxTableP.h" } +#include + #include "gnc-sql-connection.hpp" #include "gnc-sql-backend.hpp" #include "gnc-sql-object-backend.hpp" diff --git a/libgnucash/backend/sql/test/test-sqlbe.cpp b/libgnucash/backend/sql/test/test-sqlbe.cpp index 644711df41..0a6191c3f3 100644 --- a/libgnucash/backend/sql/test/test-sqlbe.cpp +++ b/libgnucash/backend/sql/test/test-sqlbe.cpp @@ -20,10 +20,11 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ +#include + extern "C" { #include -#include #include "qof.h" } extern void test_suite_gnc_backend_sql (); diff --git a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp index b89cde9a7e..b7669f4180 100644 --- a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp +++ b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp @@ -20,11 +20,12 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ +#include + extern "C" { #include #include -#include #include } /* Add specific headers for this class */ diff --git a/libgnucash/backend/xml/gnc-account-xml-v2.cpp b/libgnucash/backend/xml/gnc-account-xml-v2.cpp index 4feb75fae0..3647c036c9 100644 --- a/libgnucash/backend/xml/gnc-account-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-account-xml-v2.cpp @@ -25,14 +25,14 @@ extern "C" { #include - -#include #include #include #include #include } +#include + #include "gnc-xml-helper.h" #include "sixtp.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/gnc-address-xml-v2.cpp b/libgnucash/backend/xml/gnc-address-xml-v2.cpp index 026e3e430c..c3484f674f 100644 --- a/libgnucash/backend/xml/gnc-address-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-address-xml-v2.cpp @@ -24,11 +24,11 @@ extern "C" { #include - -#include #include #include } +#include + #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-backend-xml.cpp b/libgnucash/backend/xml/gnc-backend-xml.cpp index 10a0d7cd8e..2acdf71a05 100644 --- a/libgnucash/backend/xml/gnc-backend-xml.cpp +++ b/libgnucash/backend/xml/gnc-backend-xml.cpp @@ -32,9 +32,6 @@ extern "C" #include -#include -#include -#include #include #include #include @@ -76,6 +73,10 @@ extern "C" #endif } +#include +#include +#include + #include #include "gnc-backend-xml.h" #include diff --git a/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp b/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp index c61f042b9b..06c6799f2b 100644 --- a/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-bill-term-xml-v2.cpp @@ -24,8 +24,6 @@ extern "C" { #include - -#include #include #include diff --git a/libgnucash/backend/xml/gnc-book-xml-v2.cpp b/libgnucash/backend/xml/gnc-book-xml-v2.cpp index e049eb7875..2270b9527d 100644 --- a/libgnucash/backend/xml/gnc-book-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-book-xml-v2.cpp @@ -25,13 +25,13 @@ extern "C" { #include - -#include #include #include #include "qof.h" } +#include + #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-budget-xml-v2.cpp b/libgnucash/backend/xml/gnc-budget-xml-v2.cpp index b30d203f40..c39c6a0c79 100644 --- a/libgnucash/backend/xml/gnc-budget-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-budget-xml-v2.cpp @@ -24,12 +24,12 @@ extern "C" { #include - -#include #include #include } +#include + #include "gnc-xml-helper.h" #include "sixtp.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp b/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp index e09950db2b..dd04f2100d 100644 --- a/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-commodity-xml-v2.cpp @@ -24,13 +24,13 @@ extern "C" { #include - -#include #include #include "AccountP.h" #include "Account.h" } +#include + #include "gnc-xml-helper.h" #include "sixtp.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/gnc-customer-xml-v2.cpp b/libgnucash/backend/xml/gnc-customer-xml-v2.cpp index dcaa9bff31..4396b7c151 100644 --- a/libgnucash/backend/xml/gnc-customer-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-customer-xml-v2.cpp @@ -24,8 +24,6 @@ extern "C" { #include - -#include #include #include @@ -34,6 +32,8 @@ extern "C" #include "gncTaxTableP.h" } +#include + #include "gnc-xml-helper.h" #include "gnc-customer-xml-v2.h" #include "gnc-address-xml-v2.h" diff --git a/libgnucash/backend/xml/gnc-employee-xml-v2.cpp b/libgnucash/backend/xml/gnc-employee-xml-v2.cpp index 5eec282a83..eaae536a22 100644 --- a/libgnucash/backend/xml/gnc-employee-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-employee-xml-v2.cpp @@ -24,12 +24,11 @@ extern "C" { #include - -#include #include #include #include "gncEmployeeP.h" } +#include #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-entry-xml-v2.cpp b/libgnucash/backend/xml/gnc-entry-xml-v2.cpp index 25b88d9354..df87a1f421 100644 --- a/libgnucash/backend/xml/gnc-entry-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-entry-xml-v2.cpp @@ -24,8 +24,6 @@ extern "C" { #include - -#include #include #include @@ -35,6 +33,8 @@ extern "C" #include "gncTaxTableP.h" } +#include + #include "gnc-xml-helper.h" #include "sixtp.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp b/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp index fe875f7efd..ec3edac8b3 100644 --- a/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-freqspec-xml-v2.cpp @@ -25,13 +25,12 @@ extern "C" { #include - -#include #include #include "qof.h" #include "SchedXaction.h" #include "FreqSpec.h" } +#include #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 333fbe5d4c..3231198bcf 100644 --- a/libgnucash/backend/xml/gnc-invoice-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-invoice-xml-v2.cpp @@ -24,14 +24,13 @@ extern "C" { #include - -#include #include #include #include "gncBillTermP.h" #include "gncInvoiceP.h" } +#include #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 ba1ab367f3..1132a996d3 100644 --- a/libgnucash/backend/xml/gnc-job-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-job-xml-v2.cpp @@ -24,12 +24,11 @@ extern "C" { #include - -#include #include #include #include "gncJobP.h" } +#include #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 8bccae7226..d42a5b4b7b 100644 --- a/libgnucash/backend/xml/gnc-lot-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-lot-xml-v2.cpp @@ -25,13 +25,12 @@ extern "C" { #include - -#include #include #include #include "gnc-lot.h" #include "gnc-lot-p.h" } +#include #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 0b45ff9f01..3b95d6ce09 100644 --- a/libgnucash/backend/xml/gnc-order-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-order-xml-v2.cpp @@ -24,12 +24,11 @@ extern "C" { #include - -#include #include #include #include "gncOrderP.h" } +#include #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 c9fc9ba989..42931c3e7d 100644 --- a/libgnucash/backend/xml/gnc-owner-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-owner-xml-v2.cpp @@ -24,8 +24,6 @@ extern "C" { #include - -#include #include #include #include "gncCustomerP.h" @@ -33,6 +31,7 @@ extern "C" #include "gncVendorP.h" #include "gncEmployeeP.h" } +#include #include "gnc-xml-helper.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 e2dd884d7b..b67e24b078 100644 --- a/libgnucash/backend/xml/gnc-recurrence-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-recurrence-xml-v2.cpp @@ -24,12 +24,11 @@ extern "C" { #include - -#include #include #include "qof.h" #include "Recurrence.h" } +#include #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 cb104e1a03..195f5a7389 100644 --- a/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-schedxaction-xml-v2.cpp @@ -23,12 +23,11 @@ extern "C" { #include - -#include #include #include "SX-book.h" } +#include #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 b9206a6260..b8e602fa48 100644 --- a/libgnucash/backend/xml/gnc-tax-table-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-tax-table-xml-v2.cpp @@ -24,13 +24,12 @@ extern "C" { #include - -#include #include #include #include "gncEntry.h" #include "gncTaxTableP.h" } +#include #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 b4aad73092..560c0d0c67 100644 --- a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp @@ -24,8 +24,6 @@ extern "C" { #include - -#include #include #include "AccountP.h" #include "Transaction.h" @@ -33,6 +31,7 @@ extern "C" #include "gnc-lot.h" #include "gnc-lot-p.h" } +#include #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp b/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp index 983e4f2586..e88fe7932c 100644 --- a/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp +++ b/libgnucash/backend/xml/gnc-vendor-xml-v2.cpp @@ -24,8 +24,6 @@ extern "C" { #include - -#include #include #include #include "gncBillTermP.h" @@ -33,6 +31,7 @@ extern "C" #include "gncTaxTableP.h" } +#include #include "gnc-xml-helper.h" #include "sixtp.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/gnc-xml-backend.cpp b/libgnucash/backend/xml/gnc-xml-backend.cpp index dc3bbb19b7..73c2cda4c1 100644 --- a/libgnucash/backend/xml/gnc-xml-backend.cpp +++ b/libgnucash/backend/xml/gnc-xml-backend.cpp @@ -27,8 +27,6 @@ extern "C" #include #include #include -#include -#include #include #include //for GNC_MOD_BACKEND @@ -38,6 +36,8 @@ extern "C" } +#include +#include #include #include "gnc-xml-backend.hpp" diff --git a/libgnucash/backend/xml/gnc-xml-helper.cpp b/libgnucash/backend/xml/gnc-xml-helper.cpp index 61df6c2e44..2e4dd81531 100644 --- a/libgnucash/backend/xml/gnc-xml-helper.cpp +++ b/libgnucash/backend/xml/gnc-xml-helper.cpp @@ -21,10 +21,7 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ -extern "C" -{ #include -} #include "gnc-xml-helper.h" diff --git a/libgnucash/backend/xml/gnc-xml-helper.h b/libgnucash/backend/xml/gnc-xml-helper.h index 601f89bcd5..6c0f91d8d4 100644 --- a/libgnucash/backend/xml/gnc-xml-helper.h +++ b/libgnucash/backend/xml/gnc-xml-helper.h @@ -24,6 +24,9 @@ #ifndef GNC_XML_HELPER_H #define GNC_XML_HELPER_H + +#include + extern "C" { #include diff --git a/libgnucash/backend/xml/io-example-account.cpp b/libgnucash/backend/xml/io-example-account.cpp index 918217ee43..a9b4be1900 100644 --- a/libgnucash/backend/xml/io-example-account.cpp +++ b/libgnucash/backend/xml/io-example-account.cpp @@ -41,9 +41,6 @@ extern "C" # include #endif -#include -#include -#include #include "gnc-engine.h" #include "Scrub.h" #include "TransLog.h" @@ -53,6 +50,9 @@ extern "C" #endif } +#include +#include +#include #include "sixtp.h" #include "gnc-xml.h" diff --git a/libgnucash/backend/xml/io-gncxml-gen.h b/libgnucash/backend/xml/io-gncxml-gen.h index 5ad7b8eeb3..dc1e7f6606 100644 --- a/libgnucash/backend/xml/io-gncxml-gen.h +++ b/libgnucash/backend/xml/io-gncxml-gen.h @@ -24,10 +24,8 @@ #ifndef IO_GNCXML_GEN_H #define IO_GNCXML_GEN_H -extern "C" -{ + #include -} #include "sixtp.h" diff --git a/libgnucash/backend/xml/io-gncxml-v2.cpp b/libgnucash/backend/xml/io-gncxml-v2.cpp index 7f7fc900f1..1b6e225326 100644 --- a/libgnucash/backend/xml/io-gncxml-v2.cpp +++ b/libgnucash/backend/xml/io-gncxml-v2.cpp @@ -36,8 +36,6 @@ extern "C" #endif #include #endif -#include -#include #include #include #ifdef HAVE_UNISTD_H @@ -66,6 +64,9 @@ extern "C" #endif } +#include +#include + #include "gnc-xml-backend.hpp" #include "sixtp-parsers.h" #include "sixtp-utils.h" diff --git a/libgnucash/backend/xml/io-utils.cpp b/libgnucash/backend/xml/io-utils.cpp index 8d9cbfe44d..ca2f7e2037 100644 --- a/libgnucash/backend/xml/io-utils.cpp +++ b/libgnucash/backend/xml/io-utils.cpp @@ -26,9 +26,9 @@ extern "C" #include #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 d8a58eda00..0b9a914a2f 100644 --- a/libgnucash/backend/xml/sixtp-dom-generators.cpp +++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp @@ -25,10 +25,10 @@ extern "C" #define __EXTENSIONS__ #include -#include #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 7762903963..9b05f48833 100644 --- a/libgnucash/backend/xml/sixtp-dom-parsers.cpp +++ b/libgnucash/backend/xml/sixtp-dom-parsers.cpp @@ -24,13 +24,13 @@ extern "C" { #include -#include #include -#include "gnc-xml-helper.h" #include } +#include +#include "gnc-xml-helper.h" #include "sixtp-utils.h" #include "sixtp-dom-parsers.h" #include diff --git a/libgnucash/backend/xml/sixtp-to-dom-parser.cpp b/libgnucash/backend/xml/sixtp-to-dom-parser.cpp index 9aba0801a3..277a6f8672 100644 --- a/libgnucash/backend/xml/sixtp-to-dom-parser.cpp +++ b/libgnucash/backend/xml/sixtp-to-dom-parser.cpp @@ -23,12 +23,11 @@ extern "C" { #include - -#include - #include } +#include + #include "sixtp-parsers.h" #include "sixtp-utils.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/sixtp.cpp b/libgnucash/backend/xml/sixtp.cpp index 95f499514f..d231efa40c 100644 --- a/libgnucash/backend/xml/sixtp.cpp +++ b/libgnucash/backend/xml/sixtp.cpp @@ -23,9 +23,6 @@ extern "C" { #include - -#include -#include #include #include #include @@ -37,6 +34,9 @@ extern "C" #endif } +#include +#include + #include "sixtp.h" #include "sixtp-parsers.h" #include "sixtp-stack.h" diff --git a/libgnucash/backend/xml/sixtp.h b/libgnucash/backend/xml/sixtp.h index 5aa7992357..585a42ac12 100644 --- a/libgnucash/backend/xml/sixtp.h +++ b/libgnucash/backend/xml/sixtp.h @@ -25,12 +25,12 @@ #define SIXTP_H extern "C" { -#include #include #include #include "gnc-engine.h" } +#include #include "gnc-xml-helper.h" #include "gnc-backend-xml.h" diff --git a/libgnucash/backend/xml/test/test-dom-converters1.cpp b/libgnucash/backend/xml/test/test-dom-converters1.cpp index fe63368419..02c31dfe66 100644 --- a/libgnucash/backend/xml/test/test-dom-converters1.cpp +++ b/libgnucash/backend/xml/test/test-dom-converters1.cpp @@ -21,21 +21,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include #include -#include - #include "test-engine-stuff.h" #include "cashobjects.h" #include "gnc-engine.h" #include "gnc-commodity.h" } +#include + #include "test-file-stuff.h" #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/libgnucash/backend/xml/test/test-dom-parser1.cpp b/libgnucash/backend/xml/test/test-dom-parser1.cpp index 59933a4c5f..28de9542cb 100644 --- a/libgnucash/backend/xml/test/test-dom-parser1.cpp +++ b/libgnucash/backend/xml/test/test-dom-parser1.cpp @@ -17,18 +17,19 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ +#include + extern "C" { #include -#include #include -#include - #include "test-stuff.h" } +#include + #include "gnc-xml-helper.h" #include "sixtp.h" #include "sixtp-parsers.h" diff --git a/libgnucash/backend/xml/test/test-file-stuff.cpp b/libgnucash/backend/xml/test/test-file-stuff.cpp index 1ba6e974e5..0264c81224 100644 --- a/libgnucash/backend/xml/test/test-file-stuff.cpp +++ b/libgnucash/backend/xml/test/test-file-stuff.cpp @@ -21,6 +21,8 @@ * 02110-1301, USA. */ #include +#include +#include extern "C" { @@ -31,15 +33,14 @@ extern "C" #include #include #include -#include #include -#include -#include #include "gnc-engine.h" #include "test-stuff.h" } +#include + #include "test-file-stuff.h" #include "sixtp-dom-parsers.h" #include "sixtp-parsers.h" diff --git a/libgnucash/backend/xml/test/test-file-stuff.h b/libgnucash/backend/xml/test/test-file-stuff.h index fd9e00ea3d..158d8cddf3 100644 --- a/libgnucash/backend/xml/test/test-file-stuff.h +++ b/libgnucash/backend/xml/test/test-file-stuff.h @@ -24,10 +24,10 @@ #ifndef TEST_FILE_STUFF_H #define TEST_FILE_STUFF_H -extern "C" -{ #include +extern "C" +{ #include #include } diff --git a/libgnucash/backend/xml/test/test-load-example-account.cpp b/libgnucash/backend/xml/test/test-load-example-account.cpp index af0c437771..3596a7cad4 100644 --- a/libgnucash/backend/xml/test/test-load-example-account.cpp +++ b/libgnucash/backend/xml/test/test-load-example-account.cpp @@ -20,12 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include #include -#include #include #include #include @@ -36,6 +36,8 @@ extern "C" #include "test-engine-stuff.h" } +#include + #include "test-file-stuff.h" #include "io-gncxml-v2.h" diff --git a/libgnucash/backend/xml/test/test-load-xml2.cpp b/libgnucash/backend/xml/test/test-load-xml2.cpp index f1e3cfdffc..9454700789 100644 --- a/libgnucash/backend/xml/test/test-load-xml2.cpp +++ b/libgnucash/backend/xml/test/test-load-xml2.cpp @@ -25,6 +25,10 @@ /* @file test-load-xml2.c * @brief test the loading of a version-2 gnucash XML file */ +#include +#include +#include + extern "C" { #include @@ -36,9 +40,6 @@ extern "C" #include #include #include -#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 8501a7c883..78cc644b6b 100644 --- a/libgnucash/backend/xml/test/test-save-in-lang.cpp +++ b/libgnucash/backend/xml/test/test-save-in-lang.cpp @@ -17,17 +17,17 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ +#include +#include + extern "C" { #include -#include -#include #include #include #include #include #include -#include #include #include "test-engine-stuff.h" @@ -36,6 +36,8 @@ extern "C" #include "TransLog.h" } +#include + #include "test-file-stuff.h" #include "io-gncxml-v2.h" #include "test-stuff.h" diff --git a/libgnucash/backend/xml/test/test-xml-account.cpp b/libgnucash/backend/xml/test/test-xml-account.cpp index d336ec2372..ee90e5901b 100644 --- a/libgnucash/backend/xml/test/test-xml-account.cpp +++ b/libgnucash/backend/xml/test/test-xml-account.cpp @@ -21,13 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include +#include + extern "C" { #include -#include -#include -#include #include #include #include @@ -39,6 +39,8 @@ extern "C" #include "Scrub.h" } +#include + #include "../gnc-xml-helper.h" #include "../gnc-xml.h" #include "../sixtp-parsers.h" diff --git a/libgnucash/backend/xml/test/test-xml-commodity.cpp b/libgnucash/backend/xml/test/test-xml-commodity.cpp index 6ff7e76565..5deeeed9d3 100644 --- a/libgnucash/backend/xml/test/test-xml-commodity.cpp +++ b/libgnucash/backend/xml/test/test-xml-commodity.cpp @@ -17,13 +17,13 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ +#include +#include + extern "C" { #include -#include -#include -#include #include #include "qof.h" @@ -32,6 +32,8 @@ extern "C" #include "Account.h" } +#include + #include "gnc-xml-helper.h" #include "gnc-xml.h" #include "sixtp-parsers.h" diff --git a/libgnucash/backend/xml/test/test-xml-pricedb.cpp b/libgnucash/backend/xml/test/test-xml-pricedb.cpp index 4660084f7b..7bf5afe92e 100644 --- a/libgnucash/backend/xml/test/test-xml-pricedb.cpp +++ b/libgnucash/backend/xml/test/test-xml-pricedb.cpp @@ -21,12 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include +#include + extern "C" { #include -#include -#include #include #include diff --git a/libgnucash/backend/xml/test/test-xml-transaction.cpp b/libgnucash/backend/xml/test/test-xml-transaction.cpp index 2389206828..54a22262ad 100644 --- a/libgnucash/backend/xml/test/test-xml-transaction.cpp +++ b/libgnucash/backend/xml/test/test-xml-transaction.cpp @@ -21,12 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include +#include + extern "C" { #include -#include -#include #include #include diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp index da1bf5189a..a6446ba724 100644 --- a/libgnucash/core-utils/gnc-filepath-utils.cpp +++ b/libgnucash/core-utils/gnc-filepath-utils.cpp @@ -26,6 +26,11 @@ * @author Copyright (c) 2000 Dave Peticolas */ +#include +#include +#include +#include + extern "C" { #include @@ -35,10 +40,6 @@ extern "C" { #include #endif -#include -#include -#include -#include #include #include diff --git a/libgnucash/core-utils/gnc-locale-utils.cpp b/libgnucash/core-utils/gnc-locale-utils.cpp index 10574c2100..c73a02dd59 100644 --- a/libgnucash/core-utils/gnc-locale-utils.cpp +++ b/libgnucash/core-utils/gnc-locale-utils.cpp @@ -19,10 +19,7 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ -extern "C" -{ #include -} #include #include #include "gnc-locale-utils.hpp" diff --git a/libgnucash/core-utils/gnc-prefs.h b/libgnucash/core-utils/gnc-prefs.h index b18d1e0796..7d7a104d0e 100644 --- a/libgnucash/core-utils/gnc-prefs.h +++ b/libgnucash/core-utils/gnc-prefs.h @@ -45,7 +45,11 @@ #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" diff --git a/libgnucash/core-utils/test/gtest-path-utilities.cpp b/libgnucash/core-utils/test/gtest-path-utilities.cpp index 94e83566ff..d7210007bd 100644 --- a/libgnucash/core-utils/test/gtest-path-utilities.cpp +++ b/libgnucash/core-utils/test/gtest-path-utilities.cpp @@ -1,7 +1,8 @@ +#include + extern "C" { #include -#include #include #include #include diff --git a/libgnucash/engine/SX-book.h b/libgnucash/engine/SX-book.h index 0b674ebd30..111aaceafb 100644 --- a/libgnucash/engine/SX-book.h +++ b/libgnucash/engine/SX-book.h @@ -42,7 +42,11 @@ typedef struct xaccSchedXactionsDef SchedXactions; typedef struct _SchedXactionsClass SchedXactionsClass; +#ifdef __cplusplus +extern "C++" { #include +} +#endif #include "SchedXaction.h" #include "qof.h" diff --git a/libgnucash/engine/engine-helpers.h b/libgnucash/engine/engine-helpers.h index 4b3abe6ee8..517d4e1489 100644 --- a/libgnucash/engine/engine-helpers.h +++ b/libgnucash/engine/engine-helpers.h @@ -25,7 +25,11 @@ #ifndef ENGINE_HELPERS_H #define ENGINE_HELPERS_H +#ifdef __cplusplus +extern "C++" { #include +} +#endif #include "gnc-engine.h" #include "Account.h" diff --git a/libgnucash/engine/gnc-commodity.h b/libgnucash/engine/gnc-commodity.h index 1f20a7189f..afb18fee3f 100644 --- a/libgnucash/engine/gnc-commodity.h +++ b/libgnucash/engine/gnc-commodity.h @@ -49,8 +49,13 @@ typedef struct _GncCommodityClass gnc_commodityClass; typedef struct _GncCommodityNamespaceClass gnc_commodity_namespaceClass; +#ifdef __cplusplus +extern "C++" { #include #include +} +#endif + #include "gnc-engine.h" #ifdef __cplusplus diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp index 5cdf3a655b..2f48aa91f3 100644 --- a/libgnucash/engine/gnc-date.cpp +++ b/libgnucash/engine/gnc-date.cpp @@ -26,11 +26,11 @@ \********************************************************************/ #define __EXTENSIONS__ +#include extern "C" { #include -#include #include #include #include "platform.h" diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h index b911fa58b9..7556fd1c66 100644 --- a/libgnucash/engine/gnc-date.h +++ b/libgnucash/engine/gnc-date.h @@ -68,12 +68,21 @@ #ifndef GNC_DATE_H #define GNC_DATE_H + + #ifdef __cplusplus extern "C" { #endif - + +#ifdef __cplusplus +extern "C++" { +#endif #include +#ifdef __cplusplus +} +#endif + #include /** diff --git a/libgnucash/engine/gnc-engine.h b/libgnucash/engine/gnc-engine.h index 651cf44e52..80aa8b4c29 100644 --- a/libgnucash/engine/gnc-engine.h +++ b/libgnucash/engine/gnc-engine.h @@ -36,7 +36,12 @@ #ifndef GNC_ENGINE_H #define GNC_ENGINE_H +#ifdef __cplusplus +extern "C++" { #include +} +#endif + #include "qof.h" #ifdef __cplusplus diff --git a/libgnucash/engine/gnc-numeric.cpp b/libgnucash/engine/gnc-numeric.cpp index 5e6773847c..040845a31f 100644 --- a/libgnucash/engine/gnc-numeric.cpp +++ b/libgnucash/engine/gnc-numeric.cpp @@ -26,7 +26,6 @@ extern "C" { #include -#include #include #include #include @@ -35,6 +34,7 @@ extern "C" #include "qof.h" } +#include #include #include #include diff --git a/libgnucash/engine/gncBusiness.h b/libgnucash/engine/gncBusiness.h index a0190e242c..1b7ce063b1 100644 --- a/libgnucash/engine/gncBusiness.h +++ b/libgnucash/engine/gncBusiness.h @@ -34,7 +34,11 @@ #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/gncEntry.h b/libgnucash/engine/gncEntry.h index d1d850fea4..8c8c82e112 100644 --- a/libgnucash/engine/gncEntry.h +++ b/libgnucash/engine/gncEntry.h @@ -31,6 +31,12 @@ #ifndef GNC_ENTRY_H_ #define GNC_ENTRY_H_ +#ifdef __cplusplus +extern "C++" { +#include +} +#endif + typedef struct _gncEntry GncEntry; typedef struct _gncEntryClass GncEntryClass; diff --git a/libgnucash/engine/guid.h b/libgnucash/engine/guid.h index 918b75a789..f43f194d16 100644 --- a/libgnucash/engine/guid.h +++ b/libgnucash/engine/guid.h @@ -25,13 +25,13 @@ #ifndef GUID_H #define GUID_H +#include #ifdef __cplusplus extern "C" { #endif #include -#include /** @addtogroup Entity @{ */ diff --git a/libgnucash/engine/qof-string-cache.cpp b/libgnucash/engine/qof-string-cache.cpp index caba239fbb..738bbf063e 100644 --- a/libgnucash/engine/qof-string-cache.cpp +++ b/libgnucash/engine/qof-string-cache.cpp @@ -31,12 +31,13 @@ extern "C" #include #include -#include #include #include #include "qof.h" } +#include + /* 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 08baaeabb2..ac3fbf569c 100644 --- a/libgnucash/engine/qof.h +++ b/libgnucash/engine/qof.h @@ -68,7 +68,11 @@ */ /** @} */ +#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 55f8cf44b6..47cfa85fbb 100644 --- a/libgnucash/engine/qofbook.cpp +++ b/libgnucash/engine/qofbook.cpp @@ -41,7 +41,6 @@ extern "C" #include #include -#include #ifdef GNC_PLATFORM_WINDOWS /* Mingw disables the standard type macros for C++ without this override. */ #define __STDC_FORMAT_MACROS = 1 @@ -50,6 +49,7 @@ extern "C" } +#include #include "qof.h" #include "qofevent-p.h" #include "qofbackend.h" diff --git a/libgnucash/engine/qofbook.h b/libgnucash/engine/qofbook.h index bc315c80f8..4a7877c0af 100644 --- a/libgnucash/engine/qofbook.h +++ b/libgnucash/engine/qofbook.h @@ -41,6 +41,7 @@ #define QOF_BOOK_H #ifdef __cplusplus +#include //To preempt it being included extern "C" in a later header. extern "C" { #endif diff --git a/libgnucash/engine/qofchoice.cpp b/libgnucash/engine/qofchoice.cpp index 715417efa2..16a9e4a7a6 100644 --- a/libgnucash/engine/qofchoice.cpp +++ b/libgnucash/engine/qofchoice.cpp @@ -21,14 +21,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -extern "C" -{ - #include #include -} - #include "qof.h" #include "qofchoice.h" diff --git a/libgnucash/engine/qofclass.cpp b/libgnucash/engine/qofclass.cpp index acaa8fb1cf..fdabf3fb09 100644 --- a/libgnucash/engine/qofclass.cpp +++ b/libgnucash/engine/qofclass.cpp @@ -21,11 +21,8 @@ * * \********************************************************************/ -extern "C" -{ #include #include -} #include "qof.h" #include "qofclass-p.h" diff --git a/libgnucash/engine/qofevent.cpp b/libgnucash/engine/qofevent.cpp index 674cdeb89a..ae69048f4c 100644 --- a/libgnucash/engine/qofevent.cpp +++ b/libgnucash/engine/qofevent.cpp @@ -22,11 +22,8 @@ * * ********************************************************************/ -extern "C" -{ #include #include -} #include "qof.h" #include "qofevent-p.h" diff --git a/libgnucash/engine/qofid.cpp b/libgnucash/engine/qofid.cpp index 7f713c66f2..ac5167fca2 100644 --- a/libgnucash/engine/qofid.cpp +++ b/libgnucash/engine/qofid.cpp @@ -26,9 +26,9 @@ extern "C" { #include #include -#include } +#include #include "qof.h" #include "qofid-p.h" #include "qofinstance-p.h" diff --git a/libgnucash/engine/qoflog.cpp b/libgnucash/engine/qoflog.cpp index a545ff0512..f91817668c 100644 --- a/libgnucash/engine/qoflog.cpp +++ b/libgnucash/engine/qoflog.cpp @@ -34,8 +34,6 @@ extern "C" #include #endif -#include -#include #ifdef HAVE_UNISTD_H # include #else @@ -48,10 +46,12 @@ extern "C" #include #include -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "qof.log" } +#include +#include +#undef G_LOG_DOMAIN +#define G_LOG_DOMAIN "qof.log" #include "qof.h" #include "qoflog.h" #include diff --git a/libgnucash/engine/qofobject.cpp b/libgnucash/engine/qofobject.cpp index ba87e34342..0138aad159 100644 --- a/libgnucash/engine/qofobject.cpp +++ b/libgnucash/engine/qofobject.cpp @@ -23,11 +23,8 @@ * Copyright (C) 2001 Derek Atkins * Author: Derek Atkins */ -extern "C" -{ #include #include -} #include "qof.h" #include "qofobject-p.h" diff --git a/libgnucash/engine/qofquery.cpp b/libgnucash/engine/qofquery.cpp index 5af8560396..41d49c1bb5 100644 --- a/libgnucash/engine/qofquery.cpp +++ b/libgnucash/engine/qofquery.cpp @@ -27,11 +27,11 @@ extern "C" #include #include -#include #include #include } +#include #include "qof.h" #include "qof-backend.hpp" #include "qofbook-p.h" diff --git a/libgnucash/engine/qofsession.cpp b/libgnucash/engine/qofsession.cpp index 86edb1fc67..dd96a609a1 100644 --- a/libgnucash/engine/qofsession.cpp +++ b/libgnucash/engine/qofsession.cpp @@ -48,13 +48,13 @@ extern "C" # endif #endif -#include #include "qof.h" #include "qofobject-p.h" static QofLogModule log_module = QOF_MOD_SESSION; } //extern 'C' +#include #include "qofbook-p.h" #include "qof-backend.hpp" #include "qofsession.hpp" diff --git a/libgnucash/engine/test/test-account-object.cpp b/libgnucash/engine/test/test-account-object.cpp index 32f612e65f..f1d21a5706 100644 --- a/libgnucash/engine/test/test-account-object.cpp +++ b/libgnucash/engine/test/test-account-object.cpp @@ -24,11 +24,12 @@ * @brief Minimal test of reading/writing account parameters * @author David Hampton */ +#include + extern "C" { #include #include -#include #include "qof.h" #include "Account.h" #include "cashobjects.h" diff --git a/libgnucash/engine/test/test-commodities.cpp b/libgnucash/engine/test/test-commodities.cpp index 5aae8ec60f..efd9421586 100644 --- a/libgnucash/engine/test/test-commodities.cpp +++ b/libgnucash/engine/test/test-commodities.cpp @@ -22,11 +22,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include - #include "gnc-commodity.h" #include "qof.h" #include "test-engine-stuff.h" diff --git a/libgnucash/engine/test/test-gnc-guid-old.cpp b/libgnucash/engine/test/test-gnc-guid-old.cpp index 1ce3456d7e..a64adb3361 100644 --- a/libgnucash/engine/test/test-gnc-guid-old.cpp +++ b/libgnucash/engine/test/test-gnc-guid-old.cpp @@ -21,12 +21,13 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ +#include #include "../guid.hpp" + extern "C" { #include #include -#include #include void test_suite_gnc_guid (void); } diff --git a/libgnucash/engine/test/test-group-vs-book.cpp b/libgnucash/engine/test/test-group-vs-book.cpp index 31cf1aadee..010913ebba 100644 --- a/libgnucash/engine/test/test-group-vs-book.cpp +++ b/libgnucash/engine/test/test-group-vs-book.cpp @@ -20,10 +20,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include #include "qof.h" #include "cashobjects.h" #include "Account.h" diff --git a/libgnucash/engine/test/test-guid.cpp b/libgnucash/engine/test/test-guid.cpp index 6c76075249..ad42ec49c7 100644 --- a/libgnucash/engine/test/test-guid.cpp +++ b/libgnucash/engine/test/test-guid.cpp @@ -26,11 +26,12 @@ * */ #include +#include + extern "C" { #include #include -#include #include "cashobjects.h" #include "test-stuff.h" #include "test-engine-stuff.h" diff --git a/libgnucash/engine/test/test-lots.cpp b/libgnucash/engine/test/test-lots.cpp index c1033d3d04..58d2f8ab11 100644 --- a/libgnucash/engine/test/test-lots.cpp +++ b/libgnucash/engine/test/test-lots.cpp @@ -24,11 +24,12 @@ * @brief Minimal test to see if automatic lot scrubbing works. * @author Linas Vepstas */ +#include + extern "C" { #include #include -#include #include "qof.h" #include "Account.h" #include "Scrub3.h" diff --git a/libgnucash/engine/test/test-numeric.cpp b/libgnucash/engine/test/test-numeric.cpp index 1963d80fe8..c2cd7e534d 100644 --- a/libgnucash/engine/test/test-numeric.cpp +++ b/libgnucash/engine/test/test-numeric.cpp @@ -21,12 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include extern "C" { #include #include -#include #include "cashobjects.h" #include "test-stuff.h" #include "test-engine-stuff.h" diff --git a/libgnucash/engine/test/test-qofinstance.cpp b/libgnucash/engine/test/test-qofinstance.cpp index 1f979a1615..9299e42239 100644 --- a/libgnucash/engine/test/test-qofinstance.cpp +++ b/libgnucash/engine/test/test-qofinstance.cpp @@ -20,11 +20,12 @@ * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ +#include #include + extern "C" { #include -#include #include #include "../qof.h" } diff --git a/libgnucash/engine/test/test-qofsession-old.cpp b/libgnucash/engine/test/test-qofsession-old.cpp index 2282c0df50..4c73365eab 100644 --- a/libgnucash/engine/test/test-qofsession-old.cpp +++ b/libgnucash/engine/test/test-qofsession-old.cpp @@ -21,10 +21,11 @@ \********************************************************************/ #include "../guid.hpp" +#include + extern "C" { #include -#include #include } diff --git a/libgnucash/engine/test/test-query.cpp b/libgnucash/engine/test/test-query.cpp index f21c7922ac..94ab2c0d83 100644 --- a/libgnucash/engine/test/test-query.cpp +++ b/libgnucash/engine/test/test-query.cpp @@ -20,10 +20,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include #include "qof.h" #include "cashobjects.h" #include "Transaction.h" diff --git a/libgnucash/engine/test/test-split-vs-account.cpp b/libgnucash/engine/test/test-split-vs-account.cpp index ee1e320a11..81c42d635a 100644 --- a/libgnucash/engine/test/test-split-vs-account.cpp +++ b/libgnucash/engine/test/test-split-vs-account.cpp @@ -21,10 +21,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include #include "qof.h" #include "cashobjects.h" #include "AccountP.h" diff --git a/libgnucash/engine/test/test-transaction-reversal.cpp b/libgnucash/engine/test/test-transaction-reversal.cpp index c8e918e4f6..e5183cc5af 100644 --- a/libgnucash/engine/test/test-transaction-reversal.cpp +++ b/libgnucash/engine/test/test-transaction-reversal.cpp @@ -20,10 +20,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include #include #include "cashobjects.h" #include "Transaction.h" diff --git a/libgnucash/engine/test/test-transaction-voiding.cpp b/libgnucash/engine/test/test-transaction-voiding.cpp index f6037d1783..e4aa60c63e 100644 --- a/libgnucash/engine/test/test-transaction-voiding.cpp +++ b/libgnucash/engine/test/test-transaction-voiding.cpp @@ -20,10 +20,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include + extern "C" { #include -#include #include #include "cashobjects.h" #include "Account.h" diff --git a/libgnucash/engine/test/utest-Account.cpp b/libgnucash/engine/test/utest-Account.cpp index eab36c3253..be3057f3bd 100644 --- a/libgnucash/engine/test/utest-Account.cpp +++ b/libgnucash/engine/test/utest-Account.cpp @@ -19,11 +19,12 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ +#include + extern "C" { #include #include -#include #include #include #include diff --git a/libgnucash/engine/test/utest-Split.cpp b/libgnucash/engine/test/utest-Split.cpp index 18286e283c..660210b16e 100644 --- a/libgnucash/engine/test/utest-Split.cpp +++ b/libgnucash/engine/test/utest-Split.cpp @@ -21,11 +21,12 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ +#include + extern "C" { #include #include -#include #include /* Add specific headers for this class */ #include diff --git a/libgnucash/engine/test/utest-Transaction.cpp b/libgnucash/engine/test/utest-Transaction.cpp index 69cf8ed621..26aa66d3d1 100644 --- a/libgnucash/engine/test/utest-Transaction.cpp +++ b/libgnucash/engine/test/utest-Transaction.cpp @@ -21,11 +21,12 @@ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * ********************************************************************/ +#include + extern "C" { #include #include -#include #include /* Add specific headers for this class */ #include "../Transaction.h"