<stdint.h> was added to allow testing of int64_t. When building with -pedantic the 'long long' is warned about, while using int64_t is accepted nicely. I guess that every system having a 64bit "long long" also has an int64_t, we just need to find the appropriate header...
--strk; On Thu, Jul 06, 2006 at 02:00:55PM -0600, Michael Fuhr wrote: > On Thu, Jul 06, 2006 at 07:55:46AM -0600, Michael Fuhr wrote: > > I'm still having a few problems on Solaris 9/sparc, though. During > > the build I see a lot of the following warnings: > > > > warning: #warning "Could not find 64bit integer definition!" > > warning: right shift count >= width of type > > > > I'm also getting some test failures; see the attached file. > > The problem finding a 64-bit integer type is due to an inability > to compile the PGAC_TYPE_64BIT_INT conftest program. That program > includes <stdint.h>, which doesn't exist on Solaris 9, so the compile > fails, causing the test to fail for all candidate types. I removed > <stdint.h> from the test program; configure then found a 64-bit type: > > checking whether int64_t is 64 bits... no > checking whether long int is 64 bits... no > checking whether long long int is 64 bits... yes > > The PGAC_TYPE_64BIT_INT definition in acsite.m4 appears to be > borrowed from PostgreSQL, although current releases of PostgreSQL > have slightly different code. I've attached the latest definition as > found in config/c-compiler.m4 in the 8.1.4 source code. I replaced > the GEOS acsite.m4 with this file; the build then succeeded and all > tests passed. > > -- > Michael Fuhr > # PGAC_TYPE_64BIT_INT(TYPE) > # ------------------------- > # Check if TYPE is a working 64 bit integer type. Set HAVE_TYPE_64 to > # yes or no respectively, and define HAVE_TYPE_64 if yes. > AC_DEFUN([PGAC_TYPE_64BIT_INT], > [define([Ac_define], [translit([have_$1_64], [a-z *], [A-Z_P])])dnl > define([Ac_cachevar], [translit([pgac_cv_type_$1_64], [ *], [_p])])dnl > AC_CACHE_CHECK([whether $1 is 64 bits], [Ac_cachevar], > [AC_TRY_RUN( > [typedef $1 ac_int64; > > /* > * These are globals to discourage the compiler from folding all the > * arithmetic tests down to compile-time constants. > */ > ac_int64 a = 20000001; > ac_int64 b = 40000005; > > int does_int64_work() > { > ac_int64 c,d; > > if (sizeof(ac_int64) != 8) > return 0; /* definitely not the right size */ > > /* Do perfunctory checks to see if 64-bit arithmetic seems to work */ > c = a * b; > d = (c + b) / b; > if (d != a+1) > return 0; > return 1; > } > main() { > exit(! does_int64_work()); > }], > [Ac_cachevar=yes], > [Ac_cachevar=no], > [# If cross-compiling, check the size reported by the compiler and > # trust that the arithmetic works. > AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [sizeof($1) == 8])], > Ac_cachevar=yes, > Ac_cachevar=no)])]) > > Ac_define=$Ac_cachevar > if test x"$Ac_cachevar" = xyes ; then > AC_DEFINE(Ac_define,, [Define to 1 if `]$1[' works and is 64 bits.]) > fi > undefine([Ac_define])dnl > undefine([Ac_cachevar])dnl > ])# PGAC_TYPE_64BIT_INT > _______________________________________________ > geos-devel mailing list > geos-devel@geos.refractions.net > http://geos.refractions.net/mailman/listinfo/geos-devel -- /"\ ASCII Ribbon Campaign \ / Respect for low technology. X Keep e-mail messages readable by any computer system. / \ Keep it ASCII. _______________________________________________ geos-devel mailing list geos-devel@geos.refractions.net http://geos.refractions.net/mailman/listinfo/geos-devel