Changeset 514


Ignore:
Timestamp:
May 15, 2014 9:41:06 AM (5 years ago)
Author:
kulshres
Message:

regenerate files

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

Location:
trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/Makefile.in

    r500 r514  
    285285FGREP = @FGREP@
    286286GREP = @GREP@
     287HAVE_CXX11 = @HAVE_CXX11@
    287288INSTALL = @INSTALL@
    288289INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/Makefile.in

    r472 r514  
    280280FGREP = @FGREP@
    281281GREP = @GREP@
     282HAVE_CXX11 = @HAVE_CXX11@
    282283INSTALL = @INSTALL@
    283284INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/Makefile.in

    r472 r514  
    218218FGREP = @FGREP@
    219219GREP = @GREP@
     220HAVE_CXX11 = @HAVE_CXX11@
    220221INSTALL = @INSTALL@
    221222INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/checkpointing/Makefile.in

    r472 r514  
    208208FGREP = @FGREP@
    209209GREP = @GREP@
     210HAVE_CXX11 = @HAVE_CXX11@
    210211INSTALL = @INSTALL@
    211212INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/clock/Makefile.in

    r472 r514  
    156156FGREP = @FGREP@
    157157GREP = @GREP@
     158HAVE_CXX11 = @HAVE_CXX11@
    158159INSTALL = @INSTALL@
    159160INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/cuda/Makefile.in

    r472 r514  
    156156FGREP = @FGREP@
    157157GREP = @GREP@
     158HAVE_CXX11 = @HAVE_CXX11@
    158159INSTALL = @INSTALL@
    159160INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/detexam/Makefile.in

    r472 r514  
    212212FGREP = @FGREP@
    213213GREP = @GREP@
     214HAVE_CXX11 = @HAVE_CXX11@
    214215INSTALL = @INSTALL@
    215216INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/ext_diff_func/Makefile.in

    r472 r514  
    208208FGREP = @FGREP@
    209209GREP = @GREP@
     210HAVE_CXX11 = @HAVE_CXX11@
    210211INSTALL = @INSTALL@
    211212INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/fixpoint_exam/Makefile.in

    r472 r514  
    208208FGREP = @FGREP@
    209209GREP = @GREP@
     210HAVE_CXX11 = @HAVE_CXX11@
    210211INSTALL = @INSTALL@
    211212INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/helm/Makefile.in

    r472 r514  
    212212FGREP = @FGREP@
    213213GREP = @GREP@
     214HAVE_CXX11 = @HAVE_CXX11@
    214215INSTALL = @INSTALL@
    215216INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/hessmat/Makefile.in

    r472 r514  
    208208FGREP = @FGREP@
    209209GREP = @GREP@
     210HAVE_CXX11 = @HAVE_CXX11@
    210211INSTALL = @INSTALL@
    211212INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/lighthouse/Makefile.in

    r472 r514  
    223223FGREP = @FGREP@
    224224GREP = @GREP@
     225HAVE_CXX11 = @HAVE_CXX11@
    225226INSTALL = @INSTALL@
    226227INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/lufact/Makefile.in

    r472 r514  
    212212FGREP = @FGREP@
    213213GREP = @GREP@
     214HAVE_CXX11 = @HAVE_CXX11@
    214215INSTALL = @INSTALL@
    215216INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/ode/Makefile.in

    r472 r514  
    220220FGREP = @FGREP@
    221221GREP = @GREP@
     222HAVE_CXX11 = @HAVE_CXX11@
    222223INSTALL = @INSTALL@
    223224INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/openmp_exam/Makefile.in

    r472 r514  
    212212FGREP = @FGREP@
    213213GREP = @GREP@
     214HAVE_CXX11 = @HAVE_CXX11@
    214215INSTALL = @INSTALL@
    215216INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/pow/Makefile.in

    r472 r514  
    208208FGREP = @FGREP@
    209209GREP = @GREP@
     210HAVE_CXX11 = @HAVE_CXX11@
    210211INSTALL = @INSTALL@
    211212INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/scal/Makefile.in

    r472 r514  
    208208FGREP = @FGREP@
    209209GREP = @GREP@
     210HAVE_CXX11 = @HAVE_CXX11@
    210211INSTALL = @INSTALL@
    211212INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/sparse/Makefile.in

    r472 r514  
    226226FGREP = @FGREP@
    227227GREP = @GREP@
     228HAVE_CXX11 = @HAVE_CXX11@
    228229INSTALL = @INSTALL@
    229230INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/speelpenning/Makefile.in

    r472 r514  
    208208FGREP = @FGREP@
    209209GREP = @GREP@
     210HAVE_CXX11 = @HAVE_CXX11@
    210211INSTALL = @INSTALL@
    211212INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/tapesave/Makefile.in

    r472 r514  
    212212FGREP = @FGREP@
    213213GREP = @GREP@
     214HAVE_CXX11 = @HAVE_CXX11@
    214215INSTALL = @INSTALL@
    215216INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/taylor/Makefile.in

    r472 r514  
    228228FGREP = @FGREP@
    229229GREP = @GREP@
     230HAVE_CXX11 = @HAVE_CXX11@
    230231INSTALL = @INSTALL@
    231232INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/examples/additional_examples/timing/Makefile.in

    r472 r514  
    298298FGREP = @FGREP@
    299299GREP = @GREP@
     300HAVE_CXX11 = @HAVE_CXX11@
    300301INSTALL = @INSTALL@
    301302INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/include/Makefile.in

    r472 r514  
    216216FGREP = @FGREP@
    217217GREP = @GREP@
     218HAVE_CXX11 = @HAVE_CXX11@
    218219INSTALL = @INSTALL@
    219220INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/include/adolc/Makefile.in

    r472 r514  
    248248FGREP = @FGREP@
    249249GREP = @GREP@
     250HAVE_CXX11 = @HAVE_CXX11@
    250251INSTALL = @INSTALL@
    251252INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/include/adolc/drivers/Makefile.in

    r472 r514  
    205205FGREP = @FGREP@
    206206GREP = @GREP@
     207HAVE_CXX11 = @HAVE_CXX11@
    207208INSTALL = @INSTALL@
    208209INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/include/adolc/sparse/Makefile.in

    r472 r514  
    205205FGREP = @FGREP@
    206206GREP = @GREP@
     207HAVE_CXX11 = @HAVE_CXX11@
    207208INSTALL = @INSTALL@
    208209INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/include/adolc/tapedoc/Makefile.in

    r472 r514  
    205205FGREP = @FGREP@
    206206GREP = @GREP@
     207HAVE_CXX11 = @HAVE_CXX11@
    207208INSTALL = @INSTALL@
    208209INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/src/Makefile.in

    r472 r514  
    316316FGREP = @FGREP@
    317317GREP = @GREP@
     318HAVE_CXX11 = @HAVE_CXX11@
    318319INSTALL = @INSTALL@
    319320INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/src/config.h.in

    r462 r514  
    3636/* Define if the compiler provides __builtin_expect */
    3737#undef HAVE_BUILTIN_EXPECT
     38
     39/* define if the compiler supports basic C++11 syntax */
     40#undef HAVE_CXX11
    3841
    3942/* Define to 1 if you have the <dlfcn.h> header file. */
  • trunk/ADOL-C/src/drivers/Makefile.in

    r472 r514  
    207207FGREP = @FGREP@
    208208GREP = @GREP@
     209HAVE_CXX11 = @HAVE_CXX11@
    209210INSTALL = @INSTALL@
    210211INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/src/sparse/Makefile.in

    r472 r514  
    206206FGREP = @FGREP@
    207207GREP = @GREP@
     208HAVE_CXX11 = @HAVE_CXX11@
    208209INSTALL = @INSTALL@
    209210INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/src/tapedoc/Makefile.in

    r472 r514  
    206206FGREP = @FGREP@
    207207GREP = @GREP@
     208HAVE_CXX11 = @HAVE_CXX11@
    208209INSTALL = @INSTALL@
    209210INSTALL_DATA = @INSTALL_DATA@
  • trunk/ADOL-C/test/Makefile.in

    r472 r514  
    215215FGREP = @FGREP@
    216216GREP = @GREP@
     217HAVE_CXX11 = @HAVE_CXX11@
    217218INSTALL = @INSTALL@
    218219INSTALL_DATA = @INSTALL_DATA@
  • trunk/Makefile.in

    r482 r514  
    285285FGREP = @FGREP@
    286286GREP = @GREP@
     287HAVE_CXX11 = @HAVE_CXX11@
    287288INSTALL = @INSTALL@
    288289INSTALL_DATA = @INSTALL_DATA@
  • trunk/aclocal.m4

    r472 r514  
    2020If you have problems, you may need to regenerate the build system entirely.
    2121To do so, use the procedure documented by the package, typically 'autoreconf'.])])
     22
     23# ============================================================================
     24#  http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
     25# ============================================================================
     26#
     27# SYNOPSIS
     28#
     29#   AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
     30#
     31# DESCRIPTION
     32#
     33#   Check for baseline language coverage in the compiler for the C++11
     34#   standard; if necessary, add switches to CXXFLAGS to enable support.
     35#
     36#   The first argument, if specified, indicates whether you insist on an
     37#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
     38#   -std=c++11).  If neither is specified, you get whatever works, with
     39#   preference for an extended mode.
     40#
     41#   The second argument, if specified 'mandatory' or if left unspecified,
     42#   indicates that baseline C++11 support is required and that the macro
     43#   should error out if no mode with that support is found.  If specified
     44#   'optional', then configuration proceeds regardless, after defining
     45#   HAVE_CXX11 if and only if a supporting mode is found.
     46#
     47# LICENSE
     48#
     49#   Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
     50#   Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
     51#   Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
     52#
     53#   Copying and distribution of this file, with or without modification, are
     54#   permitted in any medium without royalty provided the copyright notice
     55#   and this notice are preserved. This file is offered as-is, without any
     56#   warranty.
     57
     58#serial 3
     59
     60m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
     61  template <typename T>
     62    struct check
     63    {
     64      static_assert(sizeof(int) <= sizeof(T), "not big enough");
     65    };
     66
     67    typedef check<check<bool>> right_angle_brackets;
     68
     69    int a;
     70    decltype(a) b;
     71
     72    typedef check<int> check_type;
     73    check_type c;
     74    check_type&& cr = static_cast<check_type&&>(c);
     75
     76    auto d = a;
     77])
     78
     79AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
     80  m4_if([$1], [], [],
     81        [$1], [ext], [],
     82        [$1], [noext], [],
     83        [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
     84  m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
     85        [$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
     86        [$2], [optional], [ax_cxx_compile_cxx11_required=false],
     87        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])dnl
     88  AC_LANG_PUSH([C++])dnl
     89  ac_success=no
     90  AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
     91  ax_cv_cxx_compile_cxx11,
     92  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
     93    [ax_cv_cxx_compile_cxx11=yes],
     94    [ax_cv_cxx_compile_cxx11=no])])
     95  if test x$ax_cv_cxx_compile_cxx11 = xyes; then
     96    ac_success=yes
     97  fi
     98
     99  m4_if([$1], [noext], [], [dnl
     100  if test x$ac_success = xno; then
     101    for switch in -std=gnu++11 -std=gnu++0x; do
     102      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
     103      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
     104                     $cachevar,
     105        [ac_save_CXXFLAGS="$CXXFLAGS"
     106         CXXFLAGS="$CXXFLAGS $switch"
     107         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
     108          [eval $cachevar=yes],
     109          [eval $cachevar=no])
     110         CXXFLAGS="$ac_save_CXXFLAGS"])
     111      if eval test x\$$cachevar = xyes; then
     112        CXXFLAGS="$CXXFLAGS $switch"
     113        ac_success=yes
     114        break
     115      fi
     116    done
     117  fi])
     118
     119  m4_if([$1], [ext], [], [dnl
     120  if test x$ac_success = xno; then
     121    for switch in -std=c++11 -std=c++0x; do
     122      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
     123      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
     124                     $cachevar,
     125        [ac_save_CXXFLAGS="$CXXFLAGS"
     126         CXXFLAGS="$CXXFLAGS $switch"
     127         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
     128          [eval $cachevar=yes],
     129          [eval $cachevar=no])
     130         CXXFLAGS="$ac_save_CXXFLAGS"])
     131      if eval test x\$$cachevar = xyes; then
     132        CXXFLAGS="$CXXFLAGS $switch"
     133        ac_success=yes
     134        break
     135      fi
     136    done
     137  fi])
     138  AC_LANG_POP([C++])
     139  if test x$ax_cxx_compile_cxx11_required = xtrue; then
     140    if test x$ac_success = xno; then
     141      AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
     142    fi
     143  else
     144    if test x$ac_success = xno; then
     145      HAVE_CXX11=0
     146      AC_MSG_NOTICE([No compiler with C++11 support was found])
     147    else
     148      HAVE_CXX11=1
     149      AC_DEFINE(HAVE_CXX11,1,
     150                [define if the compiler supports basic C++11 syntax])
     151    fi
     152
     153    AC_SUBST(HAVE_CXX11)
     154  fi
     155])
    22156
    23157# Copyright (C) 2002-2013 Free Software Foundation, Inc.
  • trunk/configure

    r500 r514  
    701701CFLAGS
    702702CC
     703HAVE_CXX11
    703704am__fastdepCXX_FALSE
    704705am__fastdepCXX_TRUE
     
    41814182
    41824183
     4184
     4185    ax_cxx_compile_cxx11_required=truednl
     4186  ac_ext=cpp
     4187ac_cpp='$CXXCPP $CPPFLAGS'
     4188ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     4189ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4190ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     4191  ac_success=no
     4192  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
     4193$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
     4194if ${ax_cv_cxx_compile_cxx11+:} false; then :
     4195  $as_echo_n "(cached) " >&6
     4196else
     4197  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     4198/* end confdefs.h.  */
     4199
     4200  template <typename T>
     4201    struct check
     4202    {
     4203      static_assert(sizeof(int) <= sizeof(T), "not big enough");
     4204    };
     4205
     4206    typedef check<check<bool>> right_angle_brackets;
     4207
     4208    int a;
     4209    decltype(a) b;
     4210
     4211    typedef check<int> check_type;
     4212    check_type c;
     4213    check_type&& cr = static_cast<check_type&&>(c);
     4214
     4215    auto d = a;
     4216
     4217_ACEOF
     4218if ac_fn_cxx_try_compile "$LINENO"; then :
     4219  ax_cv_cxx_compile_cxx11=yes
     4220else
     4221  ax_cv_cxx_compile_cxx11=no
     4222fi
     4223rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     4224fi
     4225{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
     4226$as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
     4227  if test x$ax_cv_cxx_compile_cxx11 = xyes; then
     4228    ac_success=yes
     4229  fi
     4230
     4231
     4232
     4233    if test x$ac_success = xno; then
     4234    for switch in -std=c++11 -std=c++0x; do
     4235      cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
     4236      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
     4237$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
     4238if eval \${$cachevar+:} false; then :
     4239  $as_echo_n "(cached) " >&6
     4240else
     4241  ac_save_CXXFLAGS="$CXXFLAGS"
     4242         CXXFLAGS="$CXXFLAGS $switch"
     4243         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     4244/* end confdefs.h.  */
     4245
     4246  template <typename T>
     4247    struct check
     4248    {
     4249      static_assert(sizeof(int) <= sizeof(T), "not big enough");
     4250    };
     4251
     4252    typedef check<check<bool>> right_angle_brackets;
     4253
     4254    int a;
     4255    decltype(a) b;
     4256
     4257    typedef check<int> check_type;
     4258    check_type c;
     4259    check_type&& cr = static_cast<check_type&&>(c);
     4260
     4261    auto d = a;
     4262
     4263_ACEOF
     4264if ac_fn_cxx_try_compile "$LINENO"; then :
     4265  eval $cachevar=yes
     4266else
     4267  eval $cachevar=no
     4268fi
     4269rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     4270         CXXFLAGS="$ac_save_CXXFLAGS"
     4271fi
     4272eval ac_res=\$$cachevar
     4273               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
     4274$as_echo "$ac_res" >&6; }
     4275      if eval test x\$$cachevar = xyes; then
     4276        CXXFLAGS="$CXXFLAGS $switch"
     4277        ac_success=yes
     4278        break
     4279      fi
     4280    done
     4281  fi
     4282  ac_ext=c
     4283ac_cpp='$CPP $CPPFLAGS'
     4284ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     4285ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4286ac_compiler_gnu=$ac_cv_c_compiler_gnu
     4287
     4288  if test x$ax_cxx_compile_cxx11_required = xtrue; then
     4289    if test x$ac_success = xno; then
     4290      as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
     4291    fi
     4292  else
     4293    if test x$ac_success = xno; then
     4294      HAVE_CXX11=0
     4295      { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
     4296$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
     4297    else
     4298      HAVE_CXX11=1
     4299
     4300$as_echo "#define HAVE_CXX11 1" >>confdefs.h
     4301
     4302    fi
     4303
     4304
     4305  fi
     4306
    41834307ac_ext=c
    41844308ac_cpp='$CPP $CPPFLAGS'
     
    48454969  am__fastdepCC_TRUE='#'
    48464970  am__fastdepCC_FALSE=
     4971fi
     4972
     4973
     4974   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
     4975$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
     4976if ${ac_cv_prog_cc_c99+:} false; then :
     4977  $as_echo_n "(cached) " >&6
     4978else
     4979  ac_cv_prog_cc_c99=no
     4980ac_save_CC=$CC
     4981cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     4982/* end confdefs.h.  */
     4983#include <stdarg.h>
     4984#include <stdbool.h>
     4985#include <stdlib.h>
     4986#include <wchar.h>
     4987#include <stdio.h>
     4988
     4989// Check varargs macros.  These examples are taken from C99 6.10.3.5.
     4990#define debug(...) fprintf (stderr, __VA_ARGS__)
     4991#define showlist(...) puts (#__VA_ARGS__)
     4992#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
     4993static void
     4994test_varargs_macros (void)
     4995{
     4996  int x = 1234;
     4997  int y = 5678;
     4998  debug ("Flag");
     4999  debug ("X = %d\n", x);
     5000  showlist (The first, second, and third items.);
     5001  report (x>y, "x is %d but y is %d", x, y);
     5002}
     5003
     5004// Check long long types.
     5005#define BIG64 18446744073709551615ull
     5006#define BIG32 4294967295ul
     5007#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
     5008#if !BIG_OK
     5009  your preprocessor is broken;
     5010#endif
     5011#if BIG_OK
     5012#else
     5013  your preprocessor is broken;
     5014#endif
     5015static long long int bignum = -9223372036854775807LL;
     5016static unsigned long long int ubignum = BIG64;
     5017
     5018struct incomplete_array
     5019{
     5020  int datasize;
     5021  double data[];
     5022};
     5023
     5024struct named_init {
     5025  int number;
     5026  const wchar_t *name;
     5027  double average;
     5028};
     5029
     5030typedef const char *ccp;
     5031
     5032static inline int
     5033test_restrict (ccp restrict text)
     5034{
     5035  // See if C++-style comments work.
     5036  // Iterate through items via the restricted pointer.
     5037  // Also check for declarations in for loops.
     5038  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
     5039    continue;
     5040  return 0;
     5041}
     5042
     5043// Check varargs and va_copy.
     5044static void
     5045test_varargs (const char *format, ...)
     5046{
     5047  va_list args;
     5048  va_start (args, format);
     5049  va_list args_copy;
     5050  va_copy (args_copy, args);
     5051
     5052  const char *str;
     5053  int number;
     5054  float fnumber;
     5055
     5056  while (*format)
     5057    {
     5058      switch (*format++)
     5059        {
     5060        case 's': // string
     5061          str = va_arg (args_copy, const char *);
     5062          break;
     5063        case 'd': // int
     5064          number = va_arg (args_copy, int);
     5065          break;
     5066        case 'f': // float
     5067          fnumber = va_arg (args_copy, double);
     5068          break;
     5069        default:
     5070          break;
     5071        }
     5072    }
     5073  va_end (args_copy);
     5074  va_end (args);
     5075}
     5076
     5077int
     5078main ()
     5079{
     5080
     5081  // Check bool.
     5082  _Bool success = false;
     5083
     5084  // Check restrict.
     5085  if (test_restrict ("String literal") == 0)
     5086    success = true;
     5087  char *restrict newvar = "Another string";
     5088
     5089  // Check varargs.
     5090  test_varargs ("s, d' f .", "string", 65, 34.234);
     5091  test_varargs_macros ();
     5092
     5093  // Check flexible array members.
     5094  struct incomplete_array *ia =
     5095    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
     5096  ia->datasize = 10;
     5097  for (int i = 0; i < ia->datasize; ++i)
     5098    ia->data[i] = i * 1.234;
     5099
     5100  // Check named initializers.
     5101  struct named_init ni = {
     5102    .number = 34,
     5103    .name = L"Test wide string",
     5104    .average = 543.34343,
     5105  };
     5106
     5107  ni.number = 58;
     5108
     5109  int dynamic_array[ni.number];
     5110  dynamic_array[ni.number - 1] = 543;
     5111
     5112  // work around unused variable warnings
     5113  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
     5114          || dynamic_array[ni.number - 1] != 543);
     5115
     5116  ;
     5117  return 0;
     5118}
     5119_ACEOF
     5120for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
     5121do
     5122  CC="$ac_save_CC $ac_arg"
     5123  if ac_fn_c_try_compile "$LINENO"; then :
     5124  ac_cv_prog_cc_c99=$ac_arg
     5125fi
     5126rm -f core conftest.err conftest.$ac_objext
     5127  test "x$ac_cv_prog_cc_c99" != "xno" && break
     5128done
     5129rm -f conftest.$ac_ext
     5130CC=$ac_save_CC
     5131
     5132fi
     5133# AC_CACHE_VAL
     5134case "x$ac_cv_prog_cc_c99" in
     5135  x)
     5136    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
     5137$as_echo "none needed" >&6; } ;;
     5138  xno)
     5139    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
     5140$as_echo "unsupported" >&6; } ;;
     5141  *)
     5142    CC="$CC $ac_cv_prog_cc_c99"
     5143    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
     5144$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
     5145esac
     5146if test "x$ac_cv_prog_cc_c99" != xno; then :
     5147
    48475148fi
    48485149
     
    87509051
    87519052done
    8752 
    87539053
    87549054
Note: See TracChangeset for help on using the changeset viewer.