compat.h 685 B

123456789101112131415161718192021222324252627
  1. #ifndef COMPAT_H
  2. #define COMPAT_H
  3. /*
  4. * Various systems get these things wrong. So
  5. * we create a small compat library for them.
  6. *
  7. * - zeroed anonymous mmap
  8. * Missing in MinGW
  9. * - "string to long double" (C99 strtold())
  10. * Missing in Solaris and MinGW
  11. */
  12. /*
  13. * Our "blob" allocator works on chunks that are multiples
  14. * of this size (the underlying allocator may be a mmap that
  15. * cannot handle smaller chunks, for example, so trying to
  16. * allocate blobs that aren't aligned is not going to work).
  17. */
  18. #define CHUNK 32768
  19. void *blob_alloc(unsigned long size);
  20. void blob_free(void *addr, unsigned long size);
  21. long double string_to_ld(const char *nptr, char **endptr);
  22. #endif