[haiku-commits] Re: haiku: hrev44524 - src/build/libroot

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 13 Aug 2012 21:54:32 +0200

John Scipione wrote:
> On Mon, Aug 13, 2012 at 6:16 AM, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> > On 2012-08-13 at 02:34:04 [+0200], jscipione@xxxxxxxxx wrote:
> >> hrev44524 adds 2 changesets to branch 'master'
> >> old head: 7ad72ef6eae1ad8a2ec03043055ca0e649b11f80
> >> new head: efeef5fad7c8a92b0595540a6004113b8df8da12
> >>
> >> ----------------------------------------------------------------------------
> >>
> >> e4e6891: Cleanup darwin build system some more.
> >>
> >> * Convert fs_darwin.cpp and fs_freebsd.cpp to C.
> >
> > Please revert that. There's no reason for doing so and it prevents later C++
> > use. A good deal of the libroot_build implementation (particularly the
> > attributes part) makes use of C++.
>
> The Haiku equivalent functions are in C. Is this because they are
> included by the kernel? These functions are not going to be included
> by the kernel (build system only) so I guess they should be C++?

Kernel or not, there's no reason to force C compilation. It is easy to make C 
headers C++-safe. It is impossible to make C++ headers C safe (other than 
#ifdef'ing the functionality out that is). Moreover the C++ compiler is 
stricter (particularly wrt. types) which is a good thing, too.

> I am nervous that I will get link errors because the functions are
> declared with C linkage in the headers/build/host/<hostname>/header
> files but the implementations in fs_<hostname> are C++. Is this
> something that I should worry about?

As long as the header declares the functions with C linkage (and the header is 
actually included) there's nothing to worry about.

> Unfortunately I won't be able to convert back to C++ until tonight
> since I need to test on OS X and FreeBSD.

No hurry.

CU, Ingo

Other related posts: