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

Commit

Permalink
Rename __unused to UV__UNUSED.
Browse files Browse the repository at this point in the history
__unused is - contrary to its name - used in glibc.

The ANSI/ISO standards reserve all identifiers starting with two underscores so
it's generally a good idea not to use those.
  • Loading branch information
bnoordhuis committed Apr 3, 2012
1 parent 8895c9e commit effa3b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/uv-private/tree.h
Expand Up @@ -26,11 +26,11 @@
#ifndef UV_TREE_H_
#define UV_TREE_H_

#ifndef __unused
#ifndef UV__UNUSED
# if __GNUC__
# define __unused __attribute__((unused))
# define UV__UNUSED __attribute__((unused))
# else
# define __unused
# define UV__UNUSED
# endif
#endif

Expand Down Expand Up @@ -383,7 +383,7 @@ struct { \
#define RB_PROTOTYPE(name, type, field, cmp) \
RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static)
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
Expand All @@ -402,7 +402,7 @@ attr struct type *name##_RB_MINMAX(struct name *, int); \
#define RB_GENERATE(name, type, field, cmp) \
RB_GENERATE_INTERNAL(name, type, field, cmp,)
#define RB_GENERATE_STATIC(name, type, field, cmp) \
RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static)
RB_GENERATE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \
attr void \
name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
Expand Down

0 comments on commit effa3b6

Please sign in to comment.