diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-13 03:40:15 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-13 03:40:15 +0200 |
commit | 4781f2d7efe971277d9c2fbb0755c465fadcdcf8 (patch) | |
tree | 0a733fb3cae9cf0b376c02e82db78111c3294c0c /include/assert.h | |
parent | info: variadic functions (diff) | |
download | slibc-4781f2d7efe971277d9c2fbb0755c465fadcdcf8.tar.gz slibc-4781f2d7efe971277d9c2fbb0755c465fadcdcf8.tar.bz2 slibc-4781f2d7efe971277d9c2fbb0755c465fadcdcf8.tar.xz |
inclusion guard for assert.h do not guard definitions that depend on NDEBUG being unset
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | include/assert.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/include/assert.h b/include/assert.h index bf99258..9dd8f4c 100644 --- a/include/assert.h +++ b/include/assert.h @@ -15,8 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _ASSERT_H -#define _ASSERT_H #include <slibc/version.h> #include <slibc/features.h> @@ -46,16 +44,6 @@ #endif -/** - * A compile-time error should occur if the expression - * evaluates to zero. - * - * @param expression:scalar The expression to evaluate. - * @param message:const char* The message to print on error. - */ -#define static_assert _Static_assert - - #if defined(__SLIBC_SOURCE) || defined(__GNU_SOURCE) /** * Unless `NDEBUG` is defined, print an error message @@ -78,6 +66,21 @@ +#ifndef _ASSERT_H +#define _ASSERT_H + + + +/** + * A compile-time error should occur if the expression + * evaluates to zero. + * + * @param expression:scalar The expression to evaluate. + * @param message:const char* The message to print on error. + */ +#define static_assert _Static_assert + + /** * The function that is called if an assertion fails. * |