Fix AOT compilation on MacOS (#3102)

After #2995, AOT may stop working properly on arm MacOS:
```bash
wasm-micro-runtime/core/iwasm/common/wasm_runtime_common.c,
line 1270, WASM module load failed
AOT module load failed: mmap memory failed
```
That's because, without `#include <TargetConditionals.h>`, `TARGET_OS_OSX` is undefined,
since it's definition is in that header file.
This commit is contained in:
Enrico Loparco 2024-01-31 13:06:22 +01:00 committed by GitHub
parent 51e25ef01f
commit dfd2a5b0b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#if defined(__APPLE__) || defined(__MACH__)
#include <libkern/OSCacheControl.h>
#include <TargetConditionals.h>
#endif
#ifndef BH_ENABLE_TRACE_MMAP

View File

@ -9,6 +9,10 @@
#include "platform_api_vmcore.h"
#include "platform_api_extension.h"
#if defined(__APPLE__) || defined(__MACH__)
#include <TargetConditionals.h>
#endif
typedef struct {
thread_start_routine_t start;
void *arg;