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