Restore UNUSED() macro (the prior problems that prompted me to remove
authorWayne Davison <wayned@samba.org>
Wed, 9 Jun 2004 21:41:21 +0000 (21:41 +0000)
committerWayne Davison <wayned@samba.org>
Wed, 9 Jun 2004 21:41:21 +0000 (21:41 +0000)
it appear to have been a build-farm bug).

popt/popt.c
popt/poptconfig.c
popt/popthelp.c
popt/system.h

index a75086d..c389b2e 100644 (file)
@@ -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));
index 177e972..5023566 100644 (file)
@@ -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;
index 1ddb895..154e2c5 100644 (file)
@@ -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;
 
index fc2f0d4..02f05c1 100644 (file)
 #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"