[Glibc-bsd-commits] r4966 - in trunk/kfreebsd-kernel-headers: debian test
Robert Millan
rmh at alioth.debian.org
Wed Sep 25 13:40:26 UTC 2013
Author: rmh
Date: 2013-09-25 13:40:26 +0000 (Wed, 25 Sep 2013)
New Revision: 4966
Added:
trunk/kfreebsd-kernel-headers/test/assert.h
Modified:
trunk/kfreebsd-kernel-headers/debian/changelog
trunk/kfreebsd-kernel-headers/test/Makefile
trunk/kfreebsd-kernel-headers/test/assert_correct_bsize.c
trunk/kfreebsd-kernel-headers/test/ino_t.c
Log:
Simplify asserts using COMPILE_TIME_ASSERT() macro.
Modified: trunk/kfreebsd-kernel-headers/debian/changelog
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/changelog 2013-09-25 12:42:43 UTC (rev 4965)
+++ trunk/kfreebsd-kernel-headers/debian/changelog 2013-09-25 13:40:26 UTC (rev 4966)
@@ -6,6 +6,7 @@
room for <sys/kglue/netinet>, etc.
* Add <sys/kglue/netinet/if_ether.h> using patch from original port.
* sys_user.c: Check <sys/user.h> buildability.
+ * Simplify asserts using COMPILE_TIME_ASSERT() macro.
-- Robert Millan <rmh at debian.org> Sat, 21 Sep 2013 17:07:34 +0200
Modified: trunk/kfreebsd-kernel-headers/test/Makefile
===================================================================
--- trunk/kfreebsd-kernel-headers/test/Makefile 2013-09-25 12:42:43 UTC (rev 4965)
+++ trunk/kfreebsd-kernel-headers/test/Makefile 2013-09-25 13:40:26 UTC (rev 4966)
@@ -26,7 +26,7 @@
# elf.o
-CFLAGS = -Iinclude -I../debian/kfreebsd-kernel-headers/usr/include
+CFLAGS = -I. -I../debian/kfreebsd-kernel-headers/usr/include
# Enable all the stuff in glibc to probe for collisions
CFLAGS += -D_GNU_SOURCE -Werror -Wsystem-headers
Added: trunk/kfreebsd-kernel-headers/test/assert.h
===================================================================
--- trunk/kfreebsd-kernel-headers/test/assert.h (rev 0)
+++ trunk/kfreebsd-kernel-headers/test/assert.h 2013-09-25 13:40:26 UTC (rev 4966)
@@ -0,0 +1,2 @@
+#define COMPILE_TIME_ASSERT(name, expr) \
+ static char __assert_ ## name [(expr) ? 0 : -1]
Modified: trunk/kfreebsd-kernel-headers/test/assert_correct_bsize.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/assert_correct_bsize.c 2013-09-25 12:42:43 UTC (rev 4965)
+++ trunk/kfreebsd-kernel-headers/test/assert_correct_bsize.c 2013-09-25 13:40:26 UTC (rev 4966)
@@ -1,2 +1,3 @@
#include <sys/param.h>
-char __assert_correct_bsize[DEV_BSIZE == (1<<DEV_BSHIFT) ? 0 : -1];
+#include "assert.h"
+COMPILE_TIME_ASSERT(correct_bsize, DEV_BSIZE == (1<<DEV_BSHIFT));
Modified: trunk/kfreebsd-kernel-headers/test/ino_t.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/ino_t.c 2013-09-25 12:42:43 UTC (rev 4965)
+++ trunk/kfreebsd-kernel-headers/test/ino_t.c 2013-09-25 13:40:26 UTC (rev 4966)
@@ -9,8 +9,10 @@
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
+#include "assert.h"
+
#define ASSERT_SIZE(N, STRUCT, MEMBER, SIZE) \
- static char __assert_ ## N [(sizeof (((struct STRUCT *) NULL)->MEMBER) == SIZE) ? 0 : -1]
+ COMPILE_TIME_ASSERT(N, (sizeof (((struct STRUCT *) NULL)->MEMBER) == SIZE))
ASSERT_SIZE(1, fs, fs_snapinum[0], 4);
ASSERT_SIZE(2, jrefrec, jr_ino, 4);
More information about the Glibc-bsd-commits
mailing list