Changeset b6647a7 in git for omalloc/omAllocSystem.c


Ignore:
Timestamp:
Nov 11, 2022, 2:59:00 AM (18 months ago)
Author:
Michael Orlitzky <michael@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c3c704ae428df052f1a454e90db10d6be4c5b98e
Parents:
2e385da3d970dddc3e7eca03cf240324f04a7567
git-author:
Michael Orlitzky <michael@orlitzky.com>2022-11-10 20:59:00-05:00
git-committer:
Michael Orlitzky <michael@orlitzky.com>2022-11-10 21:33:31-05:00
Message:
omalloc/omAllocSystem.c: add another include for malloc.h.

There are two branches in this file, one for HAVE_MALLOC_SIZE and one
for HAVE_MALLOC_USABLE_SIZE. The former includes malloc.h, and the
latter needs to too; otherwise, malloc_usable_size() is undefined.

This is caught by -Werror=implicit-function-declaration, which is
likely to be enabled by default in future versions of GCC and clang.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • omalloc/omAllocSystem.c

    r2e385d rb6647a7  
    3131 *******************************************************************/
    3232/* allocation of large addr */
     33
     34#if defined(HAVE_MALLOC_SIZE) || defined(HAVE_MALLOC_USABLE_SIZE)
     35  #include <stdlib.h>
     36  #ifdef HAVE_MALLOC_H
     37    #include <malloc.h>
     38  #elif defined(HAVE_MALLOC_MALLOC_H)
     39    #include <malloc/malloc.h>
     40  #endif
     41#endif
     42
    3343#if defined(HAVE_MALLOC_SIZE)
    34   #ifdef HAVE_MALLOC_H
    35   #include <malloc.h>
    36   #elif defined(HAVE_MALLOC_MALLOC_H)
    37   #include <malloc/malloc.h>
    38   #endif
    3944  #define _omSizeOfLargeAddr(addr) (malloc_size(addr))
    4045#elif defined(HAVE_MALLOC_USABLE_SIZE)
    41   #include <stdlib.h>
    4246  #define _omSizeOfLargeAddr(addr) (malloc_usable_size(addr))
    4347#else
Note: See TracChangeset for help on using the changeset viewer.