[haiku-commits] Re: BRANCH pdziepak-github.scheduler [2bd8f82] src/system/kernel/arch/x86 headers/private/kernel/arch/x86 src/system/kernel src/add-ons/kernel/power/cpuidle/intel_cstates

  • From: Pawel Dziepak <pdziepak@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 20 Dec 2013 19:44:33 +0100

2013/12/20 Stephan Aßmus <superstippi@xxxxxx>:
>> diff --git a/headers/private/kernel/arch/smp.h 
>> b/headers/private/kernel/arch/smp.h
>> index f85fcf1..440617b 100644
>> --- a/headers/private/kernel/arch/smp.h
>> +++ b/headers/private/kernel/arch/smp.h
>> @@ -10,6 +10,8 @@
>>
>> struct kernel_args;
>>
>> +class CPUSet;
>> +
>>
>> #ifdef __cplusplus
>> extern "C" {
>
> Just wondering… is it correct to add the forward definition in a part of the 
> header that may be used from C code?

It would be correct if CPUSet was forward declared as a "struct".

However, because: 1) this header is virtually empty when included in a
C code, 2) it shouldn't be used by anything except
src/system/kernel/smp.cpp and the file that implements the functions
declared there, 3) I think we are using extern "C" in kernel much more
often that it is absolutely necessary I think it would be better to
just remove that __cplusplus guards from this header and make it C++
only.

Paweł

Other related posts: