Hex.c 532 B

12345678910111213141516171819202122
  1. #include <assert.h>
  2. #include "pal_debug.h"
  3. /* workaround: warn is not exported by pal. but pal_printf is */
  4. #define warn pal_printf
  5. #include "hex.h"
  6. #include "api.h"
  7. #include "pal.h"
  8. noreturn void __abort(void) {
  9. // ENOTRECOVERABLE = 131
  10. DkProcessExit(-131);
  11. }
  12. int main() {
  13. char x[] = {0xde, 0xad, 0xbe, 0xef};
  14. char y[] = {0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd};
  15. pal_printf("Hex test 1 is %s\n", ALLOCA_BYTES2HEXSTR(x));
  16. pal_printf("Hex test 2 is %s\n", ALLOCA_BYTES2HEXSTR(y));
  17. return 0;
  18. }