[haiku-commits] Re: r34441 - in haiku/trunk: build/jam headers/private/kernel headers/private/kernel/util src/system/kernel

  • From: Colin Günther <coling@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 04 Dec 2009 14:12:06 +0100

Ingo Weinhold schrieb:
On 2009-12-03 at 19:49:40 [+0100], Colin Günther <coling@xxxxxx> wrote:
Mmh, there seems to be a conflict arising due to including kernel_cpp.h
and kernel_c.h:
C++
/home/colin/Dokumente/workspace/haiku/gcc2/objects/haiku/x86/release/libs/co
mpat/freebsd_network/Condvar.o

/home/colin/Dokumente/workspace/haiku/headers/build/gcc-2.95.3/new: In
function `void * operator new(long unsigned int)':
In file included from
/home/colin/Dokumente/workspace/haiku/headers/private/kernel/util/DoublyLink
edList.h:15,
                 from
/home/colin/Dokumente/workspace/haiku/headers/private/kernel/condition_varia
ble.h:15,
                 from
/home/colin/Dokumente/workspace/haiku/headers/private/kernel/kernel_c++_stru
cts.h:17,
                 from
/home/colin/Dokumente/workspace/haiku/src/libs/compat/freebsd_network/compat
/sys/condvar.h:11,
                 from
/home/colin/Dokumente/workspace/haiku/src/libs/compat/freebsd_network/Condva
r.cpp:8:
/home/colin/Dokumente/workspace/haiku/headers/build/gcc-2.95.3/new:28:
previous declaration of `void * operator new(long unsigned int)' with
C++ linkage
/home/colin/Dokumente/workspace/haiku/headers/private/kernel/util/kernel_cpp
.h:28:
conflicts with new declaration with C linkage

The problem is that you include <compat/sys/condvar.h> in an 'extern "C"' block from Condvar.cpp and in C++ mode <kernel_c++_structs.h> includes other
C++ headers. You'll have to close the 'extern "C"' block in that case in
<compat/sys/condvar.h>:

#ifdef __cplusplus
        }       // extern "C"
#       include <kernel_c++_structs.h>
#       extern "C" {
#else
#       include <kernel_c++_structs.h>
#endif

CU, Ingo

Worked flawlessly! This new feature is now used in the freebsd compat layer since r34489.

-Colin

Other related posts: