porffor 0.60.6 → 0.60.7
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.
- package/compiler/2c.js +8 -3
- package/compiler/codegen.js +3 -2
- package/package.json +1 -1
- package/runtime/index.js +1 -1
- /package/{AGENT.md → AGENTS.md} +0 -0
package/compiler/2c.js
CHANGED
@@ -429,6 +429,7 @@ export default ({ funcs, globals, data, pages }) => {
|
|
429
429
|
for (const name in symbols) {
|
430
430
|
line(`*(void**)(&${name}) = dlsym(_dl, "${name}")`);
|
431
431
|
ffiFuncs[name] = symbols[name];
|
432
|
+
cified.add(name, true);
|
432
433
|
}
|
433
434
|
|
434
435
|
continue;
|
@@ -642,9 +643,13 @@ extern ${importFunc.returns.length > 0 ? CValtype[importFunc.returns[0]] : 'void
|
|
642
643
|
|
643
644
|
case 'time': {
|
644
645
|
const id = tmpId++;
|
645
|
-
|
646
|
-
|
647
|
-
|
646
|
+
platformSpecific(`
|
647
|
+
time_t _time_t${id};
|
648
|
+
time(&_time_t${id});
|
649
|
+
f64 _time_out${id} = (f64)_time_t${id} * 1000.0;`, `
|
650
|
+
struct timespec _ts${id};
|
651
|
+
clock_gettime(CLOCK_REALTIME, &_ts${id});
|
652
|
+
f64 _time_out${id} = (f64)_ts${id}.tv_sec * 1000.0 + (f64)_ts${id}.tv_nsec / 1.0e6;`);
|
648
653
|
vals.push(`_time_out${id}`);
|
649
654
|
|
650
655
|
includes.set('time.h', true);
|
package/compiler/codegen.js
CHANGED
@@ -2638,7 +2638,8 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
|
|
2638
2638
|
args.push({
|
2639
2639
|
type: 'ArrayExpression',
|
2640
2640
|
elements: restArgs,
|
2641
|
-
_doNotMarkTypeUsed: true
|
2641
|
+
_doNotMarkTypeUsed: true,
|
2642
|
+
_staticAlloc: func.internal
|
2642
2643
|
});
|
2643
2644
|
}
|
2644
2645
|
}
|
@@ -5594,7 +5595,7 @@ const generateArray = (scope, decl, global = false, name = '$undeclared', static
|
|
5594
5595
|
const out = [];
|
5595
5596
|
let pointer;
|
5596
5597
|
|
5597
|
-
if (staticAlloc) {
|
5598
|
+
if (staticAlloc || decl._staticAlloc) {
|
5598
5599
|
const uniqueName = name === '$undeclared' ? name + uniqId() : name;
|
5599
5600
|
|
5600
5601
|
const ptr = allocPage({ scope, pages }, uniqueName);
|
package/package.json
CHANGED
package/runtime/index.js
CHANGED
/package/{AGENT.md → AGENTS.md}
RENAMED
File without changes
|