Skip to content

Commit 19cf03e

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

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
@@ -1891,8 +1891,13 @@ PyObject* meth_get_device_settings(PyObject* self, PyObject* args)
18911891
}
18921892
// int _stdcall icsneoGetDeviceSettingsType(void* hObject, EPlasmaIonVnetChannel_t vnetSlot, EDeviceSettingsType* pDeviceSettingsType)
18931893
ice::Function<int __stdcall (ICS_HANDLE, EPlasmaIonVnetChannel_t, EDeviceSettingsType*)> icsneoGetDeviceSettingsType(lib, "icsneoGetDeviceSettingsType");
1894+
#if VSPY3_BUILD_VERSION <= 803
18941895
// int _stdcall icsneoGetDeviceSettings(void* hObject, SDeviceSettings* pSettings, EPlasmaIonVnetChannel_t vnetSlot)
18951896
ice::Function<int __stdcall (ICS_HANDLE, SDeviceSettings*, EPlasmaIonVnetChannel_t)> icsneoGetDeviceSettings(lib, "icsneoGetDeviceSettings");
1897+
#else
1898+
// int _stdcall icsneoGetDeviceSettings(void* hObject, SDeviceSettings* pSettings, int iNumBytes, EPlasmaIonVnetChannel_t vnetSlot)
1899+
ice::Function<int __stdcall (ICS_HANDLE, SDeviceSettings*, int, EPlasmaIonVnetChannel_t)> icsneoGetDeviceSettings(lib, "icsneoGetDeviceSettings");
1900+
#endif
18961901
PyObject* settings = PyObject_CallObject((PyObject*)&device_settings_object_type, NULL);
18971902
SDeviceSettings* s = &((device_settings_object*)settings)->s;
18981903
Py_BEGIN_ALLOW_THREADS
@@ -1901,7 +1906,11 @@ PyObject* meth_get_device_settings(PyObject* self, PyObject* args)
19011906
Py_BLOCK_THREADS
19021907
return set_ics_exception(exception_runtime_error(), "icsneoGetDeviceSettingsType() Failed");
19031908
}
1909+
#if VSPY3_BUILD_VERSION <= 803
19041910
if (!icsneoGetDeviceSettings(handle, s, vnet_slot))
1911+
#else
1912+
if (!icsneoGetDeviceSettings(handle, s, sizeof(s), vnet_slot))
1913+
#endif
19051914
{
19061915
Py_BLOCK_THREADS
19071916
return set_ics_exception(exception_runtime_error(), "icsneoGetDeviceSettings() Failed");

0 commit comments

Comments
 (0)