]> Savannah Git Hosting - gnulib.git/commitdiff
vla: new module
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Aug 2014 00:40:01 +0000 (17:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 9 Aug 2014 06:45:44 +0000 (23:45 -0700)
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.

ChangeLog
MODULES.html.sh
lib/vla.h [new file with mode: 0644]
modules/vla [new file with mode: 0644]

index 7d4fc5cd42dad5d8e8e720787b877b1c43822481..f440efeec134cb767a05a03dda7bd6abcfb3c293 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-08-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <ueno@gnu.org>
 
        localename: make gl_locale_name_thread really thread-safe on Windows
index 2163f9479e0c1c650b06750cceb48682adfe0a2b..6c4520a96c8dcabb77d62df37b0b358c1f6126fd 100755 (executable)
@@ -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 <limits.h>"
diff --git a/lib/vla.h b/lib/vla.h
new file mode 100644 (file)
index 0000000..05125a7
--- /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 <http://www.gnu.org/licenses/>.
+
+   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 (file)
index 0000000..a007f88
--- /dev/null
@@ -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