Module: kamailio
Branch: master
Commit: fdb4c7758f0d6d6ebed8cf9d01a412ed024efb8b
URL:
https://github.com/kamailio/kamailio/commit/fdb4c7758f0d6d6ebed8cf9d01a412e…
Author: Jon Auer <jauer(a)corp.netwurx.net>
Committer: Jon Auer <jauer(a)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/fdb4c7758f0d6d6ebed8cf9d01a412e…
Patch:
https://github.com/kamailio/kamailio/commit/fdb4c7758f0d6d6ebed8cf9d01a412e…
---
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