Skip to content

Commit 48f6762

Browse files
committed
src: add __wasm32__ guards
1 parent bd2c5ec commit 48f6762

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

napi-inl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct FinalizeData {
137137
Hint* hint;
138138
};
139139

140-
#if (NAPI_VERSION > 3)
140+
#if (NAPI_VERSION > 3 && !defined(__wasm32__))
141141
template <typename ContextType=void,
142142
typename Finalizer=std::function<void(Env, void*, ContextType*)>,
143143
typename FinalizerDataType=void>
@@ -196,7 +196,7 @@ struct ThreadSafeFinalize {
196196
FinalizerDataType* data;
197197
Finalizer callback;
198198
};
199-
#endif
199+
#endif // NAPI_VERSION > 3 && !defined(__wasm32__)
200200

201201
template <typename Getter, typename Setter>
202202
struct AccessorCallbackData {
@@ -4302,7 +4302,7 @@ inline void AsyncWorker::OnWorkComplete(Napi::Env /*env*/, napi_status status) {
43024302
}
43034303
}
43044304

4305-
#if (NAPI_VERSION > 3)
4305+
#if (NAPI_VERSION > 3 && !defined(__wasm32__))
43064306
////////////////////////////////////////////////////////////////////////////////
43074307
// ThreadSafeFunction class
43084308
////////////////////////////////////////////////////////////////////////////////
@@ -4969,7 +4969,7 @@ template<class T>
49694969
inline void AsyncProgressQueueWorker<T>::ExecutionProgress::Send(const T* data, size_t count) const {
49704970
_worker->SendProgress_(data, count);
49714971
}
4972-
#endif
4972+
#endif // NAPI_VERSION > 3 && !defined(__wasm32__)
49734973

49744974
////////////////////////////////////////////////////////////////////////////////
49754975
// Memory Management class

napi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ namespace Napi {
20422042
bool _suppress_destruct;
20432043
};
20442044

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

24102410
// Memory management.
24112411
class MemoryManagement {

0 commit comments

Comments
 (0)