]> git.lizzy.rs Git - dragonstd.git/commitdiff
Portable endian.h header
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sat, 25 Sep 2021 17:09:03 +0000 (19:09 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sat, 25 Sep 2021 17:09:03 +0000 (19:09 +0200)
README.md
number.c

index 035fc7bda7ecce451a5640528dd660a9aaf842bf..4db5980b92af0d81bec841e84a12d05089698e5e 100644 (file)
--- 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 <endian.h> 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.
index 54a4f9fa421927ae1c8b8a02390b8304eeb35a96..e8d4d1085c49b84c395ee3a0ea9e6d6b8ff635bc 100644 (file)
--- a/number.c
+++ b/number.c
@@ -1,6 +1,10 @@
 #include <stdio.h>
 #include <unistd.h>
+#ifdef DRAGONTYPE_ENDIAN_HEADER
+#include DRAGONTYPE_ENDIAN_HEADER
+#else
 #include <endian.h>
+#endif
 #include <poll.h>
 #include "number.h"