From 820b88c3389b59dce190e6846703c267d7113a63 Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Wed, 30 Sep 2009 05:47:49 +0000 Subject: Make changes such that glusterfs builds with Werror and fix LONG_LONG_MAX definition. Signed-off-by: Anand V. Avati BUG: 289 (glusterfs does not build with Werror) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=289 --- argp-standalone/strcasecmp.c | 1 + argp-standalone/vsnprintf.c | 10 +++++----- booster/src/Makefile.am | 4 ++-- libglusterfs/src/compat.h | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/argp-standalone/strcasecmp.c b/argp-standalone/strcasecmp.c index bcad7a22..9c163723 100644 --- a/argp-standalone/strcasecmp.c +++ b/argp-standalone/strcasecmp.c @@ -8,6 +8,7 @@ */ #include +int strcasecmp(const char *, const char *); int strcasecmp(const char *s1, const char *s2) { diff --git a/argp-standalone/vsnprintf.c b/argp-standalone/vsnprintf.c index e9b5f192..33c9a5d0 100644 --- a/argp-standalone/vsnprintf.c +++ b/argp-standalone/vsnprintf.c @@ -551,7 +551,7 @@ static LDOUBLE abs_val (LDOUBLE value) return result; } -static LDOUBLE pow10 (int exp) +static LDOUBLE pow10_argp (int exp) { LDOUBLE result = 1; @@ -564,7 +564,7 @@ static LDOUBLE pow10 (int exp) return result; } -static long round (LDOUBLE value) +static long round_argp (LDOUBLE value) { long intpart; @@ -626,12 +626,12 @@ static int fmtfp (char *buffer, size_t *currlen, size_t maxlen, /* We "cheat" by converting the fractional part to integer by * multiplying by a factor of 10 */ - fracpart = round ((pow10 (max)) * (ufvalue - intpart)); + fracpart = round_argp ((pow10_argp (max)) * (ufvalue - intpart)); - if (fracpart >= pow10 (max)) + if (fracpart >= pow10_argp (max)) { intpart++; - fracpart -= pow10 (max); + fracpart -= pow10_argp (max); } #ifdef DEBUG_SNPRINTF diff --git a/booster/src/Makefile.am b/booster/src/Makefile.am index 7ecbcd22..d7d83abf 100644 --- a/booster/src/Makefile.am +++ b/booster/src/Makefile.am @@ -3,11 +3,11 @@ ldpreloaddir = $(libdir)/glusterfs noinst_HEADERS = booster_fstab.h booster-fd.h libglusterfs_booster_la_SOURCES = booster.c booster_stat.c booster_fstab.c booster-fd.c libglusterfs_booster_la_CFLAGS = -I$(top_srcdir)/libglusterfsclient/src/ -D_GNU_SOURCE -D$(GF_HOST_OS) -fPIC -Wall \ - -pthread $(GF_BOOSTER_CFLAGS) -shared -nostartfiles + -pthread $(GF_BOOSTER_CFLAGS) -shared -nostartfiles libglusterfs_booster_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \ -I$(top_srcdir)/libglusterfsclient/src \ -I$(top_srcdir)/libglusterfs/src -DDATADIR=\"$(localstatedir)\" \ - -DCONFDIR=\"$(sysconfdir)/glusterfs\" + -DCONFDIR=\"$(sysconfdir)/glusterfs\" $(ARGP_STANDALONE_CPPFLAGS) libglusterfs_booster_la_LDFLAGS = -module -avoidversion libglusterfs_booster_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(top_builddir)/libglusterfsclient/src/libglusterfsclient.la diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h index 228daf5d..07ff3066 100644 --- a/libglusterfs/src/compat.h +++ b/libglusterfs/src/compat.h @@ -29,7 +29,7 @@ #include "dict.h" #ifndef LLONG_MAX -#define LLONG_MAX LONG_LONG_MAX /* compat with old gcc */ +#define LLONG_MAX __LONG_LONG_MAX__ /* compat with old gcc */ #endif /* LLONG_MAX */ -- cgit