From 4e2aaa23727e66741c3a08d3bd48cdc6b2f15da2 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Mon, 20 Jul 1998 15:53:36 +0000 Subject: [PATCH] Add gint64/guint64 if possible (HAVE_GINT64 is defined if we have it, Add gint64/guint64 if possible (HAVE_GINT64 is defined if we have it, since I don't think "long long" works on 32-bit platforms that don't have gcc... --- configure.in | 1 + glib.h | 14 ++++++++++++++ glib/glib.h | 14 ++++++++++++++ glibconfig.h.in | 3 +++ 4 files changed, 32 insertions(+) diff --git a/configure.in b/configure.in index 7c8c89a..9983915 100644 --- a/configure.in +++ b/configure.in @@ -120,6 +120,7 @@ AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(long long) # long doubles were not used, and a portability problem # AC_C_LONG_DOUBLE diff --git a/glib.h b/glib.h index ee81a61..7735161 100644 --- a/glib.h +++ b/glib.h @@ -411,6 +411,20 @@ typedef signed long gint32; typedef unsigned long guint32; #endif /* SIZEOF_INT */ +#if (SIZEOF_LONG == 8) +#define HAVE_GINT64 1 +typedef signed long gint64; +typedef unsigned long gint64; +#elif (SIZEOF_LONG_LONG == 8) +#define HAVE_GINT64 1 +typedef signed long long gint64; +typedef unsigned long long guint64; +#else +/* No gint64 */ +#undef HAVE_GINT64 +#endif + + /* Define macros for storing integers inside pointers */ #if (SIZEOF_INT == SIZEOF_VOID_P) diff --git a/glib/glib.h b/glib/glib.h index ee81a61..7735161 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -411,6 +411,20 @@ typedef signed long gint32; typedef unsigned long guint32; #endif /* SIZEOF_INT */ +#if (SIZEOF_LONG == 8) +#define HAVE_GINT64 1 +typedef signed long gint64; +typedef unsigned long gint64; +#elif (SIZEOF_LONG_LONG == 8) +#define HAVE_GINT64 1 +typedef signed long long gint64; +typedef unsigned long long guint64; +#else +/* No gint64 */ +#undef HAVE_GINT64 +#endif + + /* Define macros for storing integers inside pointers */ #if (SIZEOF_INT == SIZEOF_VOID_P) diff --git a/glibconfig.h.in b/glibconfig.h.in index 09cb42c..ca9c62c 100644 --- a/glibconfig.h.in +++ b/glibconfig.h.in @@ -56,6 +56,9 @@ /* The number of bytes in a void *. */ #undef SIZEOF_VOID_P +/* The number of bytes in a long long. */ +#undef SIZEOF_LONG_LONG + /* Define if you have the atexit function. */ #undef HAVE_ATEXIT -- 2.7.4