Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
test: fix compiation warning
Browse files Browse the repository at this point in the history
-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 0e59136
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/task.h
Expand Up @@ -209,13 +209,22 @@ static int snprintf(char* buf, size_t len, const char* fmt, ...) {


#endif #endif


#if defined(__clang__) || \
defined(__GNUC__) || \
defined(__INTEL_COMPILER) || \
defined(__SUNPRO_C)
# define UNUSED __attribute__((unused))
#else
# define UNUSED
#endif

/* Fully close a loop */ /* Fully close a loop */
static void close_walk_cb(uv_handle_t* handle, void* arg) { static void close_walk_cb(uv_handle_t* handle, void* arg) {
if (!uv_is_closing(handle)) if (!uv_is_closing(handle))
uv_close(handle, NULL); 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_walk(loop, close_walk_cb, NULL);
uv_run(loop, UV_RUN_DEFAULT); uv_run(loop, UV_RUN_DEFAULT);
} }
Expand Down

0 comments on commit 0e59136

Please sign in to comment.