Details
Description
If a constant is defined in header wrapped by shiboken, it results in a build error.
Example :
suppose global.h includes an header sample.h defined by : sample.h
namespace sample { const double CONSTANT = 1.2345; }
typesystem.xml
<?xml version="1.0"?> <typesystem package="pysample"> <primitive-type name="double"/> <namespace-type name="sample" generate="yes"> </namespace-type> </typesystem>
Shiboken generates :
static PyObject* Sbk_sample_get_CONSTANT(PyObject* self, void*) { ::sample* cppSelf = 0; SBK_UNUSED(cppSelf) if (!Shiboken::Object::isValid(self)) return 0; cppSelf = ; PyObject* pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<double>(), &cppSelf->CONSTANT); return pyOut; }
this code fails at build :
sample_wrapper.cpp: In function ‘PyObject*
Sbk_sample_get_CONSTANT(PyObject*, void*)’:
sample_wrapper.cpp:609:13: erreur: expected primary-expression before ‘*’
token
sample_wrapper.cpp:609:15: erreur: ‘cppSelf’ was not declared in this scope
sample_wrapper.cpp:613:15: erreur: expected primary-expression before ‘;’
token
make[2]: ***
[pysample/CMakeFiles/pysample.dir/pysample/sample_wrapper.cpp.o] Erreur 1
make[1]: *** [pysample/CMakeFiles/pysample.dir/all] Erreur 2
make: *** [all] Erreur 2
It seems that shiboken considers the constant as a function without name
Attachments
Issue Links
- relates to
-
PYSIDE-323 Build Pyside2 against Qt 5.7 and higher
- Closed