diff options
| author | Ken Brown | 2014-08-30 22:40:00 -0400 |
|---|---|---|
| committer | Ken Brown | 2014-08-30 22:40:00 -0400 |
| commit | f356dedfe3abd145c8f302c9be6b5e5ed9acacfc (patch) | |
| tree | fdd20983d24fe06e6e8892a2320f9af046138120 /src/gmalloc.c | |
| parent | ced5a8f219b31402480b60c370d0045afe74a531 (diff) | |
| download | emacs-f356dedfe3abd145c8f302c9be6b5e5ed9acacfc.tar.gz emacs-f356dedfe3abd145c8f302c9be6b5e5ed9acacfc.zip | |
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)
Diffstat (limited to 'src/gmalloc.c')
| -rw-r--r-- | src/gmalloc.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c index f4a32c79ca1..2682b07ee47 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c | |||
| @@ -19,13 +19,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. | |||
| 19 | The author may be reached (Email) at the address mike@ai.mit.edu, | 19 | The author may be reached (Email) at the address mike@ai.mit.edu, |
| 20 | or (US mail) as Mike Haertel c/o Free Software Foundation. */ | 20 | or (US mail) as Mike Haertel c/o Free Software Foundation. */ |
| 21 | 21 | ||
| 22 | /* If HYBRID_MALLOC is defined in config.h, then conf_post.h #defines | ||
| 23 | malloc and friends as macros before including stdlib.h. In this | ||
| 24 | file we will need the prototypes for the system malloc, so we must | ||
| 25 | include stdlib.h before config.h. And we have to do this | ||
| 26 | unconditionally, since HYBRID_MALLOC hasn't been defined yet. */ | ||
| 27 | #include <stdlib.h> | ||
| 28 | |||
| 29 | #include <config.h> | 22 | #include <config.h> |
| 30 | 23 | ||
| 31 | #if defined HAVE_PTHREAD && !defined HYBRID_MALLOC | 24 | #if defined HAVE_PTHREAD && !defined HYBRID_MALLOC |
| @@ -1725,6 +1718,17 @@ valloc (size_t size) | |||
| 1725 | #undef aligned_alloc | 1718 | #undef aligned_alloc |
| 1726 | #undef free | 1719 | #undef free |
| 1727 | 1720 | ||
| 1721 | /* Declare system malloc and friends. */ | ||
| 1722 | extern void *malloc (size_t size); | ||
| 1723 | extern void *realloc (void *ptr, size_t size); | ||
| 1724 | extern void *calloc (size_t nmemb, size_t size); | ||
| 1725 | extern void free (void *ptr); | ||
| 1726 | #ifdef HAVE_ALIGNED_ALLOC | ||
| 1727 | extern void *aligned_alloc (size_t alignment, size_t size); | ||
| 1728 | #elif defined HAVE_POSIX_MEMALIGN | ||
| 1729 | extern int posix_memalign (void **memptr, size_t alignment, size_t size); | ||
| 1730 | #endif | ||
| 1731 | |||
| 1728 | /* See the comments near the beginning of this file for explanations | 1732 | /* See the comments near the beginning of this file for explanations |
| 1729 | of the following functions. */ | 1733 | of the following functions. */ |
| 1730 | 1734 | ||