]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - cmd/zstd/unzstd.c
Get rid of endian.h dependency
[tofuproxy.git] / cmd / zstd / unzstd.c
index c87dcd6208c95982f0e7250da41b88859ba28590..823515c1f898585e4065a5d874cfe506f1748ecc 100644 (file)
@@ -23,7 +23,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/endian.h>
 
 #include <zstd.h>
 
@@ -34,6 +33,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <sysexits.h>
 #endif // __FreeBSD__
 
+static uint32_t
+le32dec(const char buf[4])
+{
+    return (uint32_t)(buf[3]) << 24 | (uint32_t)(buf[2]) << 16 |
+           (uint32_t)(buf[1]) << 8 | (uint32_t)(buf[0]);
+}
+
 int
 main(int argc, char **argv)
 {