Skip to content

Commit

Permalink
attempt to fix redefs in linux
Browse files Browse the repository at this point in the history
  • Loading branch information
jraymakers committed Jun 23, 2024
1 parent d8e8f4e commit 9c84445
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/value_conversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ Napi::Value ValueConversion::ToJS(Napi::Env &env, double val) {
return Napi::Number::New(env, val);
}

#ifndef __linux__
template <>
Napi::Value ValueConversion::ToJS(Napi::Env &env, size_t val) {
return Napi::Number::New(env, val);
}
#endif

template <>
Napi::Value ValueConversion::ToJS(Napi::Env &env, int8_t val) {
Expand Down Expand Up @@ -383,15 +385,17 @@ uint64_t *ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset)
return *PointerHolder<uint64_t *>::FromInfo(info, offset);
}

template <>
idx_t ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset) {
return GetValue(info, offset).As<Napi::Number>().Int64Value();
}
// template <>
// idx_t ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset) {
// return GetValue(info, offset).As<Napi::Number>().Int64Value();
// }

#ifndef __linux__
template <>
size_t ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset) {
return GetValue(info, offset).As<Napi::Number>().Int64Value();
}
#endif

template <>
int64_t ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset) {
Expand All @@ -418,6 +422,11 @@ uint16_t ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset) {
return GetValue(info, offset).As<Napi::Number>().Int32Value();
}

template <>
uint64_t ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset) {
return GetValue(info, offset).As<Napi::Number>().Int64Value();
}

template <>
float ValueConversion::FromJS(const Napi::CallbackInfo &info, idx_t offset) {
return GetValue(info, offset).As<Napi::Number>().FloatValue();
Expand Down

0 comments on commit 9c84445

Please sign in to comment.