xref: /minix3/usr.bin/make/make_malloc.h (revision 2e2caf591948f38f31c4e679c6277d2cb999cee7)
1*2e2caf59SThomas Veerman /*	$NetBSD: make_malloc.h,v 1.4 2009/01/24 14:43:29 dsl Exp $	*/
2*2e2caf59SThomas Veerman 
3*2e2caf59SThomas Veerman /*-
4*2e2caf59SThomas Veerman  * Copyright (c) 2009 The NetBSD Foundation, Inc.
5*2e2caf59SThomas Veerman  * All rights reserved.
6*2e2caf59SThomas Veerman  *
7*2e2caf59SThomas Veerman  * Redistribution and use in source and binary forms, with or without
8*2e2caf59SThomas Veerman  * modification, are permitted provided that the following conditions
9*2e2caf59SThomas Veerman  * are met:
10*2e2caf59SThomas Veerman  * 1. Redistributions of source code must retain the above copyright
11*2e2caf59SThomas Veerman  *    notice, this list of conditions and the following disclaimer.
12*2e2caf59SThomas Veerman  * 2. Redistributions in binary form must reproduce the above copyright
13*2e2caf59SThomas Veerman  *    notice, this list of conditions and the following disclaimer in the
14*2e2caf59SThomas Veerman  *    documentation and/or other materials provided with the distribution.
15*2e2caf59SThomas Veerman  *
16*2e2caf59SThomas Veerman  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17*2e2caf59SThomas Veerman  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18*2e2caf59SThomas Veerman  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19*2e2caf59SThomas Veerman  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20*2e2caf59SThomas Veerman  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*2e2caf59SThomas Veerman  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*2e2caf59SThomas Veerman  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*2e2caf59SThomas Veerman  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*2e2caf59SThomas Veerman  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*2e2caf59SThomas Veerman  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*2e2caf59SThomas Veerman  * POSSIBILITY OF SUCH DAMAGE.
27*2e2caf59SThomas Veerman  */
28*2e2caf59SThomas Veerman 
29*2e2caf59SThomas Veerman #ifndef USE_EMALLOC
30*2e2caf59SThomas Veerman void *bmake_malloc(size_t);
31*2e2caf59SThomas Veerman void *bmake_realloc(void *, size_t);
32*2e2caf59SThomas Veerman char *bmake_strdup(const char *);
33*2e2caf59SThomas Veerman char *bmake_strndup(const char *, size_t);
34*2e2caf59SThomas Veerman #else
35*2e2caf59SThomas Veerman #include <util.h>
36*2e2caf59SThomas Veerman #define bmake_malloc(x)         emalloc(x)
37*2e2caf59SThomas Veerman #define bmake_realloc(x,y)      erealloc(x,y)
38*2e2caf59SThomas Veerman #define bmake_strdup(x)         estrdup(x)
39*2e2caf59SThomas Veerman #define bmake_strndup(x,y)      estrndup(x,y)
40*2e2caf59SThomas Veerman #endif
41*2e2caf59SThomas Veerman 
42