Make VIO_METHOD_HAS_FUNC macro more robust.

This commit is contained in:
Klaas Freitag 2013-03-26 12:35:35 +01:00
parent 5951039894
commit 5e0e42baaf

View file

@ -30,8 +30,8 @@
#include "vio/csync_vio_handle.h"
#define VIO_METHOD_HAS_FUNC(method,func) \
(((size_t)(((char *)&((method)->func)) - ((char *)(method))) < (method)->method_table_size) \
&& method->func != NULL)
(method != NULL && method->func != NULL \
&& ((size_t)(((char *)&((method)->func)) - ((char *)(method))) < (method)->method_table_size))
typedef struct csync_vio_method_s csync_vio_method_t;