[haiku-development] Re: Differences in Errors.h (installed vs. build header)

On Sun, 5 Aug 2012 18:24:45 +0000 Matt Madia <mattmadia@xxxxxxxxx> wrote:
> While working on #8730, I noticed that headers/os/support/Errors.h[1]
> is vastly different than headers/build/os/support/Errors.h[2]
>
> For the purposes of #8730, which header should be used for
> headers/build/os_target/target_Errors.h[3]?

Please use the one in headers/os. When in doubt you can just compare the commit 
logs. In most cases you'll find the build header simply hasn't been updated 
after the Haiku header was changed.

> Currently, I'm using the one from headers/os/support/Errors.h and this
> error is popping up:
> -------------------
> jam -q libroot_build.so
> ...patience...
> ...found 195 target(s)...
> ...updating 24 target(s)...
> MkDir1 /home/mmadia/separate-build-environment/generated.x86gcc2/objects
> MkDir1
> /home/mmadia/separate-build-environment/generated.x86gcc2/objects/freebsd
> MkDir1
> /home/mmadia/separate-build-environment/generated.x86gcc2/objects/freebsd/lib
> MkDir1
> /home/mmadia/separate-build-environment/generated.x86gcc2/objects/freebsd/x86
> MkDir1
> /home/mmadia/separate-build-environment/generated.x86gcc2/objects/freebsd/x86/release
> MkDir1
> /home/mmadia/separate-build-environment/generated.x86gcc2/objects/freebsd/x86/release/build
> MkDir1
> /home/mmadia/separate-build-environment/generated.x86gcc2/objects/freebsd/x86/release/build/libroot
> C++
> /home/mmadia/separate-build-environment/generated.x86gcc2/objects/freebsd/x86/release/build/libroot/atomic.o
> In file included from
> /home/mmadia/separate-build-environment/haiku/src/build/libroot/atomic.cpp:1:
> /home/mmadia/separate-build-environment/haiku/headers/build/os_target/support/target_SupportDefs.h:19:30:
> error: sys/target_types.h: No such file or directory
> In file included from
> /home/mmadia/separate-build-environment/haiku/headers/build/posix_target/target_limits.h:11,
>                  from
> /home/mmadia/separate-build-environment/haiku/headers/build/os_target/support/target_Errors.h:9,
>                  from
> /home/mmadia/separate-build-environment/haiku/headers/build/os_target/support/target_SupportDefs.h:16,
>                  from
> /home/mmadia/separate-build-environment/haiku/src/build/libroot/atomic.cpp:1:
> /usr/include/float.h:39: error: expected constructor, destructor, or
> type conversion before 'extern'

Not related to the error, but anyway: /usr/include/float.h doesn't sound good. 
That's not the compiler header. Apparently FreeBSD has an OS <float.h> header. 
If that one includes anything other than compiler headers, it must not be 
included and the HaikuHostBuildConfig.h approach needs to be chosen.

> In file included from
> /home/mmadia/separate-build-environment/haiku/headers/build/os_target/support/target_SupportDefs.h:16,
>                  from
> /home/mmadia/separate-build-environment/haiku/src/build/libroot/atomic.cpp:1:
> /home/mmadia/separate-build-environment/haiku/headers/build/os_target/support/target_Errors.h:644:
> error:
> expected constructor, destructor, or type conversion before 'extern'

Before that line there's nothing in target_Errors.h that the compiler sees 
(it's all preprocessor stuff), so the problem is in an included header. 
Possibly the incorrect function definition. The easiest way to find out is to 
get things preprocessing and to check the preprocessed output.

CU, Ingo

Other related posts: