VBox/com/array.h assertion failure

Discussions related to using the OSE version of VirtualBox.
Post Reply
rjoyce
Posts: 3
Joined: 4. Nov 2013, 22:04

VBox/com/array.h assertion failure

Post by rjoyce »

Hi all,

I'm trying to build code using the COM/XPCOM "glue" layer in C++ with VirtualBox 4.3.2. This is on both Linux and OS X -- so the XPCOM side of things. The VBox source tree's "include" directory is in my include path. After defining RT_ARCH_* and RT_OS_* as needed, I have:

#include <VBox/com/com.h>
#include <VBox/com/array.h>

The second line causes an assertion failure on line 265 of array.h:

AssertCompile(sizeof(PRUnichar) == sizeof(OLECHAR));

PRUnichar is 2 bytes, but OLECHAR is defined in VBox/com/defs.h line 315:

#define OLECHAR wchar_t

which is 4 bytes on Linux. I don't see any VBox preprocessor macros that would change this definition.

Am I missing some #define, compiler flag, or other setup? The regular VirtualBox code uses array.h and builds just fine (e.g., src/VBox/Main/testcase/tstAPI.cpp). But I don't see how it avoids wchar_t != PRUnichar.

Thanks!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: VBox/com/array.h assertion failure

Post by noteirak »

Moved to "Virtualbox OSE" for build issues.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
smil2k
Posts: 1
Joined: 17. Nov 2015, 23:51

Re: VBox/com/array.h assertion failure

Post by smil2k »

Just for the record: you need to include "-fshort-wchar" on Linux with GCC in order to be able compile VBox/com/array.h.
Post Reply