glib.h endian macros defined using the glibconfig.h mechanism now

* glib.h
* configure.in: endian macros defined using the glibconfig.h mechanism now

* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings

-Yosh
This commit is contained in:
Manish Singh 1998-11-02 07:04:38 +00:00
parent 7e04691726
commit 840114ac76
13 changed files with 168 additions and 220 deletions

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -1,3 +1,11 @@
Sun Nov 1 23:00:18 PST 1998 Manish Singh <yosh@gimp.org>
* glib.h
* configure.in: endian macros defined using the glibconfig.h
mechanism now
* ghook.c: casts for GHookFunc and GHookCheckFunc to avoid warnings
Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog

View File

@ -613,6 +613,34 @@ $glib_vacopy
$glib_inline
#define G_BYTE_ORDER $g_byte_order
outfile_EOF
g_bit_sizes="16 32"
if test -n "$gint64"; then
g_bit_sizes="$g_bit_sizes 64"
fi
for bits in $g_bit_sizes; do
cat >>$outfile <<outfile_EOF
#define GINT${bits}_TO_${g_bs_native}(val) ((gint${bits}) (val))
#define GUINT${bits}_TO_${g_bs_native}(val) ((guint${bits}) (val))
#define GINT${bits}_TO_${g_bs_alien}(val) ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val))
#define GUINT${bits}_TO_${g_bs_alien}(val) (GUINT${bits}_SWAP_LE_BE (val))
outfile_EOF
done
cat >>$outfile <<outfile_EOF
#define GLONG_TO_LE(val) ((glong) GINT${glongbits}_TO_LE (val))
#define GULONG_TO_LE(val) ((gulong) GUINT${glongbits}_TO_LE (val))
#define GLONG_TO_BE(val) ((glong) GINT${glongbits}_TO_BE (val))
#define GULONG_TO_BE(val) ((gulong) GUINT${glongbits}_TO_BE (val))
#define GINT_TO_LE(val) ((gint) GINT${gintbits}_TO_LE (val))
#define GUINT_TO_LE(val) ((guint) GUINT${gintbits}_TO_LE (val))
#define GINT_TO_BE(val) ((gint) GINT${gintbits}_TO_BE (val))
#define GUINT_TO_BE(val) ((guint) GUINT${gintbits}_TO_BE (val))
$glib_wc
#ifdef __cplusplus
@ -666,20 +694,24 @@ x$ac_cv_header_values_h)
esac
case 2 in
$ac_cv_sizeof_short) gint16=short;;
$ac_cv_sizeof_int) gint16=int;;
$ac_cv_sizeof_short) gint16=short;;
$ac_cv_sizeof_int) gint16=int;;
esac
case 4 in
$ac_cv_sizeof_short) gint32=short;;
$ac_cv_sizeof_int) gint32=int;;
$ac_cv_sizeof_long) gint32=long;;
$ac_cv_sizeof_short) gint32=short;;
$ac_cv_sizeof_int) gint32=int;;
$ac_cv_sizeof_long) gint32=long;;
esac
case 8 in
$ac_cv_sizeof_int) gint64=int;;
$ac_cv_sizeof_long) gint64=long;;
$ac_cv_sizeof_long_long) gint64='long long';;
$ac_cv_sizeof_int) gint64=int;;
$ac_cv_sizeof_long) gint64=long;;
$ac_cv_sizeof_long_long) gint64='long long';;
esac
gintbits=`expr $ac_cv_sizeof_int \* 8`
glongbits=`expr $ac_cv_sizeof_long \* 8`
case $ac_cv_sizeof_void_p in
$ac_cv_sizeof_int) glib_gpi_cast='' glib_gpui_cast='' ;;
$ac_cv_sizeof_long) glib_gpi_cast='(glong)' glib_gpui_cast='(gulong)' ;;
@ -747,8 +779,16 @@ if test x$glib_cv_has__inline__ = xyes; then
fi
case xyes in
x$ac_cv_c_bigendian) g_byte_order=G_BIG_ENDIAN ;;
*) g_byte_order=G_LITTLE_ENDIAN ;;
x$ac_cv_c_bigendian)
g_byte_order=G_BIG_ENDIAN
g_bs_native=BE
g_bs_alien=LE
;;
*)
g_byte_order=G_LITTLE_ENDIAN
g_bs_native=LE
g_bs_alien=BE
;;
esac
if test x$glib_wchar_h = xyes; then

View File

@ -273,7 +273,7 @@ g_hook_list_invoke (GHookList *hook_list,
gboolean was_in_call;
g_hook_ref (hook_list, hook);
func = hook->func;
func = (GHookFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
@ -306,7 +306,7 @@ g_hook_list_invoke_check (GHookList *hook_list,
gboolean need_destroy;
g_hook_ref (hook_list, hook);
func = hook->func;
func = (GHookCheckFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;

128
glib.h
View File

@ -608,112 +608,34 @@ typedef gint32 GTime;
(((guint32) (val) & (guint32) 0x00ff00ffU) << 8) | \
(((guint32) (val) & (guint32) 0xff00ff00U) >> 8)))
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
# define GINT16_TO_LE(val) ((gint16) (val))
# define GUINT16_TO_LE(val) ((guint16) (val))
# define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT16_FROM_LE(val) ((gint16) (val))
# define GUINT16_FROM_LE(val) ((guint16) (val))
# define GINT16_FROM_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_FROM_BE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT32_TO_LE(val) ((gint32) (val))
# define GUINT32_TO_LE(val) ((guint32) (val))
# define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val))
# define GINT32_FROM_LE(val) ((gint32) (val))
# define GUINT32_FROM_LE(val) ((guint32) (val))
# define GINT32_FROM_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_FROM_BE(val) (GUINT32_SWAP_LE_BE (val))
# ifdef G_HAVE_GINT64
# define GINT64_TO_LE(val) ((gint64) (val))
# define GUINT64_TO_LE(val) ((guint64) (val))
# define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val))
# define GINT64_FROM_LE(val) ((gint64) (val))
# define GUINT64_FROM_LE(val) ((guint64) (val))
# define GINT64_FROM_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_FROM_BE(val) (GUINT64_SWAP_LE_BE (val))
# endif
#elif G_BYTE_ORDER == G_BIG_ENDIAN
# define GINT16_TO_BE(val) ((gint16) (val))
# define GUINT16_TO_BE(val) ((guint16) (val))
# define GINT16_TO_LE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_TO_LE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT16_FROM_BE(val) ((gint16) (val))
# define GUINT16_FROM_BE(val) ((guint16) (val))
# define GINT16_FROM_LE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_FROM_LE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT32_TO_BE(val) ((gint32) (val))
# define GUINT32_TO_BE(val) ((guint32) (val))
# define GINT32_TO_LE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_TO_LE(val) (GUINT32_SWAP_LE_BE (val))
# define GINT32_FROM_BE(val) ((gint32) (val))
# define GUINT32_FROM_BE(val) ((guint32) (val))
# define GINT32_FROM_LE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_FROM_LE(val) (GUINT32_SWAP_LE_BE (val))
# ifdef G_HAVE_GINT64
# define GINT64_TO_BE(val) ((gint64) (val))
# define GUINT64_TO_BE(val) ((guint64) (val))
# define GINT64_TO_LE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_TO_LE(val) (GUINT64_SWAP_LE_BE (val))
# define GINT64_FROM_BE(val) ((gint64) (val))
# define GUINT64_FROM_BE(val) ((guint64) (val))
# define GINT64_FROM_LE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_FROM_LE(val) (GUINT64_SWAP_LE_BE (val))
# endif
#else
/* PDP stuff not implemented */
/* The TO_?E stuff is defined in glibconfig.h. The transformation is symmetric,
so the FROM just maps to the TO.
*/
#define GINT16_FROM_LE(val) (GINT16_TO_LE (val))
#define GUINT16_FROM_LE(val) (GUINT16_TO_LE (val))
#define GINT16_FROM_BE(val) (GINT16_TO_BE (val))
#define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val))
#define GINT32_FROM_LE(val) (GINT32_TO_LE (val))
#define GUINT32_FROM_LE(val) (GUINT32_TO_LE (val))
#define GINT32_FROM_BE(val) (GINT32_TO_BE (val))
#define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val))
#ifdef G_HAVE_GINT64
#define GINT64_FROM_LE(val) (GINT32_TO_LE (val))
#define GUINT64_FROM_LE(val) (GUINT32_TO_LE (val))
#define GINT64_FROM_BE(val) (GINT32_TO_BE (val))
#define GUINT64_FROM_BE(val) (GUINT32_TO_BE (val))
#endif
#if (SIZEOF_LONG == 8)
# define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val))
# define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val))
# define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val))
# define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val))
# define GLONG_FROM_LE(val) ((glong) GINT64_FROM_LE (val))
# define GULONG_FROM_LE(val) ((gulong) GUINT64_FROM_LE (val))
# define GLONG_FROM_BE(val) ((glong) GINT64_FROM_BE (val))
# define GULONG_FROM_BE(val) ((gulong) GUINT64_FROM_BE (val))
#elif (SIZEOF_LONG == 4)
# define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val))
# define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val))
# define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val))
# define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val))
# define GLONG_FROM_LE(val) ((glong) GINT32_FROM_LE (val))
# define GULONG_FROM_LE(val) ((gulong) GUINT32_FROM_LE (val))
# define GLONG_FROM_BE(val) ((glong) GINT32_FROM_BE (val))
# define GULONG_FROM_BE(val) ((gulong) GUINT32_FROM_BE (val))
#endif
#define GLONG_FROM_LE(val) (GLONG_TO_LE (val))
#define GULONG_FROM_LE(val) (GULONG_TO_LE (val))
#define GLONG_FROM_BE(val) (GLONG_TO_BE (val))
#define GULONG_FROM_BE(val) (GULONG_TO_BE (val))
#if (SIZEOF_INT == 8)
# define GINT_TO_LE(val) ((gint) GINT64_TO_LE (val))
# define GUINT_TO_LE(val) ((guint) GUINT64_TO_LE (val))
# define GINT_TO_BE(val) ((gint) GINT64_TO_BE (val))
# define GUINT_TO_BE(val) ((guint) GUINT64_TO_BE (val))
# define GINT_FROM_LE(val) ((gint) GINT64_FROM_LE (val))
# define GUINT_FROM_LE(val) ((guint) GUINT64_FROM_LE (val))
# define GINT_FROM_BE(val) ((gint) GINT64_FROM_BE (val))
# define GUINT_FROM_BE(val) ((guint) GUINT64_FROM_BE (val))
#elif (SIZEOF_INT == 4)
# define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val))
# define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val))
# define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val))
# define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val))
# define GINT_FROM_LE(val) ((gint) GINT32_FROM_LE (val))
# define GUINT_FROM_LE(val) ((guint) GUINT32_FROM_LE (val))
# define GINT_FROM_BE(val) ((gint) GINT32_FROM_BE (val))
# define GUINT_FROM_BE(val) ((guint) GUINT32_FROM_BE (val))
#elif (SIZEOF_INT == 2)
# define GINT_TO_LE(val) ((gint) GINT16_TO_LE (val))
# define GUINT_TO_LE(val) ((guint) GUINT16_TO_LE (val))
# define GINT_TO_BE(val) ((gint) GINT16_TO_BE (val))
# define GUINT_TO_BE(val) ((guint) GUINT16_TO_BE (val))
# define GINT_FROM_LE(val) ((gint) GINT16_FROM_LE (val))
# define GUINT_FROM_LE(val) ((guint) GUINT16_FROM_LE (val))
# define GINT_FROM_BE(val) ((gint) GINT16_FROM_BE (val))
# define GUINT_FROM_BE(val) ((guint) GUINT16_FROM_BE (val))
#endif
#define GINT_FROM_LE(val) (GINT_TO_LE (val))
#define GUINT_FROM_LE(val) (GUINT_TO_LE (val))
#define GINT_FROM_BE(val) (GINT_TO_BE (val))
#define GUINT_FROM_BE(val) (GUINT_TO_BE (val))
/* Portable versions of host-network order stuff
*/

View File

@ -273,7 +273,7 @@ g_hook_list_invoke (GHookList *hook_list,
gboolean was_in_call;
g_hook_ref (hook_list, hook);
func = hook->func;
func = (GHookFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;
@ -306,7 +306,7 @@ g_hook_list_invoke_check (GHookList *hook_list,
gboolean need_destroy;
g_hook_ref (hook_list, hook);
func = hook->func;
func = (GHookCheckFunc) hook->func;
was_in_call = G_HOOK_IN_CALL (hook);
hook->flags |= G_HOOK_FLAG_IN_CALL;

View File

@ -608,112 +608,34 @@ typedef gint32 GTime;
(((guint32) (val) & (guint32) 0x00ff00ffU) << 8) | \
(((guint32) (val) & (guint32) 0xff00ff00U) >> 8)))
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
# define GINT16_TO_LE(val) ((gint16) (val))
# define GUINT16_TO_LE(val) ((guint16) (val))
# define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT16_FROM_LE(val) ((gint16) (val))
# define GUINT16_FROM_LE(val) ((guint16) (val))
# define GINT16_FROM_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_FROM_BE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT32_TO_LE(val) ((gint32) (val))
# define GUINT32_TO_LE(val) ((guint32) (val))
# define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val))
# define GINT32_FROM_LE(val) ((gint32) (val))
# define GUINT32_FROM_LE(val) ((guint32) (val))
# define GINT32_FROM_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_FROM_BE(val) (GUINT32_SWAP_LE_BE (val))
# ifdef G_HAVE_GINT64
# define GINT64_TO_LE(val) ((gint64) (val))
# define GUINT64_TO_LE(val) ((guint64) (val))
# define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val))
# define GINT64_FROM_LE(val) ((gint64) (val))
# define GUINT64_FROM_LE(val) ((guint64) (val))
# define GINT64_FROM_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_FROM_BE(val) (GUINT64_SWAP_LE_BE (val))
# endif
#elif G_BYTE_ORDER == G_BIG_ENDIAN
# define GINT16_TO_BE(val) ((gint16) (val))
# define GUINT16_TO_BE(val) ((guint16) (val))
# define GINT16_TO_LE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_TO_LE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT16_FROM_BE(val) ((gint16) (val))
# define GUINT16_FROM_BE(val) ((guint16) (val))
# define GINT16_FROM_LE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
# define GUINT16_FROM_LE(val) (GUINT16_SWAP_LE_BE (val))
# define GINT32_TO_BE(val) ((gint32) (val))
# define GUINT32_TO_BE(val) ((guint32) (val))
# define GINT32_TO_LE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_TO_LE(val) (GUINT32_SWAP_LE_BE (val))
# define GINT32_FROM_BE(val) ((gint32) (val))
# define GUINT32_FROM_BE(val) ((guint32) (val))
# define GINT32_FROM_LE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
# define GUINT32_FROM_LE(val) (GUINT32_SWAP_LE_BE (val))
# ifdef G_HAVE_GINT64
# define GINT64_TO_BE(val) ((gint64) (val))
# define GUINT64_TO_BE(val) ((guint64) (val))
# define GINT64_TO_LE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_TO_LE(val) (GUINT64_SWAP_LE_BE (val))
# define GINT64_FROM_BE(val) ((gint64) (val))
# define GUINT64_FROM_BE(val) ((guint64) (val))
# define GINT64_FROM_LE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
# define GUINT64_FROM_LE(val) (GUINT64_SWAP_LE_BE (val))
# endif
#else
/* PDP stuff not implemented */
/* The TO_?E stuff is defined in glibconfig.h. The transformation is symmetric,
so the FROM just maps to the TO.
*/
#define GINT16_FROM_LE(val) (GINT16_TO_LE (val))
#define GUINT16_FROM_LE(val) (GUINT16_TO_LE (val))
#define GINT16_FROM_BE(val) (GINT16_TO_BE (val))
#define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val))
#define GINT32_FROM_LE(val) (GINT32_TO_LE (val))
#define GUINT32_FROM_LE(val) (GUINT32_TO_LE (val))
#define GINT32_FROM_BE(val) (GINT32_TO_BE (val))
#define GUINT32_FROM_BE(val) (GUINT32_TO_BE (val))
#ifdef G_HAVE_GINT64
#define GINT64_FROM_LE(val) (GINT32_TO_LE (val))
#define GUINT64_FROM_LE(val) (GUINT32_TO_LE (val))
#define GINT64_FROM_BE(val) (GINT32_TO_BE (val))
#define GUINT64_FROM_BE(val) (GUINT32_TO_BE (val))
#endif
#if (SIZEOF_LONG == 8)
# define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val))
# define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val))
# define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val))
# define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val))
# define GLONG_FROM_LE(val) ((glong) GINT64_FROM_LE (val))
# define GULONG_FROM_LE(val) ((gulong) GUINT64_FROM_LE (val))
# define GLONG_FROM_BE(val) ((glong) GINT64_FROM_BE (val))
# define GULONG_FROM_BE(val) ((gulong) GUINT64_FROM_BE (val))
#elif (SIZEOF_LONG == 4)
# define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val))
# define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val))
# define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val))
# define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val))
# define GLONG_FROM_LE(val) ((glong) GINT32_FROM_LE (val))
# define GULONG_FROM_LE(val) ((gulong) GUINT32_FROM_LE (val))
# define GLONG_FROM_BE(val) ((glong) GINT32_FROM_BE (val))
# define GULONG_FROM_BE(val) ((gulong) GUINT32_FROM_BE (val))
#endif
#define GLONG_FROM_LE(val) (GLONG_TO_LE (val))
#define GULONG_FROM_LE(val) (GULONG_TO_LE (val))
#define GLONG_FROM_BE(val) (GLONG_TO_BE (val))
#define GULONG_FROM_BE(val) (GULONG_TO_BE (val))
#if (SIZEOF_INT == 8)
# define GINT_TO_LE(val) ((gint) GINT64_TO_LE (val))
# define GUINT_TO_LE(val) ((guint) GUINT64_TO_LE (val))
# define GINT_TO_BE(val) ((gint) GINT64_TO_BE (val))
# define GUINT_TO_BE(val) ((guint) GUINT64_TO_BE (val))
# define GINT_FROM_LE(val) ((gint) GINT64_FROM_LE (val))
# define GUINT_FROM_LE(val) ((guint) GUINT64_FROM_LE (val))
# define GINT_FROM_BE(val) ((gint) GINT64_FROM_BE (val))
# define GUINT_FROM_BE(val) ((guint) GUINT64_FROM_BE (val))
#elif (SIZEOF_INT == 4)
# define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val))
# define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val))
# define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val))
# define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val))
# define GINT_FROM_LE(val) ((gint) GINT32_FROM_LE (val))
# define GUINT_FROM_LE(val) ((guint) GUINT32_FROM_LE (val))
# define GINT_FROM_BE(val) ((gint) GINT32_FROM_BE (val))
# define GUINT_FROM_BE(val) ((guint) GUINT32_FROM_BE (val))
#elif (SIZEOF_INT == 2)
# define GINT_TO_LE(val) ((gint) GINT16_TO_LE (val))
# define GUINT_TO_LE(val) ((guint) GUINT16_TO_LE (val))
# define GINT_TO_BE(val) ((gint) GINT16_TO_BE (val))
# define GUINT_TO_BE(val) ((guint) GUINT16_TO_BE (val))
# define GINT_FROM_LE(val) ((gint) GINT16_FROM_LE (val))
# define GUINT_FROM_LE(val) ((guint) GUINT16_FROM_LE (val))
# define GINT_FROM_BE(val) ((gint) GINT16_FROM_BE (val))
# define GUINT_FROM_BE(val) ((guint) GUINT16_FROM_BE (val))
#endif
#define GINT_FROM_LE(val) (GINT_TO_LE (val))
#define GUINT_FROM_LE(val) (GUINT_TO_LE (val))
#define GINT_FROM_BE(val) (GINT_TO_BE (val))
#define GUINT_FROM_BE(val) (GUINT_TO_BE (val))
/* Portable versions of host-network order stuff
*/