Refactoring __attribute__((unused)).

This commit is contained in:
Alex Shinn 2012-01-05 14:19:30 +09:00
parent 663f34000c
commit 380a551f43
2 changed files with 7 additions and 6 deletions

7
gc.c
View file

@ -435,12 +435,7 @@ void sexp_mark_global_symbols(sexp ctx) {
#endif
sexp sexp_gc (sexp ctx, size_t *sum_freed) {
sexp res;
#ifdef __GNUC__
sexp finalized __attribute__((unused));
#else
sexp finalized;
#endif
sexp res, finalized SEXP_NO_WARN_UNUSED;
sexp_debug_printf("%p (heap: %p size: %lu)", ctx, sexp_context_heap(ctx),
sexp_heap_total_size(sexp_context_heap(ctx)));
sexp_mark_global_symbols(ctx);

View file

@ -45,6 +45,12 @@ extern "C" {
#define sexp_out_of_file_descriptors() (0)
#endif
#ifdef __GNUC__
#define SEXP_NO_WARN_UNUSED __attribute__((unused))
#else
#define SEXP_NO_WARN_UNUSED
#endif
#ifdef PLAN9
#include <u.h>
#include <libc.h>