We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 792c078 commit 77e6caaCopy full SHA for 77e6caa
src/whisper.cpp
@@ -40,16 +40,16 @@
40
#endif
41
42
#if defined(GGML_BIG_ENDIAN)
43
-#include <bit>
44
-
45
template<typename T>
46
static T byteswap(T value) {
47
- return std::byteswap(value);
48
-}
49
50
-template<>
51
-float byteswap(float value) {
52
- return std::bit_cast<float>(byteswap(std::bit_cast<std::uint32_t>(value)));
+ T value_swapped;
+ char * source = reinterpret_cast<char *>(&value);
+ char * target = reinterpret_cast<char *>(&value_swapped);
+ int size = sizeof(T);
+ for (int i = 0; i < size; i++) {
+ target[size - 1 - i] = source[i];
+ }
+ return value_swapped;
53
}
54
55
0 commit comments