Use __attribute__((unused)) when compiling with GCC.
[routeros-api.git] / src / main.c
index 169e39c..d35c30c 100644 (file)
 # define ros_debug(...) /**/
 #endif
 
+#if !__GNUC__
+# define __attribute__(x) /**/
+#endif
+
 /* FIXME */
 char *strdup (const char *);
 
@@ -112,7 +116,7 @@ static int read_exact (int fd, void *buffer, size_t buffer_size) /* {{{ */
                                return (status);
                }
 
-               assert (status <= want_bytes);
+               assert (((size_t) status) <= want_bytes);
                have_bytes += status;
                buffer_ptr += status;
        }
@@ -389,7 +393,7 @@ static int send_command (ros_connection_t *c, /* {{{ */
                        else
                                return (errno);
                }
-               assert (bytes_written <= buffer_size);
+               assert (((size_t) bytes_written) <= buffer_size);
 
                buffer_ptr += bytes_written;
                buffer_size -= bytes_written;
@@ -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);