Re: svn commit: r288258 - head/sys/sys

2015-09-26 Thread Konstantin Belousov
On Sat, Sep 26, 2015 at 07:30:45AM +, Konstantin Belousov wrote:
> 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.

It was ought to be mentioned in the commit message that all
symbols moved out of the _BSD_VISIBLE protection are in the
implementation-private namespace. In other words, by making the symbols
declared unconditionally, we are still compliant.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r288258 - head/sys/sys

2015-09-26 Thread Konstantin Belousov
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.hSat Sep 26 07:25:53 2015(r288257)
+++ head/sys/sys/types.hSat 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
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"