Branch: Tag:

2002-04-11

2002-04-11 22:09:21 by Martin Stjernholm <mast@lysator.liu.se>

Fixed the broken sprintf modifier tests. This required the choice of
FLOAT_TYPE and INT_TYPE to be moved from global.h to the configure script.

Rev: src/acconfig.h:1.98
Rev: src/aclocal.m4:1.42
Rev: src/configure.in:1.581
Rev: src/global.h:1.68

1: - AC_REVISION("$Id: configure.in,v 1.580 2002/04/11 18:56:56 mast Exp $") + AC_REVISION("$Id: configure.in,v 1.581 2002/04/11 22:08:49 mast Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
957:    MY_DESCR([--with-lib-path],    [a list of paths to search for libraries.]))    - MY_AC_ARG_WITH(double-precision, MY_DESCR([--with-double-precision], -  [use double precision floats]), -  [ AC_DEFINE(WITH_DOUBLE_PRECISION_SVALUE) ]) - MY_AC_ARG_WITH(long-double-precision, MY_DESCR([--with-long-double-precision], -  [use long double precision floats]), -  [ AC_DEFINE(WITH_LONG_DOUBLE_PRECISION_SVALUE) ]) + AC_ARG_WITH(long-double-precision, MY_DESCR([--with-long-double-precision], +  [use long double precision floats])) + AC_ARG_WITH(double-precision, MY_DESCR([--with-double-precision], +  [use double precision floats]))    - MY_AC_ARG_WITH(long-int, MY_DESCR([--with-long-int], -  [use long native type int (EXPERIMENTAL)]), -  [ AC_DEFINE(WITH_LONG_INT) ]) - MY_AC_ARG_WITH(long-long-int, MY_DESCR([--with-long-long-int], -  [use long long native type int (EXPERIMENTAL)]), -  [ AC_DEFINE(WITH_LONG_LONG_INT) ]) - MY_AC_ARG_WITH(short-int, MY_DESCR([--with-short-int], -  [use short native type int (EXPERIMENTAL)]), -  [ AC_DEFINE(WITH_SHORT_INT) ]) - MY_AC_ARG_WITH(int-int, MY_DESCR([--with-int-int], -  [use int native type int (EXPERIMENTAL)]), -  [ AC_DEFINE(WITH_INT_INT) ]) + AC_ARG_WITH(long-long-int, MY_DESCR([--with-long-long-int], +  [use long long native type int (EXPERIMENTAL)])) + AC_ARG_WITH(long-int, MY_DESCR([--with-long-int], +  [use long native type int (EXPERIMENTAL)])) + AC_ARG_WITH(int-int, MY_DESCR([--with-int-int], +  [use int native type int])) + AC_ARG_WITH(short-int, MY_DESCR([--with-short-int], +  [use short native type int (EXPERIMENTAL)]))      AC_ARG_WITH(gdbm, MY_DESCR([--without-gdbm],[no GNU database manager support]))   AC_ARG_WITH(gmp, MY_DESCR([--without-gmp],[no support for Gmp bignums]))
2074:   AC_CHECK_SIZEOF(short, 2)   AC_CHECK_SIZEOF(float, 4)   AC_CHECK_SIZEOF(double, 8) + AC_CHECK_SIZEOF(long double, 0)   AC_CHECK_SIZEOF(long, 4) - AC_CHECK_SIZEOF(long long, 8) - AC_CHECK_SIZEOF(__int64, 8) + AC_CHECK_SIZEOF(long long, 0) + AC_CHECK_SIZEOF(__int64, 0)      AC_MY_CHECK_TYPE(size_t,unsigned long)   AC_MY_CHECK_TYPE(ptrdiff_t,long)
2087:   AC_MY_CHECK_TYPE(time_t,INT32)   AC_MY_CHECK_TYPE(pri_t, short)    + if test "x$with_long_double_precision" = x -a \ +  "x$with_double_precision" = x ; then +  # Choose the longest available float that fits in a pointer. +  if test $ac_cv_sizeof_long_double != 0 -a \ +  $ac_cv_sizeof_long_double -le $ac_cv_sizeof_char_p ; then +  with_long_double_precision=yes +  elif test $ac_cv_sizeof_double -le $ac_cv_sizeof_char_p ; then +  with_double_precision=yes +  fi + fi +  + if test $ac_cv_sizeof_long_double != 0 -a \ +  "x$with_long_double_precision" = xyes ; then +  AC_DEFINE(WITH_LONG_DOUBLE_PRECISION_SVALUE) +  AC_DEFINE(FLOAT_TYPE, long double) +  AC_DEFINE(SIZEOF_FLOAT_TYPE, SIZEOF_LONG_DOUBLE) + elif test "x$with_double_precision" = xyes ; then +  AC_DEFINE(WITH_DOUBLE_PRECISION_SVALUE) +  AC_DEFINE(FLOAT_TYPE, double) +  AC_DEFINE(SIZEOF_FLOAT_TYPE, SIZEOF_DOUBLE) + else +  AC_DEFINE(FLOAT_TYPE, float) +  AC_DEFINE(SIZEOF_FLOAT_TYPE, SIZEOF_FLOAT) + fi +  + if test "x$with_long_long_int" = x -a \ +  "x$with_long_int" = x -a \ +  "x$with_int_int" = x -a \ +  "x$with_short_int" = x ; then +  # Choose the longest available integer that fits in a pointer. + # Turn this on when it works and the typing is corrected everywhere. + # if test $ac_cv_sizeof_long_long != 0 -a \ + # $ac_cv_sizeof_long_long -le $ac_cv_sizeof_char_p ; then + # # This isn't a good idea on architectures where + # # sizeof(long int) < sizeof(LONGEST). + # # This is due to the gmp mpz api's using long int instead of + # # mp_limb_{signed_}t. + # #with_long_long_int=yes + # : + # fi + # if test $ac_cv_sizeof_long -le $ac_cv_sizeof_char_p ; then + # with_long_int=yes + # else + # with_int_int=yes + # fi +  : + fi +  + if test $ac_cv_sizeof_long_long != 0 -a \ +  "x$with_long_long_int" = xyes ; then +  AC_DEFINE(WITH_LONG_LONG_INT) +  AC_DEFINE(INT_TYPE, long long) +  AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_LONG_LONG) + elif test "x$with_long_int" = xyes ; then +  AC_DEFINE(WITH_LONG_INT) +  AC_DEFINE(INT_TYPE, long) +  AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_LONG) + elif test "x$with_short_int" = xyes ; then +  AC_DEFINE(WITH_SHORT_INT) +  AC_DEFINE(INT_TYPE, short) +  AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_SHORT) + else +  AC_DEFINE(WITH_INT_INT) +  AC_DEFINE(INT_TYPE, int) +  AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_INT) + fi +    AC_TYPE_SIGNAL      dnl AC_CHECK_LIB(PW, alloca)
5149:      #######################################################################    - AC_MSG_CHECKING(how to printf size_t) - AC_CACHE_VAL(pike_cv_printf_size_t, -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(size_t)>4) -  { -  sprintf(buf,"%llu,%d",((size_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%llu,%d",(size_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_size_t="ll"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(size_t)>4) -  { -  sprintf(buf,"%u,%d",((size_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%u,%d",(size_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_size_t=""], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(size_t)>4) -  { -  sprintf(buf,"%Lu,%d",((size_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%Lu,%d",(size_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_size_t="L"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(size_t)>4) -  { -  sprintf(buf,"%lu,%d",((size_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%lu,%d",(size_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_size_t="l"], -  [AC_MSG_CHECKING([(none found?)]) -  pike_cv_printf_size_t=""], -  [?])], -  [?])], -  [?])], -  [?]) - ]) - AC_MSG_RESULT([%${pike_cv_printf_size_t}u, %${pike_cv_printf_size_t}x]) - AC_DEFINE_UNQUOTED(PRINTSIZET,"$pike_cv_printf_size_t") + MY_AC_CHECK_PRINTF_INT_TYPE(size_t, +  "ll" "" "L" "l", "", +  PRINTSIZET, +  [%${res}u, %${res}x]) + MY_AC_CHECK_PRINTF_INT_TYPE(ptrdiff_t, +  "ll" "" "L" "l", "", +  PRINTPTRDIFFT, +  [%${res}d, %${res}x]) + MY_AC_CHECK_PRINTF_INT_TYPE(INT_TYPE, +  "ll" "" "L" "l", "", +  PRINTPIKEINT, +  [%${res}d, %${res}x]) + MY_AC_CHECK_PRINTF_FLOAT_TYPE(FLOAT_TYPE, +  "" "L" "ll" "l", "", +  PRINTPIKEFLOAT, +  [%${res}g, %${res}f])    - AC_MSG_CHECKING(how to printf ptrdiff_t) - AC_CACHE_VAL(pike_cv_printf_ptrdiff_t, -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(ptrdiff_t)>4) -  { -  sprintf(buf,"%lld,%d",((ptrdiff_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%lld,%d",(ptrdiff_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_ptrdiff_t="ll"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(ptrdiff_t)>4) -  { -  sprintf(buf,"%d,%d",((ptrdiff_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%d,%d",(ptrdiff_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_ptrdiff_t=""], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(ptrdiff_t)>4) -  { -  sprintf(buf,"%Ld,%d",((ptrdiff_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%Ld,%d",(ptrdiff_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_ptrdiff_t="L"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(ptrdiff_t)>4) -  { -  sprintf(buf,"%ld,%d",((ptrdiff_t)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%ld,%d",(ptrdiff_t)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_ptrdiff_t="l"], -  [AC_MSG_CHECKING([(none found?)]) -  pike_cv_printf_ptrdiff_t=""], -  [?])], -  [?])], -  [?])], -  [?]) - ]) - AC_MSG_RESULT([%${pike_cv_printf_ptrdiff_t}d, %${pike_cv_printf_ptrdiff_t}x]) - AC_DEFINE_UNQUOTED(PRINTPTRDIFFT,"$pike_cv_printf_ptrdiff_t") -  - AC_MSG_CHECKING(how to printf INT_TYPE) - AC_CACHE_VAL(pike_cv_printf_int_type, -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(INT_TYPE)>4) -  { -  sprintf(buf,"%lld,%d",((INT_TYPE)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%lld,%d",(INT_TYPE)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_int_type="ll"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(INT_TYPE)>4) -  { -  sprintf(buf,"%d,%d",((INT_TYPE)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%d,%d",(INT_TYPE)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_int_type=""], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(INT_TYPE)>4) -  { -  sprintf(buf,"%Ld,%d",((INT_TYPE)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%Ld,%d",(INT_TYPE)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_int_type="L"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  if (sizeof(INT_TYPE)>4) -  { -  sprintf(buf,"%ld,%d",((INT_TYPE)4711)<<32,17); -  return !!strcmp("20233590931456,17",buf); -  } -  else -  { -  sprintf(buf,"%ld,%d",(INT_TYPE)4711,17); -  return !!strcmp("4711,17",buf); -  } -  }], -  [pike_cv_printf_int_type="l"], -  [AC_MSG_CHECKING([(none found?)]) -  pike_cv_printf_int_type=""], -  [?])], -  [?])], -  [?])], -  [?]) - ]) - AC_MSG_RESULT([%${pike_cv_printf_int_type}d, %${pike_cv_printf_int_type}x]) - AC_DEFINE_UNQUOTED(PRINTPIKEINT,"$pike_cv_printf_int_type") -  - AC_MSG_CHECKING(how to printf FLOAT_TYPE) - AC_CACHE_VAL(pike_cv_printf_float_type, -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  sprintf(buf,"%4.1f,%d",(FLOAT_TYPE)17.0,17); -  return !!strcmp("17.0,17",buf); -  }], -  [pike_cv_printf_float_type=""], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  sprintf(buf,"%L4.1f,%d",(FLOAT_TYPE)17.0,17); -  return !!strcmp("17.0,17",buf); -  }], -  [pike_cv_printf_float_type="L"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  sprintf(buf,"%ll4.1f,%d",(FLOAT_TYPE)17.0,17); -  return !!strcmp("17.0,17",buf); -  }], -  [pike_cv_printf_float_type="ll"], -  [AC_TRY_RUN([#include <stdio.h> -  #include "global.h" -  int main() { -  char buf[32]; -  sprintf(buf,"%l4.1f,%d",(FLOAT_TYPE)17.0,17); -  return !!strcmp("17.0,17",buf); -  }], -  [pike_cv_printf_float_type="l"], -  [AC_MSG_CHECKING([(none found?)]) -  pike_cv_printf_float_type=""], -  [?])], -  [?])], -  [?])], -  [?]) - ]) - AC_MSG_RESULT([%${pike_cv_printf_float_type}g, %${pike_cv_printf_float_type}f]) - AC_DEFINE_UNQUOTED(PRINTPIKEFLOAT,"$pike_cv_printf_float_type") -  +    #######################################################################      AC_MSG_CHECKING(if union initialization works)