Permalink
Browse files

test: fix compiation warning

-Wunused-function would kick in because of the close_loop function,
but there tests and benchmarks which actually don't use any loop.
  • Loading branch information...
saghul committed Mar 3, 2014
1 parent b05a3ee commit 0e591368237396106e9a1cd149e03de9d2d9f5b9
Showing with 10 additions and 1 deletion.
  1. +10 −1 test/task.h
View
@@ -209,13 +209,22 @@ static int snprintf(char* buf, size_t len, const char* fmt, ...) {
#endif
+#if defined(__clang__) || \
+ defined(__GNUC__) || \
+ defined(__INTEL_COMPILER) || \
+ defined(__SUNPRO_C)
+# define UNUSED __attribute__((unused))
+#else
+# define UNUSED
+#endif
+
/* Fully close a loop */
static void close_walk_cb(uv_handle_t* handle, void* arg) {
if (!uv_is_closing(handle))
uv_close(handle, NULL);
}
-static void close_loop(uv_loop_t* loop) {
+UNUSED static void close_loop(uv_loop_t* loop) {
uv_walk(loop, close_walk_cb, NULL);
uv_run(loop, UV_RUN_DEFAULT);
}

0 comments on commit 0e59136

Please sign in to comment.