Skip to content

Commit

Permalink
Add PTHREAD_UNUSED
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Dec 18, 2015
1 parent c25d762 commit 4881a8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 10 additions & 2 deletions src/include/libradius.h
Expand Up @@ -132,11 +132,19 @@ typedef void (*sig_t)(int);
#define PRINTF_LIKE(n) CC_HINT(format(printf, n, n+1))
#define NEVER_RETURNS CC_HINT(noreturn)
#define UNUSED CC_HINT(unused)

#ifndef NDEBUG
#define NDEBUG_UNUSED
# define NDEBUG_UNUSED
#else
#define NDEBUG_UNUSED UNUSED
# define NDEBUG_UNUSED UNUSED
#endif

#ifdef HAVE_PTHREAD_H
# define PTHREAD_UNUSED
#else
# define PTHREAD_UNUSED UNUSED
#endif

#define BLANK_FORMAT " " /* GCC_LINT whines about empty formats */

/*
Expand Down
6 changes: 1 addition & 5 deletions src/lib/rbtree.c
Expand Up @@ -110,11 +110,7 @@ void rbtree_free(rbtree_t *tree)
talloc_unlink(tree, tree->parent);
}

#ifdef HAVE_PTHREAD_H
static int _rbtree_free(rbtree_t *tree)
#else
static int _rbtree_free(UNUSED rbtree_t *tree)
#endif
static int _rbtree_free(PTHREAD_UNUSED rbtree_t *tree)
{
#ifdef HAVE_PTHREAD_H
if (tree->lock) pthread_mutex_destroy(&tree->mutex);
Expand Down
2 changes: 1 addition & 1 deletion src/main/modules.c
Expand Up @@ -339,7 +339,7 @@ static void module_instance_free_old(UNUSED CONF_SECTION *cs, module_instance_t
}
}

static int _module_instance_free(module_instance_t *instance)
static int _module_instance_free(PTHREAD_UNUSED module_instance_t *instance)
{
#ifdef HAVE_PTHREAD_H
if (instance->mutex) {
Expand Down

0 comments on commit 4881a8d

Please sign in to comment.