[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning: "_GL_ATTRIBUTE_DEALLOC_FREE" redefined
From: |
Bruno Haible |
Subject: |
Re: warning: "_GL_ATTRIBUTE_DEALLOC_FREE" redefined |
Date: |
Thu, 13 Jan 2022 16:26:27 +0100 |
Werner LEMBERG wrote:
> All source code files that I can control (`maingui.moc.cpp`,
> `maingui.h`, `ddlineedit.h`) start with `#include <config.h>`.
Ah, right, you can't fully follow the gnulib <config.h> requirement, because
of Qt's 'moc'.
I'm committing this patch. Hope it helps.
2022-01-13 Bruno Haible <bruno@clisp.org>
Avoid warning "_GL_ATTRIBUTE_DEALLOC_FREE redefined" (regr. 2022-01-04).
Reported by Werner Lemberg <wl@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00094.html>.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Avoid redefining
_GL_ATTRIBUTE_DEALLOC_FREE.
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index bd7318aead..3730860f6d 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 70
+# gnulib-common.m4 serial 71
dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -181,7 +181,12 @@ AC_DEFUN([gl_COMMON_BODY], [
#else
# define _GL_ATTRIBUTE_DEALLOC(f, i)
#endif
-#define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+/* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
+ to use this earlier definition, since <stdlib.h> may not have been included
+ yet. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+#endif
/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
The compiler may warn if the entity is used. */