Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Nov 27, 2024
1 parent f513308 commit 679ee64
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 350 deletions.
31 changes: 13 additions & 18 deletions cpp/helper.h
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)
Loading

0 comments on commit 679ee64

Please sign in to comment.