forked from swiftwasm/JavaScriptKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_CJavaScriptKit+I64.h
More file actions
27 lines (22 loc) · 925 Bytes
/
_CJavaScriptKit+I64.h
File metadata and controls
27 lines (22 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef _CJavaScriptBigIntSupport_h
#define _CJavaScriptBigIntSupport_h
#include <_CJavaScriptKit.h>
/// Converts the provided Int64 or UInt64 to a BigInt.
///
/// @param value The value to convert.
/// @param is_signed Whether to treat the value as a signed integer or not.
#if __wasi__
__attribute__((__import_module__("javascript_kit"),
__import_name__("swjs_i64_to_bigint")))
#endif
extern JavaScriptObjectRef _i64_to_bigint(const long long value, bool is_signed);
/// Converts the provided BigInt to an Int64 or UInt64.
///
/// @param ref The target JavaScript object.
/// @param is_signed Whether to treat the return value as a signed integer or not.
#if __wasi__
__attribute__((__import_module__("javascript_kit"),
__import_name__("swjs_bigint_to_i64")))
#endif
extern long long _bigint_to_i64(const JavaScriptObjectRef ref, bool is_signed);
#endif /* _CJavaScriptBigIntSupport_h */