X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fflexmember.m4;h=155b84841ca2dd4680c210e8338b0c076188d000;hb=8041b27617211a5762e58670b0acf474ffcfa610;hp=271889b20f66071e4ce238b3bc145415323f42e2;hpb=42d1eda5dcce2d68deab7a642e7f29bcd7144a0d;p=gnulib.git diff --git a/m4/flexmember.m4 b/m4/flexmember.m4 index 271889b20..155b84841 100644 --- a/m4/flexmember.m4 +++ b/m4/flexmember.m4 @@ -1,7 +1,7 @@ -# serial 2 +# serial 3 # Check for flexible array member support. -# Copyright (C) 2006, 2009 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,21 +14,21 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], ac_cv_c_flexmember, [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[#include - #include - #include - struct s { int n; double d[]; };]], - [[int m = getchar (); - struct s *p = malloc (offsetof (struct s, d) - + m * sizeof (double)); - p->d[0] = 0.0; - return p->d != (double *) NULL;]])], + [[#include + #include + #include + struct s { int n; double d[]; };]], + [[int m = getchar (); + struct s *p = malloc (offsetof (struct s, d) + + m * sizeof (double)); + p->d[0] = 0.0; + return p->d != (double *) NULL;]])], [ac_cv_c_flexmember=yes], [ac_cv_c_flexmember=no])]) if test $ac_cv_c_flexmember = yes; then AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [], [Define to nothing if C supports flexible array members, and to - 1 if it does not. That way, with a declaration like `struct s + 1 if it does not. That way, with a declaration like 'struct s { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack can be used with pre-C99 compilers. When computing the size of such an object, don't use 'sizeof (struct s)'