VBox/com/array.h assertion failure

Discussions related to using the OSE version of VirtualBox.

VBox/com/array.h assertion failure

Postby rjoyce » 7. Nov 2013, 23:32

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.

Posts: 3
Joined: 4. Nov 2013, 22:04

Re: VBox/com/array.h assertion failure

Postby noteirak » 8. Nov 2013, 21:51

Moved to "Virtualbox OSE" for build issues.
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
Site Moderator
Posts: 5197
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: VBox/com/array.h assertion failure

Postby smil2k » 17. Nov 2015, 23:52

Just for the record: you need to include "-fshort-wchar" on Linux with GCC in order to be able compile VBox/com/array.h.
Posts: 1
Joined: 17. Nov 2015, 23:51

Return to VirtualBox OSE

Who is online

Users browsing this forum: biggydanny and 2 guests