[PATCH 17/19 v2] Use IS_IN only when _LIBC is defined
Joseph S. Myers
joseph@codesourcery.com
Thu Aug 28 16:58:00 GMT 2014
On Thu, 28 Aug 2014, Siddhesh Poyarekar wrote:
> diff --git a/include/bits/stdlib-float.h b/include/bits/stdlib-float.h
> index 3466314..debb364 100644
> --- a/include/bits/stdlib-float.h
> +++ b/include/bits/stdlib-float.h
> @@ -1,4 +1,6 @@
> /* No floating-point inline functions in rtld. */
> -#if !IS_IN (rtld)
> -# include <stdlib/bits/stdlib-float.h>
> +#ifdef _LIBC
> +# if !IS_IN (rtld)
> +# include <stdlib/bits/stdlib-float.h>
> +# endif
> #endif
That seems wrong - it would mean that <stdlib/bits/stdlib-float.h> doesn't
get included at all unless _LIBC. But <stdlib/bits/stdlib-float.h> should
be included for the conformance tests, because it would be included for a
normal user build (by virtue of being installed as <bits/stdlib-float.h>).
So you could include this header for _ISOMAC (for example), in addition to
a #else / #if !IS_IN (rtld) case.
> diff --git a/include/mqueue.h b/include/mqueue.h
> index aba788e..e40f3cb 100644
> --- a/include/mqueue.h
> +++ b/include/mqueue.h
> @@ -1,7 +1,9 @@
> #include <rt/mqueue.h>
>
> -#if IS_IN (librt)
> +#ifdef _LIBC
> +# if IS_IN (librt)
> hidden_proto (mq_timedsend)
> hidden_proto (mq_timedreceive)
> hidden_proto (mq_setattr)
> +# endif
> #endif
Normally, #ifndef _ISOMAC would be the conditional around such extra
internal-only contents (and then #if IS_IN (librt) could go inside the
!_ISOMAC case).
> diff --git a/include/stdlib.h b/include/stdlib.h
> index 734f251..a884b51 100644
> --- a/include/stdlib.h
> +++ b/include/stdlib.h
> @@ -226,11 +226,13 @@ extern int __qfcvt_r (long double __value, int __ndigit,
> int *__restrict __decpt, int *__restrict __sign,
> char *__restrict __buf, size_t __len);
>
> -# if IS_IN (libc)
> -# undef MB_CUR_MAX
> -# define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
> +# if defined _LIBC
> +# if IS_IN (libc)
> +# undef MB_CUR_MAX
> +# define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
>
> -# define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
> +# define __cxa_atexit(func, arg, d) INTUSE(__cxa_atexit) (func, arg, d)
> +# endif
> # endif
Why do you need this? Aren't you already inside a !defined _ISOMAC case?
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list