From: yoe Date: Fri, 26 Oct 2007 20:17:54 +0000 (+0000) Subject: r299: Make -Werror work again X-Git-Url: http://git.alex.org.uk r299: Make -Werror work again --- diff --git a/configure.ac b/configure.ac index 3ebb983..350166a 100644 --- a/configure.ac +++ b/configure.ac @@ -109,8 +109,13 @@ AC_TRY_COMPILE([#define u32 int #define __be32 int #define __be64 int #include "nbd.h" +#ifdef __GNUC__ +#define UNUSED __attribute__((__unused__)) +#else +#define UNUSED +#endif ], -[int foo=NBD_CMD_DISC], +[int UNUSED foo=NBD_CMD_DISC], [AC_DEFINE(NBD_H_LOCAL, 1, Set to 1 if a (2.6) nbd.h can be found in the current directory) NBD_H='"nbd.h"'], AC_TRY_COMPILE([#define u32 int @@ -118,13 +123,23 @@ AC_TRY_COMPILE([#define u32 int #define __be32 int #define __be64 int #include +#ifdef __GNUC__ +#define UNUSED __attribute__((__unused__)) +#else +#define UNUSED +#endif ], -[int foo=NBD_CMD_DISC], +[int UNUSED foo=NBD_CMD_DISC], [AC_DEFINE(NBD_H_LINUX, 1, Set to 1 if a (2.6) nbd.h can be found in the linux directory in the search path) NBD_H=''], AC_TRY_COMPILE([#include +#ifdef __GNUC__ +#define UNUSED __attribute__((__unused__)) +#else +#define UNUSED +#endif ], - [int foo=NBD_CMD_DISC], + [int UNUSED foo=NBD_CMD_DISC], [AC_DEFINE(NBD_H_LINUX, 1, Set to 1 if a (2.6) nbd.h can be found in the linux directory in the search path) NBD_H=''], AC_MSG_ERROR(Could not find an nbd.h from 2.6 or above.)