functionalscript 0.0.459 → 0.0.461

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,5 +32,5 @@ const run = f => {
32
32
  }
33
33
 
34
34
  run(cpp)
35
- run(cs)
36
35
  run(rust)
36
+ run(cs)
@@ -62,22 +62,19 @@ const output = platform => name => {
62
62
  }
63
63
 
64
64
  /** @type {Func} */
65
- const cpp = ({dirname, platform}) => {
66
- const extension = platform === 'win32' ? 'dll' : 'so'
67
- return {
68
- file: {
69
- name: `${dirname}/cpp/_result.hpp`,
70
- content: cppContent,
71
- },
72
- line: [
73
- flat([
74
- ['clang', '-shared', '-o', output(platform)('main')],
75
- flags(platform),
76
- [`${dirname}/cpp/main.cpp`]]
77
- ),
78
- ],
79
- }
80
- }
65
+ const cpp = ({dirname, platform}) => ({
66
+ file: {
67
+ name: `${dirname}/cpp/_result.hpp`,
68
+ content: cppContent,
69
+ },
70
+ line: [
71
+ flat([
72
+ ['clang', '-shared', '-o', output(platform)('testc')],
73
+ flags(platform),
74
+ [`${dirname}/cpp/main.cpp`]]
75
+ ),
76
+ ],
77
+ })
81
78
 
82
79
  /** @type {Func} */
83
80
  const cs = ({dirname}) => ({
@@ -85,7 +82,8 @@ const cs = ({dirname}) => ({
85
82
  name: `${dirname}/cs/_result.cs`,
86
83
  content: csContent,
87
84
  },
88
- line: [['dotnet', 'build', `${dirname}/cs/cs.csproj`]],
85
+ line: [
86
+ ['dotnet', 'run', '--project', `${dirname}/cs/cs.csproj`]],
89
87
  })
90
88
 
91
89
  /** @type {Func} */
@@ -104,4 +102,4 @@ module.exports = {
104
102
  cs,
105
103
  /** @readonly */
106
104
  rust,
107
- }
105
+ }
@@ -1,2 +1,14 @@
1
1
  #include "../../cpp/com.hpp"
2
2
  #include "_result.hpp"
3
+
4
+ #ifdef _WIN32
5
+ #define DLL_EXPORT __declspec(dllexport)
6
+ #else
7
+ #define DLL_EXPORT
8
+ #endif
9
+
10
+ DLL_EXPORT
11
+ extern "C" int c_get()
12
+ {
13
+ return 43;
14
+ }
@@ -1,2 +1,12 @@
1
- // See https://aka.ms/new-console-template for more information
1
+ using System.Runtime.InteropServices;
2
+
3
+ [DllImport("testrust")]
4
+ static extern int get();
5
+
6
+ [DllImport("testc")]
7
+ static extern int c_get();
8
+
9
+ // See https://aka.ms/new-console-template for more information
2
10
  Console.WriteLine("Hello, World!");
11
+ Console.WriteLine(get());
12
+ Console.WriteLine(c_get());
@@ -8,4 +8,9 @@
8
8
  <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
9
9
  </PropertyGroup>
10
10
 
11
+ <ItemGroup>
12
+ <None Include="../../../target/debug/*testrust.*" CopyToOutputDirectory="PreserveNewest"/>
13
+ <None Include="../../../*testc.*" CopyToOutputDirectory="PreserveNewest"/>
14
+ </ItemGroup>
15
+
11
16
  </Project>
@@ -41,3 +41,6 @@ impl _result::IMy::Ex for nanocom::CObject<My> {
41
41
  todo!()
42
42
  }
43
43
  }
44
+
45
+ #[no_mangle]
46
+ pub extern "C" fn get() -> i32 { 42 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.0.459",
3
+ "version": "0.0.461",
4
4
  "description": "FunctionalScript is a functional subset of JavaScript",
5
5
  "main": "module.f.cjs",
6
6
  "scripts": {