From: Przemysław Pawełczyk Date: Wed, 28 Jun 2023 19:34:50 +0000 (+0200) Subject: talk-llama : fix build on macOS (#1062) X-Git-Tag: upstream/1.7.4~1394 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=85ed71aaec8e0612a84c0b67804bde75aa75a273;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp talk-llama : fix build on macOS (#1062) * talk-llama : use posix_madvise() instead of madvise() derived from BSD sed -i 's,\,posix_&,g;s,\ 0) { // Advise the kernel to preload the mapped memory - if (madvise(addr, std::min(file->size, prefetch), MADV_WILLNEED)) { - fprintf(stderr, "warning: madvise(.., MADV_WILLNEED) failed: %s\n", + if (posix_madvise(addr, std::min(file->size, prefetch), POSIX_MADV_WILLNEED)) { + fprintf(stderr, "warning: posix_madvise(.., POSIX_MADV_WILLNEED) failed: %s\n", strerror(errno)); } }