- Fix KiDispatchException to unmask KI_EXCEPTION_INTERNAL when setting the exception...
[reactos.git] / rosapps / mc / src / mad.h
1 #ifndef __MAD_H
2 #define __MAD_H
3
4 #ifdef HAVE_MAD
5 # define INLINE
6 #else
7 # ifndef INLINE
8 # define INLINE inline
9 # endif
10 #endif
11
12 #ifdef HAVE_MAD
13
14 /* The Memory Allocation Debugging system */
15
16 /* GNU headers define this as macros */
17 #ifdef malloc
18 # undef malloc
19 #endif
20
21 #ifdef calloc
22 # undef calloc
23 #endif
24
25 #define malloc(x) mad_alloc (x, __FILE__, __LINE__)
26 #define calloc(x, y) mad_alloc (x * y, __FILE__, __LINE__)
27 #define realloc(x, y) mad_realloc (x, y, __FILE__, __LINE__)
28 #define xmalloc(x, y) mad_alloc (x, __FILE__, __LINE__)
29 #define strdup(x) mad_strdup (x, __FILE__, __LINE__)
30 #define free(x) mad_free (x, __FILE__, __LINE__)
31
32 void mad_check (char *file, int line);
33 void *mad_alloc (int size, char *file, int line);
34 void *mad_realloc (void *ptr, int newsize, char *file, int line);
35 char *mad_strdup (const char *s, char *file, int line);
36 void mad_free (void *ptr, char *file, int line);
37 void mad_finalize (char *file, int line);
38 #else
39
40 #define mad_finalize(x, y)
41 #define mad_check(file,line)
42
43 #endif /* HAVE_MAD */
44
45 #endif /* __MAD_H */