From: Paul Eggert Date: Fri, 8 Aug 2014 00:40:01 +0000 (-0700) Subject: vla: new module X-Git-Tag: v1.0~7315 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a6c54be167bd5be41013a254b4e6ba840420a1d0;p=gnulib.git vla: new module vla: new module GNU RCS can use this, mostly for documentation I expect. See: http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00025.html * MODULES.html.sh: Add vla. * lib/vla.h, modules/vla: New files. --- diff --git a/ChangeLog b/ChangeLog index 7d4fc5cd42..f440efeec1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-08-08 Paul Eggert + + vla: new module + GNU RCS can use this, mostly for documentation I expect. See: + http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00025.html + * MODULES.html.sh: Add vla. + * lib/vla.h, modules/vla: New files. + 2014-08-07 Daiki Ueno localename: make gl_locale_name_thread really thread-safe on Windows diff --git a/MODULES.html.sh b/MODULES.html.sh index 2163f9479e..6c4520a96c 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -2043,6 +2043,7 @@ func_all_modules () func_module snippet/unused-parameter func_module va-args func_module vararrays + func_module vla func_end_table element="Sizes of integer types " diff --git a/lib/vla.h b/lib/vla.h new file mode 100644 index 0000000000..05125a7978 --- /dev/null +++ b/lib/vla.h @@ -0,0 +1,27 @@ +/* vla.h - variable length arrays + + Copyright 2014 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Written by Paul Eggert. */ + +/* A function's argument must point to an array with at least N elements. + Example: 'int main (int argc, char *argv[VLA_ELEMS (argc)]);'. */ + +#ifdef __STDC_NO_VLA__ +# define VLA_ELEMS(n) +#else +# define VLA_ELEMS(n) static n +#endif diff --git a/modules/vla b/modules/vla new file mode 100644 index 0000000000..a007f884c1 --- /dev/null +++ b/modules/vla @@ -0,0 +1,20 @@ +Description: +Macros for dealing with variable length arrays. + +Files: +lib/vla.h + +Depends-on: +vararrays + +configure.ac: + +Makefile.am: + +Include: + +License: +GPL + +Maintainer: +all