From owner-svn-src-head@freebsd.org Sat Sep 26 07:30:46 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D25B9B8B4D; Sat, 26 Sep 2015 07:30:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.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 1E487F9A; Sat, 26 Sep 2015 07:30:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8Q7UjrL019503; Sat, 26 Sep 2015 07:30:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8Q7UjsJ019502; Sat, 26 Sep 2015 07:30:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509260730.t8Q7UjsJ019502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 26 Sep 2015 07:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288258 - 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.20 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: Sat, 26 Sep 2015 07:30:46 -0000 Author: kib Date: Sat Sep 26 07:30:45 2015 New Revision: 288258 URL: https://svnweb.freebsd.org/changeset/base/288258 Log: Make the __bitcount*() functions unconditionally available, by moving them out of the #if _BSD_VISIBLE block. Other headers may depend on __bitcount(). The dependencies can be a header not specified by POSIX, and then namespace restrictions by _XOPEN_SOURCE are not applicable, as it was reported. Or, we might grow an implementation of some POSIX facility using __bitcount(), which also should work. Reported by: Jason Schulz Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/sys/types.h Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Sat Sep 26 07:25:53 2015 (r288257) +++ head/sys/sys/types.h Sat Sep 26 07:30:45 2015 (r288258) @@ -290,9 +290,6 @@ typedef _Bool bool; * The following are all things that really shouldn't exist in this header, * since its purpose is to provide typedefs, not miscellaneous doodads. */ -#if __BSD_VISIBLE - -#include #ifdef __POPCNT__ #define __bitcount64(x) __builtin_popcountll((__uint64_t)(x)) @@ -356,6 +353,10 @@ __bitcount64(__uint64_t _x) #define __bitcount(x) __bitcount32((unsigned int)(x)) #endif +#if __BSD_VISIBLE + +#include + /* * minor() gives a cookie instead of an index since we don't want to * change the meanings of bits 0-15 or waste time and space shifting