Use internal extern "C" { ... } for C++

- removes warnings compiling swig engine
...
[ 10%] Generating swig-engine.cpp
.../libgnucash/engine/engine-helpers.h:31: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gnc-date.h:83: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/qofquery.h:90: Warning 302: Identifier 'QofQuery' redefined (ignored),
.../libgnucash/engine/gnc-option.hpp:55: Warning 302: previous definition of 'QofQuery'.
.../libgnucash/engine/gnc-commodity.h:56: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncBusiness.h:40: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncEntry.h:37: Warning 313: Unrecognized extern type "C++".
This commit is contained in:
Richard Cohen
2023-01-23 13:57:38 +00:00
parent 062f3fb19d
commit 1cec0cb3f3
319 changed files with 861 additions and 712 deletions

View File

@@ -22,10 +22,6 @@
%{
/* Includes the header in the wrapper code */
#include <glib.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include <config.h>
#include <gnc-euro.h>
#include <gnc-ui-util.h>
@@ -36,18 +32,14 @@ extern "C"
#endif
#include <gnc-accounting-period.h>
#include <gnc-session.h>
#ifdef __cplusplus
}
#endif
%}
#if defined(SWIGGUILE) //Always C++
%{
extern "C"
{
#include "guile-mappings.h"
extern "C"
{
SCM scm_init_sw_app_utils_module (void);
}
%}

View File

@@ -23,11 +23,6 @@
/* Includes the header in the wrapper code */
#include <glib.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include <config.h>
#include "qof.h"
#include "qoflog.h"
@@ -58,9 +53,6 @@ extern "C"
#include "gncTaxTable.h"
#include "gncVendor.h"
#ifdef __cplusplus
}
#endif
%}
#if defined(SWIGGUILE) //Always C++
%{

View File

@@ -28,6 +28,10 @@
#include <glib.h>
#include <libguile.h>
#ifdef __cplusplus
extern "C" {
#endif
SCM gnc_glist_to_scm_list(GList *glist, const gchar *wct);
GList* gnc_scm_list_to_glist(SCM wcp_list);
@@ -37,4 +41,8 @@ int gnc_glist_string_p(SCM list);
GSList * gnc_scm_to_gslist_string(SCM list);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -27,8 +27,7 @@
#include "swig-runtime.h"
#include <libguile.h>
#include <cstring>
extern "C"
{
#include "Account.h"
#include "engine-helpers.h"
#include "gnc-engine-guile.h"
@@ -43,7 +42,6 @@ extern "C"
#ifndef HAVE_STRPTIME
# include "strptime.h"
#endif
}
/** \todo Code dependent on the private query headers
qofquery-p.h and qofquerycore-p.h may need to be modified.

View File

@@ -27,15 +27,15 @@
#include <glib.h>
#include <libguile.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "gnc-engine.h"
#include <gncTaxTable.h> /* for GncAccountValue */
#include "gnc-hooks.h"
#ifdef __cplusplus
extern "C"
{
#endif
/* Helpers for various conversions to and from guile */
GDate gnc_time64_to_GDate(SCM x);

View File

@@ -27,6 +27,10 @@
#include <glib.h>
#include <libguile.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Helper function to get the string representation of
* a guile string.
*
@@ -74,4 +78,8 @@ SCM gnc_scm_call_1_to_vector(SCM func, SCM arg);
* comments. */
gchar *gnc_scm_strip_comments (SCM scm_text);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -28,7 +28,15 @@
#include "gnc-ui-util.h"
#ifdef __cplusplus
extern "C" {
#endif
SCM gnc_printinfo2scm(GNCPrintAmountInfo info);
GNCPrintAmountInfo gnc_scm2printinfo(SCM info_scm);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -3,8 +3,6 @@
#include <libguile.h>
#include <numeric>
extern "C"
{
#include <config.h>
#include <qof.h>
@@ -13,7 +11,6 @@ extern "C"
#include "gnc-engine-guile.h"
#include "gnc-guile-utils.h"
#include "gnc-kvp-guile.h"
}
/* NOTE: There are some problems with this approach. Currently,
* guids are stored simply as strings in scheme, so some

View File

@@ -21,12 +21,13 @@
#ifndef KVP_SCM_H
#define KVP_SCM_H
#include <qof.h>
#include <libguile.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include <qof.h>
#include <libguile.h>
KvpValue* gnc_scm_to_kvp_value_ptr(SCM kvpval);
SCM gnc_kvp_value_ptr_to_scm(KvpValue* val);

View File

@@ -23,15 +23,11 @@
#include <libguile.h>
#include "guile-mappings.h"
extern "C"
{
#include "gnc-engine-guile.h"
#include "test-engine-stuff.h"
#include "test-stuff.h"
#include "Query.h"
#include "TransLog.h"
}
static void
test_query (Query *q, SCM val2str)

View File

@@ -23,15 +23,12 @@
#include "guile-mappings.h"
#include <libguile.h>
extern "C"
{
#include "gnc-engine-guile.h"
#include "gnc-guile-utils.h"
#include "test-engine-stuff.h"
#include "test-stuff.h"
#include "Query.h"
#include "TransLog.h"
}
static void
test_query (Query *q, SCM val2str)

View File

@@ -22,15 +22,12 @@
#include <libguile.h>
#include <glib.h>
extern "C"
{
#include "gnc-engine-guile.h"
#include "test-engine-stuff.h"
#include "test-stuff.h"
#include "Query.h"
#include "TransLog.h"
}
static void
test_query (QofQuery *q)