1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

callbacks: Add support for MSVC

__typeof__ is GCC specific

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2016-11-05 20:00:02 +01:00
parent 422271bd40
commit 5437deed1b
4 changed files with 22 additions and 15 deletions

View File

@@ -487,14 +487,12 @@ typedef struct ssh_socket_callbacks_struct *ssh_socket_callbacks;
do { \
struct ssh_iterator *_cb_i = ssh_list_get_iterator(_cb_list); \
_cb_type _cb; \
__typeof__(_cb->_cb_name) _cb_p; \
for (; _cb_i != NULL; _cb_i = _cb_i->next) { \
_cb = ssh_iterator_value(_cb_type, _cb_i); \
if (ssh_callbacks_exists(_cb, _cb_name) && \
(_cb_p = _cb->_cb_name))
if (ssh_callbacks_exists(_cb, _cb_name))
#define ssh_callbacks_iterate_exec(...) \
_cb_p(__VA_ARGS__, _cb->userdata)
#define ssh_callbacks_iterate_exec(_cb_name, ...) \
_cb->_cb_name(__VA_ARGS__, _cb->userdata)
#define ssh_callbacks_iterate_end() \
} \