Skip to content

Commit

Permalink
Fix gsize for 64-bit Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hiberis authored and vargaz committed Feb 22, 2011
1 parent a7c3c38 commit 21528f9
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions eglib/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)

AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_FUNCS(strndup strlcpy getpwuid_r strtok_r rewinddir vasprintf)
AM_CONDITIONAL(NEED_VASPRINTF, test x$have_vasprintf = x )
AC_CHECK_LIB(iconv, iconv_open, LIBS="$LIBS -liconv")
Expand Down Expand Up @@ -134,7 +136,16 @@ AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localch
AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
AC_SUBST(HAVE_ALLOCA_H)

if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_int; then
GPOINTER_TO_INT="((gint) (ptr))"
GPOINTER_TO_UINT="((guint) (ptr))"
GINT_TO_POINTER="((gpointer) (v))"
GUINT_TO_POINTER="((gpointer) (v))"
GSIZE="int"
GSIZE_FORMAT='"u"'
G_GUINT64_FORMAT='"llu"'
G_GINT64_FORMAT='"lld"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long; then
GPOINTER_TO_INT="((gint)(long) (ptr))"
GPOINTER_TO_UINT="((guint)(long) (ptr))"
GINT_TO_POINTER="((gpointer)(glong) (v))"
Expand All @@ -143,15 +154,17 @@ if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
GSIZE_FORMAT='"lu"'
G_GUINT64_FORMAT='"lu"'
G_GINT64_FORMAT='"ld"'
elif test $ac_cv_sizeof_void_p = $ac_cv_sizeof_long_long; then
GPOINTER_TO_INT="((gint)(long long) (ptr))"
GPOINTER_TO_UINT="((guint)(unsigned long long) (ptr))"
GINT_TO_POINTER="((gpointer)(long long) (v))"
GUINT_TO_POINTER="((gpointer)(unsigned long long) (v))"
GSIZE="long long"
GSIZE_FORMAT='"I64u"'
G_GUINT64_FORMAT='"I64u"'
G_GINT64_FORMAT='"I64i"'
else
GPOINTER_TO_INT="((gint) (ptr))"
GPOINTER_TO_UINT="((guint) (ptr))"
GINT_TO_POINTER="((gpointer) (v))"
GUINT_TO_POINTER="((gpointer) (v))"
GSIZE="int"
GSIZE_FORMAT='"u"'
G_GUINT64_FORMAT='"llu"'
G_GINT64_FORMAT='"lld"'
AC_MSG_ERROR([unsupported pointer size])
fi

AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
Expand Down

0 comments on commit 21528f9

Please sign in to comment.