Merge branch 'andreas-schwab-master'
* andreas-schwab-master: Ruby wstring - only include endian.h on linux
This commit is contained in:
commit
a6dc8821c2
1 changed files with 13 additions and 2 deletions
|
|
@ -1,4 +1,15 @@
|
||||||
%{
|
%{
|
||||||
|
#if defined(__linux__)
|
||||||
|
#include <endian.h>
|
||||||
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
|
#define SWIG_RUBY_ENDIAN "LE"
|
||||||
|
#elif BYTE_ORDER == BIG_ENDIAN
|
||||||
|
#define SWIG_RUBY_ENDIAN "BE"
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define SWIG_RUBY_ENDIAN "LE"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -15,9 +26,9 @@ extern "C" {
|
||||||
#ifndef SWIG_RUBY_WSTRING_ENCODING
|
#ifndef SWIG_RUBY_WSTRING_ENCODING
|
||||||
|
|
||||||
#if WCHAR_MAX == 0x7fff || WCHAR_MAX == 0xffff
|
#if WCHAR_MAX == 0x7fff || WCHAR_MAX == 0xffff
|
||||||
#define SWIG_RUBY_WSTRING_ENCODING "UTF-16LE"
|
#define SWIG_RUBY_WSTRING_ENCODING "UTF-16" SWIG_RUBY_ENDIAN
|
||||||
#elif WCHAR_MAX == 0x7fffffff || WCHAR_MAX == 0xffffffff
|
#elif WCHAR_MAX == 0x7fffffff || WCHAR_MAX == 0xffffffff
|
||||||
#define SWIG_RUBY_WSTRING_ENCODING "UTF-32LE"
|
#define SWIG_RUBY_WSTRING_ENCODING "UTF-32" SWIG_RUBY_ENDIAN
|
||||||
#else
|
#else
|
||||||
#error unsupported wchar_t size. SWIG_RUBY_WSTRING_ENCODING must be given.
|
#error unsupported wchar_t size. SWIG_RUBY_WSTRING_ENCODING must be given.
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue