summaryrefslogtreecommitdiff
path: root/popt
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-06-09 21:41:21 +0000
committerWayne Davison <wayned@samba.org>2004-06-09 21:41:21 +0000
commit73042aae5b0ba34286a425d313806def79d891d7 (patch)
treedc7d86a287ea911dc657c6f40a91b1e9ca975006 /popt
parente5ce3bcf2c4d26d70c245a4f3a4a87da2b254321 (diff)
downloadrsync-73042aae5b0ba34286a425d313806def79d891d7.tar.gz
Restore UNUSED() macro (the prior problems that prompted me to remove
it appear to have been a build-farm bug).
Diffstat (limited to 'popt')
-rw-r--r--popt/popt.c2
-rw-r--r--popt/poptconfig.c2
-rw-r--r--popt/popthelp.c12
-rw-r--r--popt/system.h10
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 <unistd.h>
#endif
+#if !defined(__GNUC__) || defined(APPLE)
+/* Apparently the OS X port of gcc gags on __attribute__.
+ *
+ * <http://www.opensource.apple.com/bugs/X/gcc/2512150.html> */
+#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"