]> git.eshelyaron.com Git - emacs.git/commitdiff
Pacify warnings in gmalloc.c
authorPo Lu <luangruo@yahoo.com>
Sun, 12 May 2024 05:27:43 +0000 (13:27 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 12 May 2024 15:49:35 +0000 (17:49 +0200)
* src/gmalloc.c (__malloc_initialize_hook): Also declare in
advance on Glibc 2.24 and later.
(__after_morecore_hook, __morecore): Likewise on Glibc 2.34 and
later.

(cherry picked from commit 67b1da215c9fc103d131e8c568a1e6a75d993f83)

src/gmalloc.c

index 2b29f5c6c81adeeee2a0bf7639d49d59b1666a73..1faf6506167870dcc4e5915b8810068001e8bfc4 100644 (file)
@@ -47,11 +47,15 @@ License along with this library.  If not, see <https://www.gnu.org/licenses/>.
 #ifndef __MALLOC_HOOK_VOLATILE
 # define __MALLOC_HOOK_VOLATILE volatile
 #endif
-#ifndef HAVE_MALLOC_H
+#if !defined HAVE_MALLOC_H                                             \
+  || (__GLIBC__ > 2 || __GLIBC_MINOR__ >= 34)
 extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void);
-extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void);
 extern void *(*__morecore) (ptrdiff_t);
-#endif
+#endif /* !defined HAVE_MALLOC_H || glibc >= 2.34 */
+#if !defined HAVE_MALLOC_H                                             \
+  || (__GLIBC__ > 2 || __GLIBC_MINOR__ >= 24)
+extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void);
+#endif /* !defined HAVE_MALLOC_H || glibc >= 2.24 */
 
 /* If HYBRID_MALLOC is defined, then temacs will use malloc,
    realloc... as defined in this file (and renamed gmalloc,