Fix assertion for some languages when wrapping a C++11 enum class that is private in a class.
Also don't wrap private enums for a few languages that attempted to do so. Closes #594.
This commit is contained in:
parent
a15bbbaee5
commit
1d62790928
10 changed files with 38 additions and 1 deletions
|
|
@ -6,7 +6,13 @@ Version 3.0.9 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
2016-03-31: wsfulton
|
2016-03-31: wsfulton
|
||||||
[Java] unsigned long long marshalling improvements when a negative number
|
Fixes #594. Fix assertion for some languages when wrapping a C++11 enum class that
|
||||||
|
is private in a class.
|
||||||
|
|
||||||
|
Also don't wrap private enums for a few languages that attempted to do so.
|
||||||
|
|
||||||
|
2016-03-31: wsfulton
|
||||||
|
[Java] unsigned long long marshalling improvements when a negative number
|
||||||
is passed from Java to C. A cast to signed long long in the C layer will now
|
is passed from Java to C. A cast to signed long long in the C layer will now
|
||||||
result in the expected value. No change for positive numbers passed to C.
|
result in the expected value. No change for positive numbers passed to C.
|
||||||
Fixes #623.
|
Fixes #623.
|
||||||
|
|
|
||||||
|
|
@ -214,5 +214,12 @@ Enum1 globalTest1(Enum1 e) { return e; }
|
||||||
Class1::Enum12 globalTest2(Class1::Enum12 e) { return e; }
|
Class1::Enum12 globalTest2(Class1::Enum12 e) { return e; }
|
||||||
Class1::Struct1::Enum12 globalTest3(Class1::Struct1::Enum12 e) { return e; }
|
Class1::Struct1::Enum12 globalTest3(Class1::Struct1::Enum12 e) { return e; }
|
||||||
|
|
||||||
|
class PrivateEnumClass {
|
||||||
|
private:
|
||||||
|
enum class Enum {
|
||||||
|
PrivateEnum1,
|
||||||
|
PrivateEnum2
|
||||||
|
};
|
||||||
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3166,6 +3166,9 @@ int ALLEGROCL::enumDeclaration(Node *n) {
|
||||||
Printf(stderr, "enumDeclaration %s\n", Getattr(n, "name"));
|
Printf(stderr, "enumDeclaration %s\n", Getattr(n, "name"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (getCurrentClass() && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
if (Getattr(n, "sym:name")) {
|
if (Getattr(n, "sym:name")) {
|
||||||
add_defined_foreign_type(n);
|
add_defined_foreign_type(n);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -688,6 +688,9 @@ int CFFI::typedefHandler(Node *n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int CFFI::enumDeclaration(Node *n) {
|
int CFFI::enumDeclaration(Node *n) {
|
||||||
|
if (getCurrentClass() && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
String *name = Getattr(n, "sym:name");
|
String *name = Getattr(n, "sym:name");
|
||||||
bool slot_name_keywords;
|
bool slot_name_keywords;
|
||||||
String *lisp_name = 0;
|
String *lisp_name = 0;
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,9 @@ int CLISP::typedefHandler(Node *n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLISP::enumDeclaration(Node *n) {
|
int CLISP::enumDeclaration(Node *n) {
|
||||||
|
if (getCurrentClass() && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
is_function = 0;
|
is_function = 0;
|
||||||
String *name = Getattr(n, "sym:name");
|
String *name = Getattr(n, "sym:name");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2712,6 +2712,9 @@ private:
|
||||||
* ---------------------------------------------------------------------- */
|
* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
virtual int enumDeclaration(Node *n) {
|
virtual int enumDeclaration(Node *n) {
|
||||||
|
if (getCurrentClass() && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
String *name = goEnumName(n);
|
String *name = goEnumName(n);
|
||||||
if (Strcmp(name, "int") != 0) {
|
if (Strcmp(name, "int") != 0) {
|
||||||
if (!ImportMode || !imported_package) {
|
if (!ImportMode || !imported_package) {
|
||||||
|
|
|
||||||
|
|
@ -1649,6 +1649,9 @@ int Language::externDeclaration(Node *n) {
|
||||||
* ---------------------------------------------------------------------- */
|
* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
int Language::enumDeclaration(Node *n) {
|
int Language::enumDeclaration(Node *n) {
|
||||||
|
if (CurrentClass && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
String *oldNSpace = NSpace;
|
String *oldNSpace = NSpace;
|
||||||
NSpace = Getattr(n, "sym:nspace");
|
NSpace = Getattr(n, "sym:nspace");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1157,6 +1157,9 @@ public:
|
||||||
* ------------------------------------------------------------ */
|
* ------------------------------------------------------------ */
|
||||||
|
|
||||||
virtual int enumDeclaration(Node *n) {
|
virtual int enumDeclaration(Node *n) {
|
||||||
|
if (getCurrentClass() && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
current[STATIC_CONST] = true;
|
current[STATIC_CONST] = true;
|
||||||
current[ENUM_CONST] = true;
|
current[ENUM_CONST] = true;
|
||||||
// There is some slightly specific behaviour with enums. Basically,
|
// There is some slightly specific behaviour with enums. Basically,
|
||||||
|
|
|
||||||
|
|
@ -1287,6 +1287,9 @@ public:
|
||||||
* typedef enum and enum are handled. I need to produce consistent names,
|
* typedef enum and enum are handled. I need to produce consistent names,
|
||||||
* which means looking up and registering by typedef and enum name. */
|
* which means looking up and registering by typedef and enum name. */
|
||||||
int enumDeclaration(Node *n) {
|
int enumDeclaration(Node *n) {
|
||||||
|
if (getCurrentClass() && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
String *name = Getattr(n, "name");
|
String *name = Getattr(n, "name");
|
||||||
if (name) {
|
if (name) {
|
||||||
String *oname = NewString(name);
|
String *oname = NewString(name);
|
||||||
|
|
|
||||||
|
|
@ -1179,6 +1179,9 @@ int R::OutputArrayMethod(String *className, List *el, File *out) {
|
||||||
tdname is the typedef of the enumeration, i.e. giving its name.
|
tdname is the typedef of the enumeration, i.e. giving its name.
|
||||||
*************************************************************/
|
*************************************************************/
|
||||||
int R::enumDeclaration(Node *n) {
|
int R::enumDeclaration(Node *n) {
|
||||||
|
if (getCurrentClass() && (cplus_mode != PUBLIC))
|
||||||
|
return SWIG_NOWRAP;
|
||||||
|
|
||||||
String *name = Getattr(n, "name");
|
String *name = Getattr(n, "name");
|
||||||
String *tdname = Getattr(n, "tdname");
|
String *tdname = Getattr(n, "tdname");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue