mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-04 14:37:46 -04:00
add minimal osx/ios compilastion support
This commit is contained in:
parent
2de059cace
commit
5d636caaaf
2 changed files with 9 additions and 2 deletions
|
@ -192,6 +192,10 @@ void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed)
|
|||
*/
|
||||
if (size >= HUGETLB_THRESHOLD)
|
||||
flags |= MAP_HUGETLB;
|
||||
#ifdef MAP_JIT
|
||||
if (need_exec)
|
||||
flags |= MAP_JIT;
|
||||
#endif
|
||||
|
||||
ret = mmap(req, size, prot, flags, -1, 0);
|
||||
if (ret == MAP_FAILED && (flags & MAP_HUGETLB)) {
|
||||
|
@ -223,8 +227,11 @@ void *plat_mremap(void *ptr, size_t oldsize, size_t newsize)
|
|||
{
|
||||
void *ret;
|
||||
|
||||
#ifdef MREMAP_MAYMOVE
|
||||
ret = mremap(ptr, oldsize, newsize, MREMAP_MAYMOVE);
|
||||
if (ret == MAP_FAILED) {
|
||||
if (ret == MAP_FAILED)
|
||||
#endif
|
||||
{
|
||||
fprintf(stderr, "mremap %p %zd %zd: ",
|
||||
ptr, oldsize, newsize);
|
||||
perror(NULL);
|
||||
|
|
2
posix.h
2
posix.h
|
@ -2,7 +2,7 @@
|
|||
#define LIBPICOFE_POSIX_H
|
||||
|
||||
/* define POSIX stuff: dirent, scandir, getcwd, mkdir */
|
||||
#if defined(__linux__) || defined(__MINGW32__)
|
||||
#if defined(__MACH__) || defined(__linux__) || defined(__MINGW32__)
|
||||
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue