Skip to content

Commit 1b624e4

Browse files
Added checks for v804/v900 icsneoGetDeviceSettings() breaking change.
Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
1 parent c66036b commit 1b624e4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/methods.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,8 +1894,13 @@ PyObject* meth_get_device_settings(PyObject* self, PyObject* args)
18941894
}
18951895
// int _stdcall icsneoGetDeviceSettingsType(void* hObject, EPlasmaIonVnetChannel_t vnetSlot, EDeviceSettingsType* pDeviceSettingsType)
18961896
ice::Function<int __stdcall (ICS_HANDLE, EPlasmaIonVnetChannel_t, EDeviceSettingsType*)> icsneoGetDeviceSettingsType(lib, "icsneoGetDeviceSettingsType");
1897+
#if VSPY3_BUILD_VERSION <= 803
18971898
// int _stdcall icsneoGetDeviceSettings(void* hObject, SDeviceSettings* pSettings, EPlasmaIonVnetChannel_t vnetSlot)
18981899
ice::Function<int __stdcall (ICS_HANDLE, SDeviceSettings*, EPlasmaIonVnetChannel_t)> icsneoGetDeviceSettings(lib, "icsneoGetDeviceSettings");
1900+
#else
1901+
// int _stdcall icsneoGetDeviceSettings(void* hObject, SDeviceSettings* pSettings, int iNumBytes, EPlasmaIonVnetChannel_t vnetSlot)
1902+
ice::Function<int __stdcall (ICS_HANDLE, SDeviceSettings*, int, EPlasmaIonVnetChannel_t)> icsneoGetDeviceSettings(lib, "icsneoGetDeviceSettings");
1903+
#endif
18991904
PyObject* settings = PyObject_CallObject((PyObject*)&device_settings_object_type, NULL);
19001905
SDeviceSettings* s = &((device_settings_object*)settings)->s;
19011906
Py_BEGIN_ALLOW_THREADS
@@ -1904,7 +1909,11 @@ PyObject* meth_get_device_settings(PyObject* self, PyObject* args)
19041909
Py_BLOCK_THREADS
19051910
return set_ics_exception(exception_runtime_error(), "icsneoGetDeviceSettingsType() Failed");
19061911
}
1912+
#if VSPY3_BUILD_VERSION <= 803
19071913
if (!icsneoGetDeviceSettings(handle, s, vnet_slot))
1914+
#else
1915+
if (!icsneoGetDeviceSettings(handle, s, sizeof(s), vnet_slot))
1916+
#endif
19081917
{
19091918
Py_BLOCK_THREADS
19101919
return set_ics_exception(exception_runtime_error(), "icsneoGetDeviceSettings() Failed");

0 commit comments

Comments
 (0)