mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 02:16:21 +00:00
Undefine malloc,strdup,calloc before redefining them
Some systems may use cpp macros to define these functions, glibc appears to be one of them. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
7dd8a9f710
commit
5673434fff
12
src/util.h
12
src/util.h
@ -9,8 +9,20 @@ extern char *git__strdup(const char *);
|
||||
|
||||
#ifndef GIT__NO_HIDE_MALLOC
|
||||
# define GIT__FORBID_MALLOC do_not_use_malloc_directly
|
||||
|
||||
# ifdef malloc
|
||||
# undef malloc
|
||||
# endif
|
||||
# define malloc(a) GIT__FORBID_MALLOC
|
||||
|
||||
# ifdef calloc
|
||||
# undef calloc
|
||||
# endif
|
||||
# define calloc(a,b) GIT__FORBID_MALLOC
|
||||
|
||||
# ifdef strdup
|
||||
# undef strdup
|
||||
# endif
|
||||
# define strdup(a) GIT__FORBID_MALLOC
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user