possible fix to cgcc issue in sparse 0.4.2:
[smatch.git] / compat-mingw.c
blobc978e04e10f733d4c01ca36fcc6de08131415ae3
1 /*
2 * MinGW Compatibility functions
3 *
4 *
5 * Licensed under the Open Software License version 1.1
6 */
10 #include <stdarg.h>
11 #include <windef.h>
12 #include <winbase.h>
13 #include <stdlib.h>
14 #include <string.h>
16 #include "lib.h"
17 #include "allocate.h"
18 #include "token.h"
20 void *blob_alloc(unsigned long size)
22 void *ptr;
23 ptr = malloc(size);
24 if (ptr != NULL)
25 memset(ptr, 0, size);
26 return ptr;
29 void blob_free(void *addr, unsigned long size)
31 free(addr);
34 long double string_to_ld(const char *nptr, char **endptr)
36 return strtod(nptr, endptr);