aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/hash-library/001-fix-macos.patch
blob: 60658e31651f7cac68b498688bafbda4e2c207a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Fixes includes of endian.h on MacOS, see https://github.com/stbrumme/hash-library/pull/4.

diff --git a/crc32.cpp b/crc32.cpp
--- a/crc32.cpp
+++ b/crc32.cpp
@@ -7,8 +7,10 @@
 #include "crc32.h"
 
 // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+  #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+  #include <endian.h>
 #endif
 
 
diff --git a/keccak.cpp b/keccak.cpp
--- a/keccak.cpp
+++ b/keccak.cpp
@@ -7,8 +7,10 @@
 #include "keccak.h"
 
 // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+  #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+  #include <endian.h>
 #endif
 
 
diff --git a/md5.cpp b/md5.cpp
--- a/md5.cpp
+++ b/md5.cpp
@@ -6,8 +6,10 @@
 
 #include "md5.h"
 
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+  #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+  #include <endian.h>
 #endif
 
 
diff --git a/sha1.cpp b/sha1.cpp
--- a/sha1.cpp
+++ b/sha1.cpp
@@ -7,8 +7,10 @@
 #include "sha1.h"
 
 // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+  #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+  #include <endian.h>
 #endif
 
 
diff --git a/sha256.cpp b/sha256.cpp
--- a/sha256.cpp
+++ b/sha256.cpp
@@ -7,8 +7,10 @@
 #include "sha256.h"
 
 // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+  #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+  #include <endian.h>
 #endif
 
 
diff --git a/sha3.cpp b/sha3.cpp
--- a/sha3.cpp
+++ b/sha3.cpp
@@ -7,8 +7,10 @@
 #include "sha3.h"
 
 // big endian architectures need #define __BYTE_ORDER __BIG_ENDIAN
-#ifndef _MSC_VER
-#include <endian.h>
+#if defined(__APPLE__)
+  #include <machine/endian.h>
+#elif !defined(_MSC_VER)
+  #include <endian.h>
 #endif
 
 #include <iostream>