Author: sayer
Date: 2010-02-25 13:56:26 +0100 (Thu, 25 Feb 2010)
New Revision: 1633
Modified:
trunk/apps/py_sems/PySems.cpp
trunk/apps/py_sems/sip/string.sip
Log:
use sipForceConvertToType for newer sip4 wrapper generator versions (>= 4.9.1)
Modified: trunk/apps/py_sems/PySems.cpp
===================================================================
--- trunk/apps/py_sems/PySems.cpp 2010-02-25 11:14:13 UTC (rev 1632)
+++ trunk/apps/py_sems/PySems.cpp 2010-02-25 12:56:26 UTC (rev 1633)
@@ -32,12 +32,21 @@
#include "PySemsDialog.h"
#include "PySemsB2BDialog.h"
+#include "PySemsB2ABDialog.h"
#include "PySemsUtils.h"
+#include <sip.h>
#include "sip/sipAPIpy_sems_lib.h"
+
+#if SIP_VERSION < 0x040901
+#define SIP_USE_OLD_CLASS_CONVERSION 1
+#endif
+
+#ifdef SIP_USE_OLD_CLASS_CONVERSION
#include "sip/sippy_sems_libPySemsDialog.h"
#include "sip/sippy_sems_libPySemsB2BDialog.h"
#include "sip/sippy_sems_libPySemsB2ABDialog.h"
+#endif
#include <unistd.h>
#include <pthread.h>
@@ -268,21 +277,33 @@
}; break;
case PySemsScriptDesc::Dialog: {
PySemsDialog* dlg = (PySemsDialog*)
+#ifdef SIP_USE_OLD_CLASS_CONVERSION
sipForceConvertTo_PySemsDialog(dlg_inst,&err);
+#else
+ sipForceConvertToType(dlg_inst, sipType_PySemsDialog, NULL,
SIP_NO_CONVERTORS, NULL, &err);
+#endif
sess = dlg;
dlg_base = dlg;
}; break;
case PySemsScriptDesc::B2BDialog: {
PySemsB2BDialog* b2b_dlg = (PySemsB2BDialog*)
+#ifdef SIP_USE_OLD_CLASS_CONVERSION
sipForceConvertTo_PySemsB2BDialog(dlg_inst,&err);
+#else
+ sipForceConvertToType(dlg_inst, sipType_PySemsB2BDialog, NULL,
SIP_NO_CONVERTORS, NULL, &err);
+#endif
sess = b2b_dlg;
dlg_base = b2b_dlg;
}; break;
case PySemsScriptDesc::B2ABDialog: {
PySemsB2ABDialog* b2ab_dlg = (PySemsB2ABDialog*)
- sipForceConvertTo_PySemsB2ABDialog(dlg_inst,&err);
+#ifdef SIP_USE_OLD_CLASS_CONVERSION
+ sipForceConvertTo_PySemsB2ABDialog(dlg_inst,&err);
+#else
+ sipForceConvertToType(dlg_inst, sipType_PySemsB2ABDialog, NULL,
SIP_NO_CONVERTORS, NULL, &err);
+#endif
sess = b2ab_dlg;
dlg_base = b2ab_dlg;
Modified: trunk/apps/py_sems/sip/string.sip
===================================================================
--- trunk/apps/py_sems/sip/string.sip 2010-02-25 11:14:13 UTC (rev 1632)
+++ trunk/apps/py_sems/sip/string.sip 2010-02-25 12:56:26 UTC (rev 1633)
@@ -22,7 +22,11 @@
*sipCppPtr = new std::string(PyString_AS_STRING(sipPy));
return 0;
}
- *sipCppPtr = (std::string *)sipForceConvertTo_string(sipPy,sipIsErr);
+#if SIP_VERSION < 0x040901
+ *sipCppPtr = (std::string *)sipForceConvertToType(sipPy,
sipType_string, NULL, SIP_NO_CONVERTORS, NULL, sipIsErr);
+#else
+ *sipCppPtr = (std::string *)sipForceConvertToType(sipPy,
sipType_string, NULL, SIP_NO_CONVERTORS, NULL, sipIsErr);
+#endif
return 1;
%End
};
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev