From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 03:16:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BA5A4F3; Sun, 29 Mar 2015 03:16:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36D7F227; Sun, 29 Mar 2015 03:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2T3GqNf032349; Sun, 29 Mar 2015 03:16:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2T3GqNP032348; Sun, 29 Mar 2015 03:16:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503290316.t2T3GqNP032348@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 29 Mar 2015 03:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280801 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2015 03:16:53 -0000 Author: pfg Date: Sun Mar 29 03:16:52 2015 New Revision: 280801 URL: https://svnweb.freebsd.org/changeset/base/280801 Log: cdefs.h: Fix macros for pre-C99 compilers. Older compilers, and compatibility modes, may not support variadic macros. I normally wouldn't go out of my way to support those old compilers but there is a prescendent in other system headers for using the same macro multiple times, and the solution (although non-elegant IMHO) works. Requested by: bde Solution by: tijl Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Mar 28 23:42:59 2015 (r280800) +++ head/sys/sys/cdefs.h Sun Mar 29 03:16:52 2015 (r280801) @@ -359,9 +359,11 @@ #endif #if __GNUC_PREREQ__(3, 3) -#define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__))) +#define __nonnull(x) __attribute__((__nonnull__(x))) +#define __nonnull_all __attribute__((__nonnull__)) #else -#define __nonnull(...) +#define __nonnull(x) +#define __nonnull_all #endif #if __GNUC_PREREQ__(3, 4) @@ -379,9 +381,9 @@ #endif #if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) -#define __alloc_size(...) __attribute__((__alloc_size__(__VA_ARGS__))) +#define __alloc_size(x) __attribute__((__alloc_size__(x))) #else -#define __alloc_size(...) +#define __alloc_size(x) #endif /* XXX: should use `#if __STDC_VERSION__ < 199901'. */