Unified · Split
| @@ -1,3 +1,8 @@ | ||
| 1 | +2009-11-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com> | |
| 2 | + | |
| 3 | + * src/common.h | |
| 4 | + Add macro UNUSED for marking function parameters as unused. | |
| 5 | + | |
| 1 | 6 | 2009-10-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 2 | 7 | |
| 3 | 8 | * tests/misc_test.c |
| @@ -46,6 +46,18 @@ typedef long int32_t ; · 45 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | #define MAKE_MAGIC(a,b,c,d,e,f) ((a) + ((b) << 4) + ((c) << 8) + ((d) << 12) + ((e) << 16) + ((f) << 20)) |
| 48 | 48 | |
| 49 | +/* | |
| 50 | +** Inspiration : http://sourcefrog.net/weblog/software/languages/C/unused.html | |
| 51 | +*/ | |
| 52 | +#ifdef UNUSED | |
| 53 | +#elif defined (__GNUC__) | |
| 54 | +# define UNUSED(x) UNUSED_ ## x __attribute__ ((unused)) | |
| 55 | +#elif defined (__LCLINT__) | |
| 56 | +# define UNUSED(x) /*@unused@*/ x | |
| 57 | +#else | |
| 58 | +# define UNUSED(x) x | |
| 59 | +#endif | |
| 60 | + | |
| 49 | 61 | #ifdef __GNUC__ |
| 50 | 62 | # define WARN_UNUSED __attribute__ ((warn_unused_result)) |
| 51 | 63 | #else |