Skip to content

Commit

Permalink
src: add __wasm32__ guards
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek committed Jun 28, 2020
1 parent bd2c5ec commit 48f6762
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct FinalizeData {
Hint* hint;
};

#if (NAPI_VERSION > 3)
#if (NAPI_VERSION > 3 && !defined(__wasm32__))
template <typename ContextType=void,
typename Finalizer=std::function<void(Env, void*, ContextType*)>,
typename FinalizerDataType=void>
Expand Down Expand Up @@ -196,7 +196,7 @@ struct ThreadSafeFinalize {
FinalizerDataType* data;
Finalizer callback;
};
#endif
#endif // NAPI_VERSION > 3 && !defined(__wasm32__)

template <typename Getter, typename Setter>
struct AccessorCallbackData {
Expand Down Expand Up @@ -4302,7 +4302,7 @@ inline void AsyncWorker::OnWorkComplete(Napi::Env /*env*/, napi_status status) {
}
}

#if (NAPI_VERSION > 3)
#if (NAPI_VERSION > 3 && !defined(__wasm32__))
////////////////////////////////////////////////////////////////////////////////
// ThreadSafeFunction class
////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -4969,7 +4969,7 @@ template<class T>
inline void AsyncProgressQueueWorker<T>::ExecutionProgress::Send(const T* data, size_t count) const {
_worker->SendProgress_(data, count);
}
#endif
#endif // NAPI_VERSION > 3 && !defined(__wasm32__)

////////////////////////////////////////////////////////////////////////////////
// Memory Management class
Expand Down
4 changes: 2 additions & 2 deletions napi.h
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,7 @@ namespace Napi {
bool _suppress_destruct;
};

#if (NAPI_VERSION > 3)
#if (NAPI_VERSION > 3 && !defined(__wasm32__))
class ThreadSafeFunction {
public:
// This API may only be called from the main thread.
Expand Down Expand Up @@ -2405,7 +2405,7 @@ namespace Napi {
void Signal() const;
void SendProgress_(const T* data, size_t count);
};
#endif
#endif // NAPI_VERSION > 3 && !defined(__wasm32__)

// Memory management.
class MemoryManagement {
Expand Down

0 comments on commit 48f6762

Please sign in to comment.