From 73042aae5b0ba34286a425d313806def79d891d7 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 9 Jun 2004 21:41:21 +0000 Subject: [PATCH] Restore UNUSED() macro (the prior problems that prompted me to remove it appear to have been a build-farm bug). --- popt/popt.c | 2 +- popt/poptconfig.c | 2 +- popt/popthelp.c | 12 ++++++------ popt/system.h | 10 ++++++++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/popt/popt.c b/popt/popt.c index a75086d1..c389b2ee 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -1055,7 +1055,7 @@ poptContext poptFreeContext(poptContext con) } int poptAddAlias(poptContext con, struct poptAlias alias, - /*@unused@*/ int flags) + /*@unused@*/ UNUSED(int flags)) { poptItem item = (poptItem) alloca(sizeof(*item)); memset(item, 0, sizeof(*item)); diff --git a/popt/poptconfig.c b/popt/poptconfig.c index 177e9724..50235661 100644 --- a/popt/poptconfig.c +++ b/popt/poptconfig.c @@ -159,7 +159,7 @@ int poptReadConfigFile(poptContext con, const char * fn) return 0; } -int poptReadDefaultConfig(poptContext con, /*@unused@*/ int useEnv) +int poptReadDefaultConfig(poptContext con, /*@unused@*/ UNUSED(int useEnv)) { char * fn, * home; int rc; diff --git a/popt/popthelp.c b/popt/popthelp.c index 1ddb895c..154e2c5a 100644 --- a/popt/popthelp.c +++ b/popt/popthelp.c @@ -17,9 +17,9 @@ * @param key option(s) */ static void displayArgs(poptContext con, - /*@unused@*/ enum poptCallbackReason foo, + /*@unused@*/ UNUSED(enum poptCallbackReason foo), struct poptOption * key, - /*@unused@*/ const char * arg, /*@unused@*/ void * data) + /*@unused@*/ UNUSED(const char * arg), /*@unused@*/ UNUSED(void * data)) /*@globals fileSystem@*/ /*@modifies fileSystem@*/ { @@ -63,7 +63,7 @@ struct poptOption poptHelpOptions[] = { /** * @param table option(s) */ -/*@observer@*/ /*@null@*/ static const char *const +/*@observer@*/ /*@null@*/ static const char * getTableTranslationDomain(/*@null@*/ const struct poptOption *table) /*@*/ { @@ -81,7 +81,7 @@ getTableTranslationDomain(/*@null@*/ const struct poptOption *table) * @param opt option(s) * @param translation_domain translation domain */ -/*@observer@*/ /*@null@*/ static const char *const +/*@observer@*/ /*@null@*/ static const char * getArgDescrip(const struct poptOption * opt, /*@-paramuse@*/ /* FIX: wazzup? */ /*@null@*/ const char * translation_domain) @@ -475,7 +475,7 @@ static int showHelpIntro(poptContext con, FILE * fp) return len; } -void poptPrintHelp(poptContext con, FILE * fp, /*@unused@*/ int flags) +void poptPrintHelp(poptContext con, FILE * fp, /*@unused@*/ UNUSED(int flags)) { int leftColWidth; @@ -634,7 +634,7 @@ static int showShortOptions(const struct poptOption * opt, FILE * fp, return strlen(s) + 4; } -void poptPrintUsage(poptContext con, FILE * fp, /*@unused@*/ int flags) +void poptPrintUsage(poptContext con, FILE * fp, /*@unused@*/ UNUSED(int flags)) { int cursor; diff --git a/popt/system.h b/popt/system.h index fc2f0d4c..02f05c18 100644 --- a/popt/system.h +++ b/popt/system.h @@ -19,6 +19,14 @@ #include #endif +#if !defined(__GNUC__) || defined(APPLE) +/* Apparently the OS X port of gcc gags on __attribute__. + * + * */ +#define __attribute__(x) + +#endif + #ifdef __NeXT /* access macros are not declared in non posix mode in unistd.h - don't try to use posix on NeXTstep 3.3 ! */ @@ -69,4 +77,6 @@ char *alloca (); #define xstrdup(_str) strdup(_str) #endif /* HAVE_MCHECK_H && defined(__GNUC__) */ +#define UNUSED(x) x __attribute__((__unused__)) + #include "popt.h" -- 2.34.1