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 15, 2024
1 parent d89233a commit f36e7e5
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 @@ -78,6 +78,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) {

switch(value.type()) {
Expand Down

0 comments on commit f36e7e5

Please sign in to comment.