Module Name:    src
Committed By:   christos
Date:           Mon Oct 22 14:00:07 UTC 2012

Modified Files:
        src/sys/sys: cdefs.h

Log Message:
define __alignof() in terms of __alignof__ if it is available.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/sys/cdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.101 src/sys/sys/cdefs.h:1.102
--- src/sys/sys/cdefs.h:1.101	Sun Oct 21 18:35:52 2012
+++ src/sys/sys/cdefs.h	Mon Oct 22 10:00:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.101 2012/10/21 22:35:52 christos Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.102 2012/10/22 14:00:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -500,7 +500,11 @@
 /*
  * Return the natural alignment in bytes for the given type
  */
-#define	__alignof(__t)  (sizeof(struct { char __x; __t __y; }) - sizeof(__t))
+#ifdef __alignof__
+#define	__alignof(__t)  __alignof__(__t)
+#else
+#define __alignof(__t) (sizeof(struct { char __x; __t __y; }) - sizeof(__t))
+#endif
 
 /*
  * Return the number of elements in a statically-allocated array,

Reply via email to