Skip to content

Commit

Permalink
Forward declaration works
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed May 13, 2024
1 parent b0be586 commit ed00d8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/utilities/core/CommonImport.i
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
#include <boost/regex.hpp>
#include <boost/variant.hpp>
#include <pugixml.hpp>

#if defined SWIGRUBY
extern "C" {
#ifdef HAVE_RUBY_ENCODING_H
#include "ruby/encoding.h"
#endif

rb_encoding *rb_utf8_encoding(void);
ID rb_intern3(const char *name, long len, rb_encoding *enc);
}
#endif
%}

%include <utilities/core/Deprecated.hpp>
Expand Down
9 changes: 9 additions & 0 deletions src/utilities/core/jsoncpp.i
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@

%fragment("JsonToDict","header", fragment="SWIG_FromCharPtrAndSize") {

extern "C" {
struct OnigEncodingTypeST;
typedef struct OnigEncodingTypeST OnigEncodingType;
typedef const OnigEncodingType rb_encoding;

rb_encoding *rb_utf8_encoding(void);
ID rb_intern3(const char *name, long len, rb_encoding *enc);
}

SWIGINTERN VALUE SWIG_From_JsonValue(const Json::Value& value) {

if (value.isNull()) {
Expand Down

0 comments on commit ed00d8d

Please sign in to comment.