From owner-svn-src-all@FreeBSD.ORG Mon Feb 8 18:37:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47D66106566B; Mon, 8 Feb 2010 18:37:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36EB58FC18; Mon, 8 Feb 2010 18:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o18IbAoQ023990; Mon, 8 Feb 2010 18:37:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o18IbAY1023988; Mon, 8 Feb 2010 18:37:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002081837.o18IbAY1023988@svn.freebsd.org> From: Ed Maste Date: Mon, 8 Feb 2010 18:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203674 - stable/6/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 18:37:11 -0000 Author: emaste Date: Mon Feb 8 18:37:10 2010 New Revision: 203674 URL: http://svn.freebsd.org/changeset/base/203674 Log: MFC r162488: Use __builtin_offsetof for GCC 4.1. Submitted by: Ryan Stone Modified: stable/6/sys/sys/cdefs.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/sys/cdefs.h ============================================================================== --- stable/6/sys/sys/cdefs.h Mon Feb 8 18:16:59 2010 (r203673) +++ stable/6/sys/sys/cdefs.h Mon Feb 8 18:37:10 2010 (r203674) @@ -304,6 +304,9 @@ * We define this here since , , and * require it. */ +#if __GNUC_PREREQ__(4, 1) +#define __offsetof(type, field) __builtin_offsetof(type, field) +#else #ifndef __cplusplus #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) #else @@ -312,6 +315,7 @@ (&reinterpret_cast \ (static_cast (0)->field)))) #endif +#endif #define __rangeof(type, start, end) \ (__offsetof(type, end) - __offsetof(type, start))