Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jun 2009 20:01:17 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 163925 for review
Message-ID:  <200906092001.n59K1HeJ073958@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=163925

Change 163925 by trasz@trasz_victim on 2009/06/09 20:00:24

	Turn assertion into CTASSERT.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#8 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#8 (text+ko) ====

@@ -42,6 +42,14 @@
 
 #include "acl_support.h"
 
+#ifndef CTASSERT
+#define CTASSERT(x)		_CTASSERT(x, __LINE__)
+#define _CTASSERT(x, y)		__CTASSERT(x, y)
+#define __CTASSERT(x, y)	typedef char __assert_ ## y [(x) ? 1 : -1]
+#endif
+
+CTASSERT(1 << _ACL_T_ALIGNMENT_BITS > sizeof(struct acl_t_struct));
+
 acl_t
 acl_init(int count)
 {
@@ -57,7 +65,6 @@
 		return (NULL);
 	}
 
-	assert(1 << _ACL_T_ALIGNMENT_BITS > sizeof(struct acl_t_struct));
 	error = posix_memalign((void *)&acl, 1 << _ACL_T_ALIGNMENT_BITS,
 	    sizeof(struct acl_t_struct));
 	if (error)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906092001.n59K1HeJ073958>