Commit ee040cb8 authored by Andrii Vasylevskyi's avatar Andrii Vasylevskyi Committed by Facebook Github Bot

More folly wasm32 #if's

Summary:
Fixing couple more failures in folly when compiling wasm:
1) making posix_memalign used instead of memalign (wasi-libc has memlaign as legacy P123789170)
2) disabling clearenv() that is using environ, which wasi-libc has off by ```#ifdef _GNU_SOURCE```, not sure why, but it's already off for linux and we won't use it our wasm code either.

Reviewed By: shodoco

Differential Revision: D18944271

fbshipit-source-id: ffa838591ada1248fdb8ae24f7eac45896a311e2
parent 11c10340
......@@ -58,7 +58,7 @@ inline void deallocateBytes(void* p, size_t n) {
(defined(__APPLE__) && \
(__MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 || \
__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0)) || \
defined(__FreeBSD__)
defined(__FreeBSD__) || defined(__wasm32__)
inline void* aligned_malloc(size_t size, size_t align) {
// use posix_memalign, but mimic the behaviour of memalign
......
......@@ -142,7 +142,7 @@ int unsetenv(const char* name) {
#endif
#if !__linux__ && !FOLLY_MOBILE
#if !__linux__ && !FOLLY_MOBILE && !defined(__wasm32__)
#include <string>
#include <vector>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment