[sr-dev] git:master:fdb4c775: fix compile errors in srutils/sha256 on SunOS (SmartOS)

Jon Auer jauer at corp.netwurx.net
Mon Feb 9 22:51:34 CET 2015


Module: kamailio
Branch: master
Commit: fdb4c7758f0d6d6ebed8cf9d01a412ed024efb8b
URL: https://github.com/kamailio/kamailio/commit/fdb4c7758f0d6d6ebed8cf9d01a412ed024efb8b

Author: Jon Auer <jauer at corp.netwurx.net>
Committer: Jon Auer <jauer at corp.netwurx.net>
Date: 2015-02-05T23:34:59Z

fix compile errors in srutils/sha256 on SunOS (SmartOS)

---

Modified: lib/srutils/sha256.c
Modified: lib/srutils/sha256.h

---

Diff:  https://github.com/kamailio/kamailio/commit/fdb4c7758f0d6d6ebed8cf9d01a412ed024efb8b.diff
Patch: https://github.com/kamailio/kamailio/commit/fdb4c7758f0d6d6ebed8cf9d01a412ed024efb8b.patch

---

diff --git a/lib/srutils/sha256.c b/lib/srutils/sha256.c
index 087736d..5e87beb 100644
--- a/lib/srutils/sha256.c
+++ b/lib/srutils/sha256.c
@@ -36,6 +36,12 @@
 #include <assert.h>	/* assert() */
 #include "sha256.h"
 
+/* discover byte order on solaris */
+#if defined(__SVR4) || defined(__sun)
+       #include <sys/isa_defs.h>
+       #define BYTE_ORDER _BYTE_ORDER
+#endif
+
 /*
  * ASSERT NOTE:
  * Some sanity checking code is included using assert().  On my FreeBSD
diff --git a/lib/srutils/sha256.h b/lib/srutils/sha256.h
index 78393e5..4c134d2 100644
--- a/lib/srutils/sha256.h
+++ b/lib/srutils/sha256.h
@@ -53,6 +53,12 @@ extern "C" {
 
 #endif /* SHA2_USE_INTTYPES_H */
 
+/* fix types for Sun Solaris */
+#if defined(__SVR4) || defined(__sun)
+    typedef uint8_t u_int8_t;
+    typedef uint32_t u_int32_t;
+    typedef uint64_t u_int64_t;
+#endif
 
 /*** SHA-256/384/512 Various Length Definitions ***********************/
 #define SHA256_BLOCK_LENGTH		64




More information about the sr-dev mailing list