From 3c0c88e11791545594f44364ff240609c958ad8e Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 25 Sep 2021 19:09:03 +0200 Subject: [PATCH] Portable endian.h header --- README.md | 5 +++++ number.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 035fc7b..4db5980 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,8 @@ This library is only capable of what dragonblocks needs, and it does not intend Included are Array, Bintree, List and Queue as well as numeric types and (de-)serialisation for them. To use this in your project, just compile the implementation.c file into your project's binary. + +## endian.h +By default, dragontype will use the Linux header. However, since other systems may not have that header, +you can use [this library](https://github.com/mikepb/endian.h) to replaced. Make sure to define DRAGONTYPE_ENDIAN_HEADER +to the include path of this portable endian.h file. diff --git a/number.c b/number.c index 54a4f9f..e8d4d10 100644 --- a/number.c +++ b/number.c @@ -1,6 +1,10 @@ #include #include +#ifdef DRAGONTYPE_ENDIAN_HEADER +#include DRAGONTYPE_ENDIAN_HEADER +#else #include +#endif #include #include "number.h" -- 2.44.0