1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-26 04:35:39 +03:00
aports/community/asterisk-chan-dongle/big-endian.patch
2025-02-03 22:40:54 +00:00

17 lines
531 B
Diff

--- a/char_conv.c
+++ b/char_conv.c
@@ -132,7 +132,13 @@ EXPORT_DEF ssize_t gsm7_encode(const uint16_t *in, size_t in_length, uint16_t *o
{
// TODO: Should we check for other tables or just use UCS-2?
unsigned bytes = 0;
- const uint8_t *escenc = get_char_gsm7_encoding(0x1B00);
+ const uint8_t *escenc = get_char_gsm7_encoding(
+#if __BYTE_ORDER == __BIG_ENDIAN
+ 0x001B
+#else
+ 0x1B00
+#endif
+ );
for (unsigned i = 0; i < in_length; ++i) {
const uint8_t *enc = get_char_gsm7_encoding(in[i]);
uint8_t c = enc[0];