diff third_party/emsdk/bazel/test_external/hello-embind.cc @ 186:8cf4ec5e2191 hg-web

Fixed merge conflict.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:38:59 -0800
parents 8d17f6e6e290
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/third_party/emsdk/bazel/test_external/hello-embind.cc	Fri Jan 23 22:38:59 2026 -0800
@@ -0,0 +1,16 @@
+#include <emscripten/bind.h>
+
+using namespace emscripten;
+
+class HelloClass {
+    public:
+    static std::string SayHello(const std::string &name) {
+        return "Yo! " + name;
+    };
+};
+
+EMSCRIPTEN_BINDINGS(Hello) {
+    emscripten::class_<HelloClass>("HelloClass")
+        .constructor<>()
+        .class_function("SayHello", &HelloClass::SayHello);
+}