[haiku-commits] Re: BRANCH mmadia-github.separate-build-environment - in headers/build: os_target/support os/support posix_target

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 01 Aug 2012 22:45:01 +0200

mmadia-github.separate-build-environment wrote:
[...]
> diff --git a/headers/build/os_target/support/target_Errors.h 
> b/headers/build/os_target/support/target_Errors.h
> index a046734..9f95a68 100644
> --- a/headers/build/os_target/support/target_Errors.h
> +++ b/headers/build/os_target/support/target_Errors.h
[...]
> +#ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER
> +// NOTE: #8730 -- Should this be ifdef 
> _HAIKU_BUILD_B_USE_POSITIVE_POSIX_ERRORS?

No. Client code can define B_USE_POSITIVE_POSIX_ERRORS to get positive values 
for POSIX error codes which, together with using libposix_error_mapper.a, make 
Haiku POSIX compliant in this respect. I don't think we need that feature for 
the build tools. It's probably the easiest solution to remove it here. Meaning 
in all cases assume [_HAIKU_BUILD_]B_USE_POSITIVE_POSIX_ERRORS is not defined. 
[_HAIKU_BUILD_]B_{TO,FROM}_POSIX_ERROR() can be removed. Wherever they are 
used, their parameter should be used unchanged instead (the lazy alternative 
would be to define them to identity instead).

[...]
> +#ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER
> +// NOTE: #8730 -- Should this be ifdef 
> _HAIKU_BUILD_B_USE_POSITIVE_POSIX_ERRORS?
> +// NOTE: #8730 -- Is this conditional for this necessary?
> +# ifdef B_USE_POSITIVE_POSIX_ERRORS
> +# define ENOMEM _HAIKU_BUILD_ENOMEM
> +# else
> +# define ENOMEM _HAIKU_BUILD_ENOMEM
> +# endif
> +#endif

Regarding the second note, if both branches are identical there's no need to 
branch at all. In this case, if the feature were needed, things would have to 
be defined differently, though. Anyway, no special casing for 
_HAIKU_BUILD_ENOMEM or ENOMEM is needed.

[...]
> diff --git a/headers/build/posix_target/target_limits.h 
> b/headers/build/posix_target/target_limits.h
> new file mode 100644
> index 0000000..138fd32
> --- /dev/null
> +++ b/headers/build/posix_target/target_limits.h
[...]
> +/* _GCC_LIMITS_H_ is defined by GCC's internal limits.h to avoid
> + * collisions with any defines in this file.
> + */
> +// NOTE: #8730 -- Does this need the _HAIKU_BUILD prefix?
> +// NOTE: #8730 -- Does this need an ifndef 
> _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER counterpart?
> +#ifndef _GCC_LIMITS_H_
> +# include_next <limits.h>
> +#endif

This doesn't work this way at all. It is not possible to include the compiler 
header from here, since both the build system's and the build platform's header 
shadow it. The include must be omitted. I don't know what the GCC header 
defines. Whatever it is, it should just be defined here. Likely that requires 
the values to be pulled in through HaikuHostBuildConfig.h.

CU, Ingo

Other related posts: