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

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 04 Dec 2009 10:07:26 +0100

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

Other related posts: