From: Florian Forster Date: Fri, 18 Dec 2009 10:52:57 +0000 (+0100) Subject: Use __attribute__((unused)) when compiling with GCC. X-Git-Tag: librouteros-1.0.1~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8c609b7cc4cf4adb1d256ee34d07f1ccb385ba03;p=routeros-api.git Use __attribute__((unused)) when compiling with GCC. This avoids a couple of compiler warnings. --- diff --git a/src/main.c b/src/main.c index d492b48..d35c30c 100644 --- a/src/main.c +++ b/src/main.c @@ -52,6 +52,10 @@ # define ros_debug(...) /**/ #endif +#if !__GNUC__ +# define __attribute__(x) /**/ +#endif + /* FIXME */ char *strdup (const char *); @@ -635,8 +639,9 @@ static int create_socket (const char *node, const char *service) /* {{{ */ return (-1); } /* }}} int create_socket */ -static int login2_handler (ros_connection_t *c, const ros_reply_t *r, /* {{{ */ - void *user_data) +static int login2_handler (__attribute__((unused)) ros_connection_t *c, /* {{{ */ + const ros_reply_t *r, + __attribute__((unused)) void *user_data) { if (r == NULL) return (EINVAL); diff --git a/src/ros.c b/src/ros.c index b7934df..6afc65c 100644 --- a/src/ros.c +++ b/src/ros.c @@ -36,6 +36,10 @@ #include "routeros_api.h" +#if !__GNUC__ +# define __attribute__(x) /**/ +#endif + static const char *opt_username = "admin"; static int result_handler (ros_connection_t *c, const ros_reply_t *r, /* {{{ */ @@ -104,8 +108,9 @@ static void regtable_dump (const ros_registration_table_t *r) /* {{{ */ regtable_dump (r->next); } /* }}} void regtable_dump */ -static int regtable_handler (ros_connection_t *c, /* {{{ */ - const ros_registration_table_t *r, void *user_data) +static int regtable_handler (__attribute__((unused)) ros_connection_t *c, /* {{{ */ + const ros_registration_table_t *r, + __attribute__((unused)) void *user_data) { regtable_dump (r); return (0); @@ -142,8 +147,9 @@ static void interface_dump (const ros_interface_t *i) /* {{{ */ interface_dump (i->next); } /* }}} void interface_dump */ -static int interface_handler (ros_connection_t *c, /* {{{ */ - const ros_interface_t *i, void *user_data) +static int interface_handler (__attribute__((unused)) ros_connection_t *c, /* {{{ */ + const ros_interface_t *i, + __attribute__((unused)) void *user_data) { interface_dump (i); return (0);