[PATCH] two-arguments ?:
[smatch.git] / compat.h
blobfecfcb1cb871c7cb8a7d787d6f3471e4b1d85135
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
12 * - checking for file identity (POSIX st_dev && st_ino comparison)
13 * mingw needs to check the name (st_dev/st_ino are zero)
15 struct stream;
16 struct stat;
19 * Our "blob" allocator works on chunks that are multiples
20 * of this size (the underlying allocator may be a mmap that
21 * cannot handle smaller chunks, for example, so trying to
22 * allocate blobs that aren't aligned is not going to work).
24 #define CHUNK 32768
26 void *blob_alloc(unsigned long size);
27 void blob_free(void *addr, unsigned long size);
28 long double string_to_ld(const char *nptr, char **endptr);
29 int identical_files(struct stream* s, struct stat *st, const char * name);
31 #endif