[PATCH] Add -Wno-cast-truncate
[smatch.git] / compat.h
blob5713088a7466a8021ca1f3b2e551b9451b5d270b
1 #ifndef COMPAT_H
2 #define COMPAT_H
4 /*
5 * Various systems get these things wrong. So
6 * we create a small compat library for them.
8 * - zeroed anonymous mmap
9 * Missing in mingw
10 * - "string to long double" (C99 strtold())
11 * Missing in Solaris and mingw
13 struct stream;
14 struct stat;
17 * Our "blob" allocator works on chunks that are multiples
18 * of this size (the underlying allocator may be a mmap that
19 * cannot handle smaller chunks, for example, so trying to
20 * allocate blobs that aren't aligned is not going to work).
22 #define CHUNK 32768
24 void *blob_alloc(unsigned long size);
25 void blob_free(void *addr, unsigned long size);
26 long double string_to_ld(const char *nptr, char **endptr);
28 #endif