gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sun Jan 8 19:15:56 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/3231185a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fed4daf4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/61673ec9 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d4a1fb92 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f96f8f40 (commit)
	from  https://github.com/Gnucash/gnucash/commit/de847278 (commit)



commit 3231185a51cb3b473a751e2b71976a2a2b98de73
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jan 8 16:15:06 2023 -0800

    [c++ quotes] std::setw requires include <iomanip>.

diff --git a/gnucash/gnucash-commands.cpp b/gnucash/gnucash-commands.cpp
index 840887862..6cfa44ca4 100644
--- a/gnucash/gnucash-commands.cpp
+++ b/gnucash/gnucash-commands.cpp
@@ -44,6 +44,7 @@ extern "C" {
 #include <boost/locale.hpp>
 #include <fstream>
 #include <iostream>
+#include <iomanip>
 #include <gnc-report.h>
 #include <gnc-quotes.hpp>
 

commit fed4daf4e7dea7c85a56ad08f1817319272f7567
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jan 8 16:11:58 2023 -0800

    [c++ quotes] Make sure to include all of the required Boost libraries.
    
    Also Boost-iostreams needs winsock but doesn't tell Cmake, so explicitly
    add it to the link list.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b6e8f94f..d783a8713 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -546,7 +546,7 @@ set (Boost_FIND_QUIETLY ON)
 if (NOT DEFINED ${BOOST_ROOT})
   set(BOOST_ROOT $ENV{BOOST_ROOT})
 endif()
-find_package (Boost 1.67.0 COMPONENTS date_time regex locale filesystem system program_options)
+find_package (Boost 1.67.0 COMPONENTS algorithm asio date_time filesystem iostreams locale process program_options property_tree regex system)
 
 if (Boost_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 86bcb48f8..c635715ef 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -65,7 +65,7 @@ set(app_utils_ALL_INCLUDES
 
 if (WIN32)
   list(APPEND app_utils_ALL_SOURCES gnc-help-utils.c)
-  list(APPEND app_utils_ALL_LIBRARIES ${HTMLHELP_LIBRARY})
+  list(APPEND app_utils_ALL_LIBRARIES ${HTMLHELP_LIBRARY} "-lwsock32")
   list(APPEND app_utils_ALL_INCLUDES ${HTMLHELP_INCLUDE_PATH})
 endif()
 

commit 61673ec919d4739b395cc0904f8b920095e3e97f
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jan 8 16:09:32 2023 -0800

    [c++ options] Rearrange header includes to avoid windows.h conflicts.
    
    Since SWIG guile pulls in libguile early the options headers must
    be included in a begin block.

diff --git a/bindings/engine.i b/bindings/engine.i
index 5deef394b..2dbd47e0f 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -66,8 +66,6 @@ extern "C"
 %{
 extern "C"
 {
-#include "guile-mappings.h"
-
 SCM scm_init_sw_engine_module (void);
 }
 %}
diff --git a/bindings/guile/gnc-optiondb.i b/bindings/guile/gnc-optiondb.i
index c29c02c1f..9dffc7c66 100644
--- a/bindings/guile/gnc-optiondb.i
+++ b/bindings/guile/gnc-optiondb.i
@@ -62,18 +62,32 @@ namespace std {
 %typemap(in) std::size_t "$1 = scm_to_ulong($input);";
 %typemap(out) std::size_t "$result = scm_from_ulong($1);";
 
+%begin
 %{
-#include "gnc-optiondb.h"
-#include "gnc-optiondb.hpp"
-#include "gnc-optiondb-impl.hpp"
-#include "gnc-option-date.hpp"
+#include <gnc-optiondb.h>
+#include <gnc-optiondb.hpp>
+#include <gnc-optiondb-impl.hpp>
+#include <gnc-option-date.hpp>
 #include <array>
 #include <sstream>
 #include <iomanip>
-
+#include <guile-mappings.h>
+  %}
+%{
 static const QofLogModule log_module = "gnc.optiondb";
 
 SCM scm_init_sw_gnc_optiondb_module(void);
+/*Windows.h defines ERROR but SWIG needs it to, so undef it. */
+#ifdef ERROR
+#undef ERROR
+#endif
+/*Something somewhere in windows.h defines ABSOLUTE to something and
+ *that contaminates using it in RelativeDateType.  Undef it.
+ */
+#ifdef ABSOLUTE
+#undef ABSOLUTE
+#endif
+
 %}
 
 %ignore gnc_get_current_session(void);

commit d4a1fb92a6a23556a87b9308adbb94049c7ab748
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jan 8 16:08:04 2023 -0800

    [c++ options] strptime.h must be included as extern "C".

diff --git a/bindings/guile/gnc-engine-guile.cpp b/bindings/guile/gnc-engine-guile.cpp
index 7028bd33c..4470adb20 100644
--- a/bindings/guile/gnc-engine-guile.cpp
+++ b/bindings/guile/gnc-engine-guile.cpp
@@ -39,11 +39,11 @@ extern "C"
 #include "gnc-guile-utils.h"
 #include <qof.h>
 #include <qofbookslots.h>
-}
 
 #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.

commit f96f8f40430b73bdd91b70207653e7fb94229677
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jan 8 16:04:27 2023 -0800

    [c++options] Reorder include directives to fix Windows biuld.
    
    libguile.h includes windows.h and doing so breaks including c++ headers
    after that use advanced features like enum class. Ensure that the
    gnc-option headers are included before libguile.h.

diff --git a/gnucash/gnome-utils/dialog-options.cpp b/gnucash/gnome-utils/dialog-options.cpp
index 3293b5a5a..59fa64d27 100644
--- a/gnucash/gnome-utils/dialog-options.cpp
+++ b/gnucash/gnome-utils/dialog-options.cpp
@@ -29,10 +29,13 @@ extern "C"
 }
 
 #include <Account.h> // To include as C++ overriding later indirect includes
-#include <libguile.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <glib/gi18n.h>
+#include <gnc-optiondb.hpp>
+#include <gnc-optiondb-impl.hpp>
+#include "dialog-options.hpp"
+#include <libguile.h>
 
 extern "C"
 {
@@ -48,10 +51,7 @@ extern "C"
 #include <iostream>
 #include <sstream>
 
-#include "dialog-options.hpp"
 #include "gnc-option-gtk-ui.hpp"
-#include <gnc-optiondb.hpp>
-#include <gnc-optiondb-impl.hpp>
 
 #define GNC_PREF_CLOCK_24H "clock-24h"
 
diff --git a/gnucash/gnome-utils/dialog-options.hpp b/gnucash/gnome-utils/dialog-options.hpp
index 9a6facf35..ae0f45d7f 100644
--- a/gnucash/gnome-utils/dialog-options.hpp
+++ b/gnucash/gnome-utils/dialog-options.hpp
@@ -34,6 +34,8 @@
 
 #include "gnc-option-uitype.hpp"
 #include <gnc-option-ui.hpp>
+#include <gnc-optiondb.hpp>
+#include <gtk/gtk.h>
 
 class GncOptionsDialog;
 
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 09456f733..a4246f35e 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -32,11 +32,12 @@
     @author Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
     @author Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org>
 */
-#include <libguile.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkkeysyms.h>
+#include "dialog-options.hpp"
+#include <libguile.h>
 
 extern "C"
 {
@@ -88,7 +89,6 @@ extern "C"
 # include <sys/stat.h> // for stat(2)
 #endif
 }
-#include "dialog-options.hpp"
 
 /** 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 053cbd9b8..38fb4d60d 100644
--- a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
+++ b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
@@ -20,9 +20,9 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
 
-#include "gnc-option-gtk-ui.hpp"
 #include <gnc-option.hpp>
 #include <gnc-option-impl.hpp>
+#include "gnc-option-gtk-ui.hpp"
 extern "C"
 {
 #include <config.h>  // for scanf format string
@@ -39,6 +39,14 @@ extern "C"
 #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.
+ */
+#ifdef ABSOLUTE
+#undef ABSOLUTE
+#endif
+
 /* This static indicates the debugging module that this .o belongs to.  */
 static QofLogModule log_module = GNC_MOD_GUI;
 
diff --git a/gnucash/gnome-utils/gnc-option-gtk-ui.hpp b/gnucash/gnome-utils/gnc-option-gtk-ui.hpp
index 66224545f..8504e431c 100644
--- a/gnucash/gnome-utils/gnc-option-gtk-ui.hpp
+++ b/gnucash/gnome-utils/gnc-option-gtk-ui.hpp
@@ -23,13 +23,13 @@
 #ifndef GNC_OPTION_GTK_UI_HPP
 #define GNC_OPTION_GTK_UI_HPP
 
-#include <libguile.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <vector>
 #include <gnc-option.hpp>
 #include <gnc-option-uitype.hpp>
 #include <gnc-option-ui.hpp>
+#include <libguile.h>
 
 /** @fn WidgetCreateFunc
 *  Function pointer for per-option-type GtkWidget constructors.
diff --git a/gnucash/gnome/assistant-hierarchy.cpp b/gnucash/gnome/assistant-hierarchy.cpp
index 254c7b89f..7e64b2526 100644
--- a/gnucash/gnome/assistant-hierarchy.cpp
+++ b/gnucash/gnome/assistant-hierarchy.cpp
@@ -22,10 +22,12 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
 
-#include <libguile.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
+#include <dialog-options.hpp>
+#include <gnc-optiondb.h>
+#include <libguile.h>
 
 extern "C"
 {
@@ -67,8 +69,6 @@ extern "C"
 
 #include "gnc-engine.h"
 }
-#include <dialog-options.hpp>
-#include "gnc-optiondb.h"
 
 static QofLogModule log_module = GNC_MOD_IMPORT;
 
diff --git a/gnucash/gnome/dialog-report-column-view.cpp b/gnucash/gnome/dialog-report-column-view.cpp
index 4821ab9dc..838e8a272 100644
--- a/gnucash/gnome/dialog-report-column-view.cpp
+++ b/gnucash/gnome/dialog-report-column-view.cpp
@@ -21,10 +21,12 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
  ********************************************************************/
 
-#include <libguile.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <algorithm>
+#include <dialog-options.hpp>
+#include <gnc-optiondb-impl.hpp>
+#include <libguile.h>
 
 extern "C"
 {
@@ -40,9 +42,7 @@ extern "C"
 }
 
 #include "dialog-report-column-view.hpp"
-#include <dialog-options.hpp>
 #include <gnc-report.h>
-#include "gnc-optiondb-impl.hpp"
 
 enum available_cols
 {
diff --git a/gnucash/gnome/dialog-report-style-sheet.cpp b/gnucash/gnome/dialog-report-style-sheet.cpp
index 472db0e7f..ec405b630 100644
--- a/gnucash/gnome/dialog-report-style-sheet.cpp
+++ b/gnucash/gnome/dialog-report-style-sheet.cpp
@@ -22,9 +22,11 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
  ********************************************************************/
 
-#include <libguile.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include <dialog-options.hpp>
+#include <gnc-optiondb.h>
+#include <libguile.h>
 
 extern "C"
 {
@@ -41,8 +43,6 @@ extern "C"
 #include <guile-mappings.h>
 }
 #include "gnc-report.h"
-#include <dialog-options.hpp>
-#include "gnc-optiondb.h"
 
 #define DIALOG_STYLE_SHEETS_CM_CLASS "style-sheets-dialog"
 #define GNC_PREFS_GROUP              "dialogs.style-sheet"
diff --git a/gnucash/gnome/gnc-plugin-page-report.cpp b/gnucash/gnome/gnc-plugin-page-report.cpp
index a7417ba7d..a9f1b24fd 100644
--- a/gnucash/gnome/gnc-plugin-page-report.cpp
+++ b/gnucash/gnome/gnc-plugin-page-report.cpp
@@ -36,10 +36,11 @@
     @author Copyright (C) 2004 Joshua Sled <jsled at asynchronous.org>
     @author Copyright (C) 2005 David Hampton <hampton at employees.org>
 */
-#include <libguile.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
+#include <gnc-optiondb-impl.hpp>
+#include <libguile.h>
 
 extern "C"
 {
@@ -80,7 +81,6 @@ extern "C"
 
 #include <memory>
 #include <gnc-report.h>
-#include "gnc-optiondb-impl.hpp"
 
 /* NW: you can add GNC_MOD_REPORT to gnc-engine.h
 or simply define it locally. Any unique string with
diff --git a/gnucash/gnome/window-report.cpp b/gnucash/gnome/window-report.cpp
index 5580bad58..7b4e7c159 100644
--- a/gnucash/gnome/window-report.cpp
+++ b/gnucash/gnome/window-report.cpp
@@ -24,9 +24,11 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
  *                                                                  *
  ********************************************************************/
-#include <libguile.h>
 #include <glib/gi18n.h>
 #include <memory>
+#include "dialog-options.hpp"
+#include "dialog-report-column-view.hpp"
+#include <libguile.h>
 
 extern "C"
 {
@@ -44,8 +46,6 @@ extern "C"
 #include "gnc-plugin-page-report.h"
 }
 #include "gnc-report.h"
-#include "dialog-options.hpp"
-#include "dialog-report-column-view.hpp"
 
 /********************************************************************
  *
diff --git a/gnucash/report/gnc-report.cpp b/gnucash/report/gnc-report.cpp
index 71c429de8..6dffdf4a3 100644
--- a/gnucash/report/gnc-report.cpp
+++ b/gnucash/report/gnc-report.cpp
@@ -26,6 +26,7 @@
 #ifdef __MINGW32__
 #define _GL_UNISTD_H //Deflect poisonous define in Guile's GnuLib
 #endif
+#include <gnc-optiondb.hpp>
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
diff --git a/gnucash/report/gnc-report.h b/gnucash/report/gnc-report.h
index 4fc4720db..b227616c6 100644
--- a/gnucash/report/gnc-report.h
+++ b/gnucash/report/gnc-report.h
@@ -28,7 +28,6 @@
 #include <glib.h>
 #include <libguile.h>
 #ifdef __cplusplus
-#include "gnc-optiondb.hpp"
 extern "C"
 {
 #endif



Summary of changes:
 CMakeLists.txt                              |  2 +-
 bindings/engine.i                           |  2 --
 bindings/guile/gnc-engine-guile.cpp         |  2 +-
 bindings/guile/gnc-optiondb.i               | 24 +++++++++++++++++++-----
 gnucash/gnome-utils/dialog-options.cpp      |  8 ++++----
 gnucash/gnome-utils/dialog-options.hpp      |  2 ++
 gnucash/gnome-utils/gnc-main-window.cpp     |  4 ++--
 gnucash/gnome-utils/gnc-option-gtk-ui.cpp   | 10 +++++++++-
 gnucash/gnome-utils/gnc-option-gtk-ui.hpp   |  2 +-
 gnucash/gnome/assistant-hierarchy.cpp       |  6 +++---
 gnucash/gnome/dialog-report-column-view.cpp |  6 +++---
 gnucash/gnome/dialog-report-style-sheet.cpp |  6 +++---
 gnucash/gnome/gnc-plugin-page-report.cpp    |  4 ++--
 gnucash/gnome/window-report.cpp             |  6 +++---
 gnucash/gnucash-commands.cpp                |  1 +
 gnucash/report/gnc-report.cpp               |  1 +
 gnucash/report/gnc-report.h                 |  1 -
 libgnucash/app-utils/CMakeLists.txt         |  2 +-
 18 files changed, 56 insertions(+), 33 deletions(-)



More information about the gnucash-changes mailing list