diff options
| author | Paul Eggert | 2012-05-26 16:14:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-05-26 16:14:36 -0700 |
| commit | caf8a9b2b301aba06735d403317b75b41df59bfe (patch) | |
| tree | bfafb3cc0cf8a2f2394b4ed721e7c3d4891b78ab /lib/verify.h | |
| parent | fe453991eafc32a890297a2003ac532b9f579f92 (diff) | |
| download | emacs-caf8a9b2b301aba06735d403317b75b41df59bfe.tar.gz emacs-caf8a9b2b301aba06735d403317b75b41df59bfe.zip | |
Merge from gnulib.
Fixes: debbugs:11527
Diffstat (limited to 'lib/verify.h')
| -rw-r--r-- | lib/verify.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/verify.h b/lib/verify.h index 9a8caad001d..cef14ad1571 100644 --- a/lib/verify.h +++ b/lib/verify.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Compile-time assert-like macros. | 1 | /* Compile-time assert-like macros. |
| 2 | 2 | ||
| 3 | Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc. | 3 | Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This program is free software: you can redistribute it and/or modify | 5 | This program is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
| @@ -21,13 +21,11 @@ | |||
| 21 | # define _GL_VERIFY_H | 21 | # define _GL_VERIFY_H |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | /* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per the | 24 | /* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11. |
| 25 | C1X draft N1548 section 6.7.10. This is supported by GCC 4.6.0 and | 25 | This is supported by GCC 4.6.0 and later, in C mode, and its use |
| 26 | later, in C mode, and its use here generates easier-to-read diagnostics | 26 | here generates easier-to-read diagnostics when verify (R) fails. |
| 27 | when verify (R) fails. | ||
| 28 | 27 | ||
| 29 | Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per the | 28 | Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. |
| 30 | C++0X draft N3242 section 7.(4). | ||
| 31 | This will likely be supported by future GCC versions, in C++ mode. | 29 | This will likely be supported by future GCC versions, in C++ mode. |
| 32 | 30 | ||
| 33 | Use this only with GCC. If we were willing to slow 'configure' | 31 | Use this only with GCC. If we were willing to slow 'configure' |
| @@ -188,7 +186,7 @@ template <int w> | |||
| 188 | trailing ';'. If R is false, fail at compile-time, preferably | 186 | trailing ';'. If R is false, fail at compile-time, preferably |
| 189 | with a diagnostic that includes the string-literal DIAGNOSTIC. | 187 | with a diagnostic that includes the string-literal DIAGNOSTIC. |
| 190 | 188 | ||
| 191 | Unfortunately, unlike C1X, this implementation must appear as an | 189 | Unfortunately, unlike C11, this implementation must appear as an |
| 192 | ordinary declaration, and cannot appear inside struct { ... }. */ | 190 | ordinary declaration, and cannot appear inside struct { ... }. */ |
| 193 | 191 | ||
| 194 | # ifdef _GL_HAVE__STATIC_ASSERT | 192 | # ifdef _GL_HAVE__STATIC_ASSERT |
| @@ -205,7 +203,7 @@ template <int w> | |||
| 205 | # define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) | 203 | # define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) |
| 206 | # endif | 204 | # endif |
| 207 | # if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert | 205 | # if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert |
| 208 | # define static_assert _Static_assert /* Draft C1X requires this #define. */ | 206 | # define static_assert _Static_assert /* C11 requires this #define. */ |
| 209 | # endif | 207 | # endif |
| 210 | # endif | 208 | # endif |
| 211 | 209 | ||