Browse Source

[Pal/regression] Hex.c: Define __abort() and warn() not exported by Pal

Previously, Hex.c used __abort() and warn() not exported by PAL. This
led to linking errors during build.
Isaku Yamahata 4 years ago
parent
commit
d4c402d0ac
1 changed files with 10 additions and 1 deletions
  1. 10 1
      Pal/regression/Hex.c

+ 10 - 1
Pal/regression/Hex.c

@@ -1,8 +1,17 @@
+#include <assert.h>
+#include "pal_debug.h"
+/* workaround: warn is not exported by pal. but pal_printf is */
+#define warn pal_printf
+
 #include "hex.h"
 
 #include "api.h"
 #include "pal.h"
-#include "pal_debug.h"
+
+noreturn void __abort(void) {
+    // ENOTRECOVERABLE = 131
+    DkProcessExit(-131);
+}
 
 int main() {
     char x[] = {0xde, 0xad, 0xbe, 0xef};