X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Flibsigrok-internal.h;h=c2c324c420917d5bb01ef8df268270d120e4cab1;hb=204dd31fa1074a78fbe3bf04208776a4a3615a1c;hp=a2c2bedd8a69830deacdcba94e66c0846a39f363;hpb=fcab496c12b2b94e85513c61513a24dbd9d6698a;p=libsigrok.git diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index a2c2bedd..c2c324c4 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -1660,6 +1660,7 @@ struct sr_serial_dev_inst { struct sr_bt_desc *bt_desc; GSList *bt_source_args; #endif + struct sr_tcp_dev_inst *tcp_dev; }; #endif @@ -1677,17 +1678,20 @@ struct drv_context { /*--- log.c -----------------------------------------------------------------*/ +/* Provide a macro for other source code locations to re-use. */ #if defined(_WIN32) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) /* * On MinGW, we need to specify the gnu_printf format flavor or GCC * will assume non-standard Microsoft printf syntax. */ -SR_PRIV int sr_log(int loglevel, const char *format, ...) - __attribute__((__format__ (__gnu_printf__, 2, 3))); +#define ATTR_FMT_PRINTF(fmt_pos, arg_pos) \ + __attribute__((__format__ (__gnu_printf__, fmt_pos, arg_pos))) #else -SR_PRIV int sr_log(int loglevel, const char *format, ...) G_GNUC_PRINTF(2, 3); +#define ATTR_FMT_PRINTF(fmt_pos, arg_pos) G_GNUC_PRINTF(fmt_pos, arg_pos) #endif +SR_PRIV int sr_log(int loglevel, const char *format, ...) ATTR_FMT_PRINTF(2, 3); + /* Message logging helpers with subsystem-specific prefix string. */ #define sr_spew(...) sr_log(SR_LOG_SPEW, LOG_PREFIX ": " __VA_ARGS__) #define sr_dbg(...) sr_log(SR_LOG_DBG, LOG_PREFIX ": " __VA_ARGS__) @@ -2119,6 +2123,8 @@ SR_PRIV int ser_name_is_hid(struct sr_serial_dev_inst *serial); extern SR_PRIV struct ser_lib_functions *ser_lib_funcs_hid; SR_PRIV int ser_name_is_bt(struct sr_serial_dev_inst *serial); extern SR_PRIV struct ser_lib_functions *ser_lib_funcs_bt; +SR_PRIV int ser_name_is_tcpraw(struct sr_serial_dev_inst *serial); +extern SR_PRIV struct ser_lib_functions *ser_lib_funcs_tcpraw; #ifdef HAVE_LIBHIDAPI struct vid_pid_item {