For a macro of the form:
#define CHR(ch1,ch2,ch3,ch4) (((ch1)<<24)|((ch2)<<16)|((ch3)<<8)|(ch4))
#define DEFAULT_LANG CHR('d','f','l','t')
swig generate:
SWIG_Python_SetConstant(d, "DEFAULT_LANG",SWIG_From_int((int)((((d) <<
24)|((f) << 16)|((l) << 8)|(t)))));
error: invalid operands to binary << (have ‘struct PyObject *’ and ‘int’)
error: ‘f’ undeclared (first use in this function)
note: each undeclared identifier is reported only once for each function it appears in
error: ‘l’ undeclared (first use in this function)
error: ‘t’ undeclared (first use in this function)
This is probably connected to (and perhaps the same as):
https://sourceforge.net/tracker/?func=detail&aid=1474463&group_id=1645&atid=101645
The other bug was fixed last year in 3.0.11, but this case still fails (though in a different way now):
It looks like the issue is actually the parentheses around each character literal - if I remove those, then this works. Testing a fix.
A simpler testcase is:
Works in SWIG 4.0.2 so closing.