-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
327 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
#pragma once | ||
|
||
#define JSI_HOST_FUNCTION(NAME) \ | ||
facebook::jsi::Value NAME( \ | ||
facebook::jsi::Runtime &runtime, \ | ||
const facebook::jsi::Value &thisValue, \ | ||
const facebook::jsi::Value *arguments, \ | ||
size_t count \ | ||
) | ||
#define JSI_HOST_FUNCTION(NAME) \ | ||
facebook::jsi::Value NAME( \ | ||
facebook::jsi::Runtime &runtime, const facebook::jsi::Value &thisValue, \ | ||
const facebook::jsi::Value *arguments, size_t count) | ||
|
||
#define EXPOSE_FN(RUNTIME, NAME, ARGC, FUNCTION) \ | ||
{ \ | ||
auto NAME = Function::createFromHostFunction( \ | ||
(RUNTIME), \ | ||
facebook::jsi::PropNameID::forAscii((RUNTIME), #NAME), \ | ||
ARGC, \ | ||
FUNCTION \ | ||
); \ | ||
(RUNTIME).global().setProperty((RUNTIME), #NAME, std::move(NAME)); \ | ||
#define EXPOSE_FN(RUNTIME, NAME, ARGC, FUNCTION) \ | ||
{ \ | ||
auto NAME = Function::createFromHostFunction( \ | ||
(RUNTIME), facebook::jsi::PropNameID::forAscii((RUNTIME), #NAME), \ | ||
ARGC, FUNCTION); \ | ||
(RUNTIME).global().setProperty((RUNTIME), #NAME, std::move(NAME)); \ | ||
} | ||
|
||
#define BIND_METHOD(METHOD) \ | ||
std::bind(&METHOD, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4) | ||
#define BIND_METHOD(METHOD) \ | ||
std::bind(&METHOD, this, std::placeholders::_1, std::placeholders::_2, \ | ||
std::placeholders::_3, std::placeholders::_4) |
Oops, something went wrong.