emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117787: Fix bug#18368 with broken build on AIX due


From: Ken Brown
Subject: [Emacs-diffs] trunk r117787: Fix bug#18368 with broken build on AIX due to HYBRID_MALLOC changes.
Date: Sun, 31 Aug 2014 02:40:07 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117787
revision-id: address@hidden
parent: address@hidden
committer: Ken Brown <address@hidden>
branch nick: trunk
timestamp: Sat 2014-08-30 22:40:00 -0400
message:
  Fix bug#18368 with broken build on AIX due to HYBRID_MALLOC changes.
  
  * src/gmalloc.c: Don't include <stdlib.h>.  Declare system malloc and
  friends before defining hybrid_malloc and friends if HYBRID_MALLOC
  is defined.  (Bug#18368)
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/gmalloc.c                  gmalloc.c-20091113204419-o5vbwnq5f7feedwu-1085
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-08-30 22:59:39 +0000
+++ b/src/ChangeLog     2014-08-31 02:40:00 +0000
@@ -1,3 +1,9 @@
+2014-08-31  Ken Brown  <address@hidden>
+
+       * gmalloc.c: Don't include <stdlib.h>.  Declare system malloc and
+       friends before defining hybrid_malloc and friends if HYBRID_MALLOC
+       is defined.  (Bug#18368)
+
 2014-08-30  Paul Eggert  <address@hidden>
 
        Vector-sorting fixes (Bug#18361).

=== modified file 'src/gmalloc.c'
--- a/src/gmalloc.c     2014-08-28 14:48:02 +0000
+++ b/src/gmalloc.c     2014-08-31 02:40:00 +0000
@@ -19,13 +19,6 @@
    The author may be reached (Email) at the address address@hidden,
    or (US mail) as Mike Haertel c/o Free Software Foundation.  */
 
-/* If HYBRID_MALLOC is defined in config.h, then conf_post.h #defines
-   malloc and friends as macros before including stdlib.h.  In this
-   file we will need the prototypes for the system malloc, so we must
-   include stdlib.h before config.h.  And we have to do this
-   unconditionally, since HYBRID_MALLOC hasn't been defined yet.  */
-#include <stdlib.h>
-
 #include <config.h>
 
 #if defined HAVE_PTHREAD && !defined HYBRID_MALLOC
@@ -1725,6 +1718,17 @@
 #undef aligned_alloc
 #undef free
 
+/* Declare system malloc and friends.  */
+extern void *malloc (size_t size);
+extern void *realloc (void *ptr, size_t size);
+extern void *calloc (size_t nmemb, size_t size);
+extern void free (void *ptr);
+#ifdef HAVE_ALIGNED_ALLOC
+extern void *aligned_alloc (size_t alignment, size_t size);
+#elif defined HAVE_POSIX_MEMALIGN
+extern int posix_memalign (void **memptr, size_t alignment, size_t size);
+#endif
+
 /* See the comments near the beginning of this file for explanations
    of the following functions. */
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]