wasm: fix compile

This commit is contained in:
luboslenco
2026-03-25 14:15:33 +01:00
parent f0cc33d1de
commit 2e1621ccec
7 changed files with 31 additions and 13 deletions
+20
View File
@@ -8,3 +8,23 @@ int tolower(int ch) {
int toupper(int ch) {
return (ch >= 'a' && ch <= 'z') ? ch - 32 : ch;
}
int isspace(int ch) {
return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' || ch == '\f' || ch == '\v';
}
int isxdigit(int ch) {
return (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F');
}
int isdigit(int ch) {
return ch >= '0' && ch <= '9';
}
int isalpha(int ch) {
return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
}
int isalnum(int ch) {
return isalpha(ch) || isdigit(ch);
}
+6
View File
@@ -1,3 +1,9 @@
#pragma once
int tolower(int ch);
int toupper(int ch);
int isspace(int ch);
int isxdigit(int ch);
int isdigit(int ch);
int isalpha(int ch);
int isalnum(int ch);
+1 -8
View File
@@ -2,6 +2,7 @@
#include "string.h"
#include "stddef.h"
#include "stdio.h"
#include "ctype.h"
#define ALIGNMENT 8
#define ALIGN(size) (((size) + (ALIGNMENT - 1)) & ~(ALIGNMENT - 1))
@@ -117,14 +118,6 @@ void exit(int code) {
exit(code);
}
int isdigit(int c) {
return c >= '0' && c <= '9';
}
int isspace(int c) {
return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}
long int strtol(const char *str, char **endptr, int base) {
while (isspace(*str)) {
str++;
+2 -2
View File
@@ -2648,7 +2648,7 @@ class IronExporter {
copy_blob(from, to, embed) {
fs_ensuredir(path_join("build", "out", path_dirname(to)));
let to_full = path_join("build", "out", to);
if (embed && !to.endsWith(".txt") && !to.endsWith(".md") && !to.endsWith(".json") && !to.endsWith(".c") && !to.endsWith(".html")) {
if (embed && !to.endsWith(".txt") && !to.endsWith(".md") && !to.endsWith(".json") && !to.endsWith(".c") && !to.endsWith(".html") && !to.endsWith(".js") && !to.endsWith(".ico")) {
fs_ensuredir(path_join("build", "temp", path_dirname(to)));
to_full = path_join("build", "temp", to);
}
@@ -2694,7 +2694,7 @@ function export_iron_project(project, options) {
if (globalThis.flags.embed) {
let embed_files = [];
for (let asset of assets) {
if (asset.noembed || asset.from.endsWith(".txt") || asset.from.endsWith(".md") || asset.from.endsWith(".json") || asset.from.endsWith(".c") || asset.from.endsWith(".html")) {
if (asset.noembed || asset.from.endsWith(".txt") || asset.from.endsWith(".md") || asset.from.endsWith(".json") || asset.from.endsWith(".c") || asset.from.endsWith(".html") || asset.from.endsWith(".js") || asset.from.endsWith(".ico")) {
continue;
}
embed_files.push(path_resolve("build", "temp", asset.files[0]));
-1
View File
@@ -20,7 +20,6 @@ flags.export_data_list = platform == "android"; // .apk contents
if (platform == "wasm") {
flags.with_nfd = false;
flags.with_compress = false;
flags.with_eval = false;
flags.with_plugins = false;
flags.with_raytrace = false;
flags.export_data_list = true;
+1 -1
View File
@@ -49,5 +49,5 @@ cd armorpaint/paint
**WASM**
```bash
../base/make --target wasm --compile
../base/make --target wasm --compile --embed
```
+1 -1
View File
@@ -32,7 +32,7 @@ void base_on_drop_files(char *drop_path) {
void base_init_on_start_arm(void *_) {
import_arm_run_project(project_filepath);
// Auto-run script
if (project_raw->script_datas == NULL && project_raw->script_datas->length > 0) {
if (project_raw->script_datas != NULL && project_raw->script_datas->length > 0) {
minic_ctx_t *ctx = minic_eval(project_raw->script_datas->buffer[0]);
}
}