From: Christophe CURIS Date: Mon, 30 Dec 2013 17:43:29 +0000 (+0100) Subject: Fixed a few improper macro usages X-Git-Tag: wmaker-0.95.6~297 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/5770e53c50024550b2e23d3d0059c33c59c24859 Fixed a few improper macro usages Added compiler checks for some improper macro usage and fixed the problems pointed by gcc. Signed-off-by: Christophe CURIS --- diff --git a/WINGs/string.c b/WINGs/string.c index 0fbead42..182d377e 100644 --- a/WINGs/string.c +++ b/WINGs/string.c @@ -242,7 +242,7 @@ char *wstrappend(char *dst, const char *src) } -#if HAVE_STRLCAT +#ifdef HAVE_STRLCAT size_t wstrlcat(char *dst, const char *src, size_t siz) { @@ -303,7 +303,7 @@ wstrlcat(char *dst, const char *src, size_t siz) } #endif /* HAVE_STRLCAT */ -#if HAVE_STRLCPY +#ifdef HAVE_STRLCPY size_t wstrlcpy(char *dst, const char *src, size_t siz) { diff --git a/configure.ac b/configure.ac index 3224f6a7..aa6b5b54 100644 --- a/configure.ac +++ b/configure.ac @@ -143,6 +143,10 @@ AS_IF([test "x$debug" = "xyes"], dnl secured OS, and in a more general way generate binary code dnl that may not be optimal AX_CFLAGS_GCC_OPTION([-Wtrampolines]) + dnl + dnl GCC provides a couple of checks to detect incorrect macro uses + AX_CFLAGS_GCC_OPTION([-Wundef]) + AX_CFLAGS_GCC_OPTION([-Wunused-macros]) ], [dnl dnl When debug not enabled, we try to avoid some non-necessary dnl messages from the compiler diff --git a/util/wmgenmenu.c b/util/wmgenmenu.c index b043febb..056eba99 100644 --- a/util/wmgenmenu.c +++ b/util/wmgenmenu.c @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) path = getenv("PATH"); setlocale(LC_ALL, ""); -#if HAVE_LIBINTL_H && I18N +#if defined(HAVE_LIBINTL_H) && defined(I18N) if (getenv("NLSPATH")) bindtextdomain("wmgenmenu", getenv("NLSPATH")); else