1 /* Copyright (C) 2001-2006 Artifex Software, Inc.
2    All Rights Reserved.
3 
4    This software is provided AS-IS with no warranty, either express or
5    implied.
6 
7    This software is distributed under license and may not be copied, modified
8    or distributed except as expressly authorized under the terms of that
9    license.  Refer to licensing information at http://www.artifex.com/
10    or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
11    San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12 */
13 
14 /* $Id: malloc_.h 8022 2007-06-05 22:23:38Z giles $ */
15 /* Generic substitute for Unix malloc.h */
16 
17 #ifndef malloc__INCLUDED
18 #  define malloc__INCLUDED
19 
20 /* We must include std.h before any file that includes sys/types.h. */
21 #include "std.h"
22 
23 #ifdef __TURBOC__
24 #  include <alloc.h>
25 #else
26 #  if defined(BSD4_2) || defined(apollo) || defined(vax) || defined(sequent) || defined(UTEK)
27 #    if defined(_POSIX_SOURCE) || (defined(__STDC__) && (!defined(sun) || defined(__svr4__)))	/* >>> */
28 #      include <stdlib.h>
29 #    else			/* Ancient breakage */
30 extern char *malloc();
31 extern void free();
32 
33 #    endif
34 #  else
35 #    if defined(_HPUX_SOURCE) || defined(__CONVEX__) || defined(__convex__) || defined(__OSF__) || defined(__386BSD__) || defined(_POSIX_SOURCE) || defined(__STDC__) || defined(VMS)
36 #      include <stdlib.h>
37 #    else
38 #      include <malloc.h>
39 #    endif			/* !_HPUX_SOURCE, ... */
40 #  endif			/* !BSD4_2, ... */
41 #endif /* !__TURBOC__ */
42 
43 /* (At least some versions of) Linux don't have a working realloc.... */
44 #ifdef linux
45 #  define malloc__need_realloc
46 void *gs_realloc(void *, size_t, size_t);
47 
48 #else
49 #  define gs_realloc(ptr, old_size, new_size) realloc(ptr, new_size)
50 #endif
51 
52 #endif /* malloc__INCLUDED */
53