From 8a29d8aebe1739169222951f9bcfe34c48e6c03a Mon Sep 17 00:00:00 2001
From: Syping <schiedelrafael@keppe.org>
Date: Tue, 6 Jun 2023 20:22:20 +0200
Subject: [PATCH] GitHub Actions: use C library for WebAssembly build

RagePhoto.c: fix header includes
---
 .github/workflows/webassembly.yml | 2 +-
 cmake/wasm.cmake                  | 1 +
 src/RagePhoto.c                   | 6 +++---
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml
index 339b25f..7940500 100644
--- a/.github/workflows/webassembly.yml
+++ b/.github/workflows/webassembly.yml
@@ -18,7 +18,7 @@ jobs:
         sudo apt-get update -qq
         sudo apt-get install cmake ninja-build -qq
     - name: Configure CMake
-      run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja
+      run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=iconv -GNinja
     - name: Build
       run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
     - name: Upload
diff --git a/cmake/wasm.cmake b/cmake/wasm.cmake
index 436b5d3..5da54dd 100644
--- a/cmake/wasm.cmake
+++ b/cmake/wasm.cmake
@@ -33,6 +33,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.13.0")
         "SHELL:-s ALLOW_MEMORY_GROWTH=1"
         "SHELL:-s MODULARIZE=1"
         "SHELL:-s WASM=1"
+        "SHELL:-s WASM_BIGINT=1"
         "SHELL:-s EXPORT_NAME=libragephotoModule"
         "SHELL:-s EXPORTED_FUNCTIONS=_free,_malloc"
         "SHELL:-s EXPORTED_RUNTIME_METHODS=ccall,cwrap"
diff --git a/src/RagePhoto.c b/src/RagePhoto.c
index 765411a..f71e942 100644
--- a/src/RagePhoto.c
+++ b/src/RagePhoto.c
@@ -17,9 +17,9 @@
 *****************************************************************************/
 
 #include "RagePhotoC.h"
-#include "stdlib.h"
-#include "stdio.h"
-#include "string.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
 
 #if defined(UNICODE_ICONV)
 #include <iconv.h>