Fixed some issues found by winapi_check.
[wine] / include / msvcrt / malloc.h
1 /*
2  * Heap definitions
3  *
4  * Copyright 2001 Francois Gouget.
5  */
6 #ifndef __WINE_MALLOC_H
7 #define __WINE_MALLOC_H
8
9 #ifdef USE_MSVCRT_PREFIX
10 #define MSVCRT(x)    MSVCRT_##x
11 #else
12 #define MSVCRT(x)    x
13 #endif
14
15
16 /* heap function constants */
17 #define _HEAPEMPTY    -1
18 #define _HEAPOK       -2
19 #define _HEAPBADBEGIN -3
20 #define _HEAPBADNODE  -4
21 #define _HEAPEND      -5
22 #define _HEAPBADPTR   -6
23
24 #define _FREEENTRY     0
25 #define _USEDENTRY     1
26
27
28 #ifndef MSVCRT_SIZE_T_DEFINED
29 typedef unsigned int MSVCRT(size_t);
30 #define MSVCRT_SIZE_T_DEFINED
31 #endif
32
33 typedef struct _heapinfo
34 {
35   int*           _pentry;
36   MSVCRT(size_t) _size;
37   int            _useflag;
38 } _HEAPINFO;
39
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 void*       _alloca(MSVCRT(size_t));
46 void*       _expand(void*,MSVCRT(size_t));
47 int         _heapadd(void*,MSVCRT(size_t));
48 int         _heapchk(void);
49 int         _heapmin(void);
50 int         _heapset(unsigned int);
51 MSVCRT(size_t) _heapused(MSVCRT(size_t)*,MSVCRT(size_t)*);
52 int         _heapwalk(_HEAPINFO*);
53 MSVCRT(size_t) _msize(void*);
54
55 void*       MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
56 void        MSVCRT(free)(void*);
57 void*       MSVCRT(malloc)(MSVCRT(size_t));
58 void*       MSVCRT(realloc)(void*,MSVCRT(size_t));
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64
65 #ifndef USE_MSVCRT_PREFIX
66 #define alloca _alloca
67 #endif /* USE_MSVCRT_PREFIX */
68
69 #endif /* __WINE_MALLOC_H */