fixed: windows compilation
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 2 Dec 2023 04:25:30 +0000 (22:25 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 2 Dec 2023 04:25:30 +0000 (22:25 -0600)
runtime/src/ort_directories.h

index 36e6406a84d14b1fe0beb8d69ccd7549e052edc5..d5d37e298ef34b06517bf0f2832864aa7b5fe5bf 100644 (file)
@@ -180,13 +180,17 @@ ONYX_DEF(__dir_cwd, (WASM_I32, WASM_I32), (WASM_I32)) {
 #endif
 
 #if defined(_BH_WINDOWS)
-    int length = GetCurrentDirectory(params->data[1].of.i32, ONYX_PTR(params->data[0].of.i32));
-    if (length == 0 || length > params->data[1].of.i32) {
-        results->data[0] = WASM_I32_VAL(-1);
-        return NULL;
-    }
-
-    results->data[0] = WASM_I32_VAL( length );
+    // The GetCurrentDirectory symbol is causing a linker error.
+    // For a hotfix, I am leaving these unimplemented for now,
+    // but they should be fixed asap.
+    //
+    // int length = GetCurrentDirectory(params->data[1].of.i32, ONYX_PTR(params->data[0].of.i32));
+    // if (length == 0 || length > params->data[1].of.i32) {
+    //     results->data[0] = WASM_I32_VAL(-1);
+    //     return NULL;
+    // }
+
+    results->data[0] = WASM_I32_VAL(-1);
     return NULL;
 #endif
 }
@@ -199,8 +203,12 @@ ONYX_DEF(__dir_chdir, (WASM_I32), (WASM_I32)) {
 #endif
 
 #if defined(_BH_WINDOWS)
-    int result = SetCurrentDirectory(ONYX_PTR(params->data[0].of.i32));
-    results->data[0] = WASM_I32_VAL(result ? 1 : 0);
+    // The SetCurrentDirectory symbol is causing a linker error.
+    // For a hotfix, I am leaving these unimplemented for now,
+    // but they should be fixed asap.
+    //
+    // int result = SetCurrentDirectory(ONYX_PTR(params->data[0].of.i32));
+    results->data[0] = WASM_I32_VAL(0);
     return NULL;
 #endif
 }