haiku/src/system/kernel/kernel_c++_structs.cpp
Ingo Weinhold fc7864091e Attempt at allowing to use C++ structures in C only code: We use the
CreateAsmStructOffsetsHeader mechanism to generate a header with macros
defined to the sizes of the structures we're interested in and when compiling
in C mode define the structures as "struct { char bytes[size]; }".
It works in principle, but due to how jam works, one would have to specify the
dependency to the generated header for all sources that include it directly or
indirectly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-02 10:56:10 +00:00

25 lines
454 B
C++

/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#include <computed_asm_macros.h>
#include <condition_variable.h>
// NOTE: Don't include <kernel_c++_structs.h>, since that would result in a
// circular dependency.
#define DEFINE_SIZE_MACRO(name) \
DEFINE_COMPUTED_ASM_MACRO(_KERNEL_CPP_STRUCT_SIZE_##name, sizeof(name));
void
dummy()
{
DEFINE_SIZE_MACRO(ConditionVariable)
}