From: Elias Fleckenstein Date: Sat, 25 Sep 2021 17:09:03 +0000 (+0200) Subject: Portable endian.h header X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=3c0c88e11791545594f44364ff240609c958ad8e;p=dragonstd.git Portable endian.h header --- 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"