From owner-svn-src-head@FreeBSD.ORG Fri Jan 8 20:33:55 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D595B1065672; Fri, 8 Jan 2010 20:33:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 544438FC22; Fri, 8 Jan 2010 20:33:55 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o08KXphW017110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Jan 2010 07:33:53 +1100 Date: Sat, 9 Jan 2010 07:33:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Edward Tomasz Napierala In-Reply-To: <201001081541.o08FfOHb014564@svn.freebsd.org> Message-ID: <20100109071832.H57772@delplex.bde.org> References: <201001081541.o08FfOHb014564@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201793 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 08 Jan 2010 20:33:55 -0000 On Fri, 8 Jan 2010, Edward Tomasz Napierala wrote: > Log: > Fix #ifdefs so that GCC 4.4 doesn't complain about it. > > Reviewed by: rpaulo > > Modified: > head/sys/net80211/ieee80211_var.h > > Modified: head/sys/net80211/ieee80211_var.h > ============================================================================== > --- head/sys/net80211/ieee80211_var.h Fri Jan 8 15:28:22 2010 (r201792) > +++ head/sys/net80211/ieee80211_var.h Fri Jan 8 15:41:24 2010 (r201793) > @@ -32,11 +32,11 @@ > * Definitions for IEEE 802.11 drivers. > */ > /* NB: portability glue must go first */ > -#ifdef __NetBSD__ > +#if defined(__NetBSD__) "#if defined()" instead of "#ifdef" is a style bug. > #include > -#elif __FreeBSD__ > +#elif defined(__FreeBSD__) "defined()" is unfortunately needed with #elif (or if multple #ifdefs in a single statement are needed). > #include > -#elif __linux__ > +#elif defined(__linux__) > #include > #else > #error "No support for your operating system!" > It is a compiler bug to complain about undefined identifiers in cpp expressions, or a user bug to configure the compiler to have this bug. It is a standard C feature (6.10 [#3] in C99) that undefined identifiers are replaced by 0 in preprocessor expressions. This feature is very useful for avoiding ugliness like the above defined()'s. Bruce