doing some maintenance on the posix build system, getting in sync with reactos base.
[reactos.git] / posix / include / psx / stdlib.h
1 /* $Id: stdlib.h,v 1.5 2003/01/05 18:27:20 robd Exp $
2 */
3 /*
4 * psx/stdlib.h
5 *
6 * internal stdlib.h
7 *
8 * This file is part of the ReactOS Operating System.
9 *
10 * Contributors:
11 * Created by KJK::Hyperion <noog@libero.it>
12 *
13 * THIS SOFTWARE IS NOT COPYRIGHTED
14 *
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
17 *
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 *
23 */
24 #ifndef __PSX_STDLIB_H_INCLUDED__
25 #define __PSX_STDLIB_H_INCLUDED__
26
27 /* INCLUDES */
28 #include <ddk/ntddk.h>
29 #include <ntos/heap.h>
30 #include <stdlib.h>
31
32 /* OBJECTS */
33
34 /* TYPES */
35
36 /* CONSTANTS */
37
38 /* PROTOTYPES */
39
40 /* MACROS */
41 /* FIXME? Windows NT's ntdll doesn't export RtlGetProcessHeap() */
42 //#define RtlGetProcessHeap() ((HANDLE)NtCurrentPeb()->ProcessHeap)
43 #ifndef _RTLGETPROCESSHEAP_DEFINED_
44 #define _RTLGETPROCESSHEAP_DEFINED_
45 #define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
46 #endif
47
48 #define __malloc(SIZE) (RtlAllocateHeap(RtlGetProcessHeap(), 0, (SIZE)))
49 #define __realloc(PTR,SIZE) (RtlReAllocateHeap(RtlGetProcessHeap(), 0, (PTR), (SIZE)))
50 #define __free(PTR) (RtlFreeHeap(RtlGetProcessHeap(), 0, (PTR)))
51
52 #endif /* __PSX_STDLIB_H_INCLUDED__ */
53
54 /* EOF */
55