Mercurial > pub > dyncall > bindings
comparison python/pydc/pydcext.c @ 40:1d50532dce12
- added syscall support to shdc
- general cleanup and refactoring
author | Tassilo Philipp |
---|---|
date | Tue, 14 Apr 2020 17:44:04 +0200 |
parents | 8c8f848131c6 |
children | 1086ca649715 |
comparison
equal
deleted
inserted
replaced
39:b6114d9a9a98 | 40:1d50532dce12 |
---|---|
193 ts = PyTuple_Size(args); | 193 ts = PyTuple_Size(args); |
194 | 194 |
195 dcReset(gpCall); | 195 dcReset(gpCall); |
196 dcMode(gpCall, DC_CALL_C_DEFAULT); | 196 dcMode(gpCall, DC_CALL_C_DEFAULT); |
197 | 197 |
198 for (ch = *ptr; ch != '\0' && ch != ')'; ch = *++ptr) | 198 for (ch = *ptr; ch != '\0' && ch != DC_SIGCHAR_ENDARG; ch = *++ptr) |
199 { | 199 { |
200 PyObject* po; | 200 PyObject* po; |
201 | 201 |
202 if (pos > ts) | 202 if (pos > ts) |
203 return PyErr_Format( PyExc_RuntimeError, "expecting more arguments" ); | 203 return PyErr_Format( PyExc_RuntimeError, "expecting more arguments" ); |
211 case DC_SIGCHAR_CC_PREFIX: | 211 case DC_SIGCHAR_CC_PREFIX: |
212 { | 212 { |
213 if(*(ptr+1) != '\0') | 213 if(*(ptr+1) != '\0') |
214 { | 214 { |
215 // @@@ this is easily going out of sync with dyncall, abstract this sigchar->mode lookup somewhere inside dyncall | 215 // @@@ this is easily going out of sync with dyncall, abstract this sigchar->mode lookup somewhere inside dyncall |
216 switch(*++ptr) { | 216 DCint mode = dcGetModeFromCCSigChar(*++ptr); |
217 case DC_SIGCHAR_CC_DEFAULT: dcMode(gpCall, DC_CALL_C_DEFAULT ); break; | 217 if(mode != DC_ERROR_UNSUPPORTED_MODE) |
218 case DC_SIGCHAR_CC_ELLIPSIS: dcMode(gpCall, DC_CALL_C_ELLIPSIS ); break; | 218 dcMode(gpCall, mode); |
219 case DC_SIGCHAR_CC_ELLIPSIS_VARARGS: dcMode(gpCall, DC_CALL_C_ELLIPSIS_VARARGS ); break; | |
220 case DC_SIGCHAR_CC_CDECL: dcMode(gpCall, DC_CALL_C_X86_CDECL ); break; | |
221 case DC_SIGCHAR_CC_STDCALL: dcMode(gpCall, DC_CALL_C_X86_WIN32_STD ); break; | |
222 case DC_SIGCHAR_CC_FASTCALL_MS: dcMode(gpCall, DC_CALL_C_X86_WIN32_FAST_MS ); break; | |
223 case DC_SIGCHAR_CC_FASTCALL_GNU: dcMode(gpCall, DC_CALL_C_X86_WIN32_FAST_GNU); break; | |
224 case DC_SIGCHAR_CC_THISCALL_MS: dcMode(gpCall, DC_CALL_C_X86_WIN32_THIS_MS ); break; | |
225 case DC_SIGCHAR_CC_THISCALL_GNU: dcMode(gpCall, DC_CALL_C_X86_WIN32_THIS_GNU); break; | |
226 case DC_SIGCHAR_CC_ARM_ARM: dcMode(gpCall, DC_CALL_C_ARM_ARM ); break; | |
227 case DC_SIGCHAR_CC_ARM_THUMB: dcMode(gpCall, DC_CALL_C_ARM_THUMB ); break; | |
228 case DC_SIGCHAR_CC_SYSCALL: dcMode(gpCall, DC_CALL_SYS_DEFAULT ); break; | |
229 } | |
230 } | 219 } |
231 --pos; // didn't count as arg | 220 --pos; // didn't count as arg |
232 } | 221 } |
233 break; | 222 break; |
234 | 223 |