Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update exports and imports #4

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,023 changes: 512 additions & 511 deletions cpp/jsi-exports-bridge.cpp → cpp/gen/jsi-exports-bridge.cpp

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions cpp/gen/jsi-exports-bridge.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// THIS FILE WAS GENERATED BY `react-native-wasm`
//
// DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST.
//

#pragma once
#include "jsi-imports-bridge.h"

namespace facebook::react {

jsi::Object createRapier__wasm3d__bgExports(jsi::Runtime &rt, jsi::Object importObject);

}
213 changes: 213 additions & 0 deletions cpp/gen/jsi-imports-bridge.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
//
// THIS FILE WAS GENERATED BY `react-native-wasm`
//
// DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST.
//

#include "jsi-imports-bridge.h"

using namespace facebook;

#ifdef __cplusplus
extern "C" {
#endif


/* import: 'wbg' '__wbindgen_number_new' */
u32 w2c_wbg_0x5F_wbindgen_number_new(w2c_wbg* ctx, f64 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbindgen_number_new");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbindgen_boolean_get' */
u32 w2c_wbg_0x5F_wbindgen_boolean_get(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbindgen_boolean_get");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbindgen_object_drop_ref' */
void w2c_wbg_0x5F_wbindgen_object_drop_ref(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbindgen_object_drop_ref");

fn.call(ctx->rt, {jsi::Value { (double)arg0 }
});
}

/* import: 'wbg' '__wbindgen_number_get' */
void w2c_wbg_0x5F_wbindgen_number_get(w2c_wbg* ctx, u32 arg0, u32 arg1) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbindgen_number_get");

fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 }
});
}

/* import: 'wbg' '__wbindgen_is_function' */
u32 w2c_wbg_0x5F_wbindgen_is_function(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbindgen_is_function");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbg_rawraycolliderintersection_new' */
u32 w2c_wbg_0x5F_wbg_rawraycolliderintersection_new(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_rawraycolliderintersection_new");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbg_rawcontactforceevent_new' */
u32 w2c_wbg_0x5F_wbg_rawcontactforceevent_new(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_rawcontactforceevent_new");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbg_call_b3ca7c6051f9bec1' */
u32 w2c_wbg_0x5F_wbg_call_b3ca7c6051f9bec1(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_call_b3ca7c6051f9bec1");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 }
}).asNumber();
}

/* import: 'wbg' '__wbg_call_8e7cb608789c2528' */
u32 w2c_wbg_0x5F_wbg_call_8e7cb608789c2528(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2, u32 arg3) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_call_8e7cb608789c2528");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 },jsi::Value { (double)arg3 }
}).asNumber();
}

/* import: 'wbg' '__wbg_call_938992c832f74314' */
u32 w2c_wbg_0x5F_wbg_call_938992c832f74314(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_call_938992c832f74314");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 },jsi::Value { (double)arg3 },jsi::Value { (double)arg4 }
}).asNumber();
}

/* import: 'wbg' '__wbg_bind_4d857b598695205e' */
u32 w2c_wbg_0x5F_wbg_bind_4d857b598695205e(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2, u32 arg3) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_bind_4d857b598695205e");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 },jsi::Value { (double)arg3 }
}).asNumber();
}

/* import: 'wbg' '__wbg_buffer_12d079cc21e14bdb' */
u32 w2c_wbg_0x5F_wbg_buffer_12d079cc21e14bdb(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_buffer_12d079cc21e14bdb");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb' */
u32 w2c_wbg_0x5F_wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 }
}).asNumber();
}

/* import: 'wbg' '__wbg_new_63b92bc8671ed464' */
u32 w2c_wbg_0x5F_wbg_new_63b92bc8671ed464(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_new_63b92bc8671ed464");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbg_set_a47bac70306a19a7' */
void w2c_wbg_0x5F_wbg_set_a47bac70306a19a7(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_set_a47bac70306a19a7");

fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 }
});
}

/* import: 'wbg' '__wbg_length_c20a40f15020d68a' */
u32 w2c_wbg_0x5F_wbg_length_c20a40f15020d68a(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_length_c20a40f15020d68a");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbg_newwithbyteoffsetandlength_4a659d079a1650e0' */
u32 w2c_wbg_0x5F_wbg_newwithbyteoffsetandlength_4a659d079a1650e0(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_newwithbyteoffsetandlength_4a659d079a1650e0");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 }
}).asNumber();
}

/* import: 'wbg' '__wbg_set_bd975934d1b1fddb' */
void w2c_wbg_0x5F_wbg_set_bd975934d1b1fddb(w2c_wbg* ctx, u32 arg0, u32 arg1, u32 arg2) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_set_bd975934d1b1fddb");

fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 },jsi::Value { (double)arg2 }
});
}

/* import: 'wbg' '__wbg_length_d25bbcbc3367f684' */
u32 w2c_wbg_0x5F_wbg_length_d25bbcbc3367f684(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_length_d25bbcbc3367f684");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbg_newwithlength_1e8b839a06de01c5' */
u32 w2c_wbg_0x5F_wbg_newwithlength_1e8b839a06de01c5(w2c_wbg* ctx, u32 arg0) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbg_newwithlength_1e8b839a06de01c5");

return
fn.call(ctx->rt, {jsi::Value { (double)arg0 }
}).asNumber();
}

/* import: 'wbg' '__wbindgen_throw' */
void w2c_wbg_0x5F_wbindgen_throw(w2c_wbg* ctx, u32 arg0, u32 arg1) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbindgen_throw");

fn.call(ctx->rt, {jsi::Value { (double)arg0 },jsi::Value { (double)arg1 }
});
}

/* import: 'wbg' '__wbindgen_memory' */
u32 w2c_wbg_0x5F_wbindgen_memory(w2c_wbg* ctx) {
auto fn = ctx->importObj.getPropertyAsFunction(ctx->rt, "__wbindgen_memory");

return
fn.call(ctx->rt, {
}).asNumber();
}


#ifdef __cplusplus
}
#endif

42 changes: 42 additions & 0 deletions cpp/gen/jsi-imports-bridge.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// THIS FILE WAS GENERATED BY `react-native-wasm`
//
// DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST.
//

#pragma once
#include <jsi/jsi.h>
#include "rapier_wasm3d_bg.h"

typedef int i32;
typedef long i64;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef float f32;
typedef double f64;


struct w2c_wbg {
w2c_rapier__wasm3d__bg* root;
facebook::jsi::Runtime& rt;
facebook::jsi::Object importObj;
};


namespace facebook::react {

class Rapier__wasm3d__bgModuleContext: public jsi::NativeState {
public:
Rapier__wasm3d__bgModuleContext(jsi::Runtime& rt, jsi::Object&& importObject)
: importObject(std::move(importObject))
, wbgCtx{&rootCtx, rt, this->importObject.getPropertyAsObject(rt, "wbg")}

{}

jsi::Object importObject;
w2c_rapier__wasm3d__bg rootCtx;
w2c_wbg wbgCtx;

};

}
2 changes: 1 addition & 1 deletion cpp/gen/rapier3d.c → cpp/gen/rapier_wasm3d_bg.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <alloca.h>
#endif

#include "rapier3d.h"
#include "rapier_wasm3d_bg.h"
#define IS_SINGLE_UNSHARED_MEMORY 1

// Computes a pointer to an object of the given size in a little-endian memory.
Expand Down
6 changes: 3 additions & 3 deletions cpp/gen/rapier3d.h → cpp/gen/rapier_wasm3d_bg.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Automatically generated by wasm2c */
#ifndef RAPIER3D_H_GENERATED_
#define RAPIER3D_H_GENERATED_
#ifndef RAPIER_WASM3D_BG_H_GENERATED_
#define RAPIER_WASM3D_BG_H_GENERATED_

#include "wasm-rt.h"

Expand Down Expand Up @@ -1625,4 +1625,4 @@ void w2c_rapier__wasm3d__bg_0x5F_wbindgen_exn_store(w2c_rapier__wasm3d__bg*, u32
}
#endif

#endif /* RAPIER3D_H_GENERATED_ */
#endif /* RAPIER_WASM3D_BG_H_GENERATED_ */
14 changes: 0 additions & 14 deletions cpp/jsi-exports-bridge.h

This file was deleted.

Loading
Loading