Use the output of AC_C_BIGENDIAN to determine whether or not dcopc should be big endian

Thanks to Julius Schwartzenberg for the patch!


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1256944 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 64783c0d44
commit 766f87fcc9

@ -95,20 +95,16 @@ gboolean dcop_marshal_uint32( dcop_data *data, unsigned int val )
g_assert( sizeof( unsigned int ) == 4 );
#ifdef __BIG_ENDIAN__
#ifdef WORDS_BIGENDIAN
buf[0] = val;
buf[1] = val >> 8;
buf[2] = val >> 16;
buf[3] = val >> 24;
#endif
#ifdef __LITTLE_ENDIAN__
#else
buf[3] = val;
buf[2] = val >> 8;
buf[1] = val >> 16;
buf[0] = val >> 24;
#endif
#if (!defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN))
#error "You cannot compile the DCOP C bindings without defining either __LITTLE_ENDIAN or __BIG_ENDIAN"
#endif
return dcop_marshal_raw( data, buf, 4 );
@ -121,20 +117,16 @@ gboolean dcop_demarshal_uint32( dcop_data *data, unsigned int *val )
if ( !dcop_data_check_size( data, 4 ) )
return FALSE;
#ifdef __BIG_ENDIAN__
#ifdef WORDS_BIGENDIAN
*val = (data->cur[3] << 24) |
(data->cur[2] << 16) |
(data->cur[1] << 8) |
data->cur[0];
#endif
#ifdef __LITTLE_ENDIAN__
#else
*val = (data->cur[0] << 24) |
(data->cur[1] << 16) |
(data->cur[2] << 8) |
data->cur[3];
#endif
#if (!defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN))
#error "You cannot compile the DCOP C bindings without defining either __LITTLE_ENDIAN or __BIG_ENDIAN"
#endif
data->cur += 4;

Loading…
Cancel
Save