buf_size: fix handling of unknown flexible array sizes
[smatch.git] / compat.h
blob4bba47ad2abd06d7275f10736fd3c07bc0ec3a51
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
15 * Our "blob" allocator works on chunks that are multiples
16 * of this size (the underlying allocator may be a mmap that
17 * cannot handle smaller chunks, for example, so trying to
18 * allocate blobs that aren't aligned is not going to work).
20 #define CHUNK 32768
22 void *blob_alloc(unsigned long size);
23 void blob_free(void *addr, unsigned long size);
24 long double string_to_ld(const char *nptr, char **endptr);
26 #endif