From 2138d8f7edff4fb3c544ccd47fb8eb3bac1a7224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 29 Mar 2022 21:11:12 +0800 Subject: [PATCH] add Cosmopolitan --- README.md | 2 ++ base1432.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1388957..66d8751 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # base16384 +> **Note**: This project used the awesome cross-patfrom binary compiling tool [cosmopolitan](https://github.com/jart/cosmopolitan) + Encode binary file to printable utf16be, and vise versa. # Description 说明 diff --git a/base1432.c b/base1432.c index af5714d..c71776b 100644 --- a/base1432.c +++ b/base1432.c @@ -1,6 +1,11 @@ // base1432.c // fumiama 20220319 -#ifndef __cosmopolitan // always le +#ifdef __cosmopolitan // always le +# define be16toh(x) bswap_16(x) +# define be32toh(x) bswap_32(x) +# define htobe16(x) bswap_16(x) +# define htobe32(x) bswap_32(x) +#else #include #include #include