1 /*
2 Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22  * OTHER DEALINGS IN THE SOFTWARE.
23 */
24 
25 #include <string.h>
26 
27 #ifdef XML_WINLIB
28 
29 #define WIN32_LEAN_AND_MEAN
30 #define STRICT
31 #include <windows.h>
32 
33 #define malloc(x) HeapAlloc(GetProcessHeap(), 0, (x))
34 #define calloc(x, y) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (x)*(y))
35 #define free(x) HeapFree(GetProcessHeap(), 0, (x))
36 #define realloc(x, y) HeapReAlloc(GetProcessHeap(), 0, x, y)
37 #define abort() /* as nothing */
38 
39 #else /* not XML_WINLIB */
40 
41 #include <stdlib.h>
42 
43 #endif /* not XML_WINLIB */
44 
45 /* This file can be used for any definitions needed in
46 particular environments. */
47 
48 /* Mozilla specific defines */
49 
50 #ifdef MOZILLA_CLIENT
51 
52 #include "nspr.h"
53 #define malloc(x) PR_Malloc((size_t)(x))
54 #define realloc(x, y) PR_Realloc((x), (size_t)(y))
55 #define calloc(x, y) PR_Calloc((x),(y))
56 #define free(x) PR_Free(x)
57 #if PR_BYTES_PER_INT != 4
58 #define int int32
59 #endif
60 
61 /* Enable Unicode string processing in expat. */
62 #ifndef XML_UNICODE
63 #define XML_UNICODE
64 #endif
65 
66 /* Enable external parameter entity parsing in expat */
67 #ifndef XML_DTD
68 #define XML_DTD 1
69 #endif
70 
71 #endif /* MOZILLA_CLIENT */
72