File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
%{
2
+ #if defined(__linux__)
3
+ #include < endian.h>
4
+ #if BYTE_ORDER == LITTLE_ENDIAN
5
+ #define SWIG_RUBY_ENDIAN " LE"
6
+ #elif BYTE_ORDER == BIG_ENDIAN
7
+ #define SWIG_RUBY_ENDIAN " BE"
8
+ #endif
9
+ #else
10
+ #define SWIG_RUBY_ENDIAN " LE"
11
+ #endif
12
+
2
13
#ifdef __cplusplus
3
14
extern " C" {
4
15
#endif
@@ -15,9 +26,9 @@ extern "C" {
15
26
#ifndef SWIG_RUBY_WSTRING_ENCODING
16
27
17
28
#if WCHAR_MAX == 0x7fff || WCHAR_MAX == 0xffff
18
- #define SWIG_RUBY_WSTRING_ENCODING " UTF-16LE "
29
+ #define SWIG_RUBY_WSTRING_ENCODING " UTF-16 " SWIG_RUBY_ENDIAN
19
30
#elif WCHAR_MAX == 0x7fffffff || WCHAR_MAX == 0xffffffff
20
- #define SWIG_RUBY_WSTRING_ENCODING " UTF-32LE "
31
+ #define SWIG_RUBY_WSTRING_ENCODING " UTF-32 " SWIG_RUBY_ENDIAN
21
32
#else
22
33
#error unsupported wchar_t size. SWIG_RUBY_WSTRING_ENCODING must be given.
23
34
#endif
You can’t perform that action at this time.
0 commit comments