Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys define __alignof() in terms of __alignof__ if it is ...



details:   https://anonhg.NetBSD.org/src/rev/a87e7e1f7a35
branches:  trunk
changeset: 782232:a87e7e1f7a35
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 22 14:00:07 2012 +0000

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

diffstat:

 sys/sys/cdefs.h |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 56846d553c98 -r a87e7e1f7a35 sys/sys/cdefs.h
--- a/sys/sys/cdefs.h   Mon Oct 22 10:37:44 2012 +0000
+++ b/sys/sys/cdefs.h   Mon Oct 22 14:00:07 2012 +0000
@@ -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,



Home | Main Index | Thread Index | Old Index