Question

I'm trying to compile SkyFireEMU (https://github.com/ProjectSkyfire/SkyFireEMU) with Visual Studio 2010 (32 BIT) but I get an error (On almost all files of "worldserver"):

fatal error C1189: #error :  sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)

This rederects me to this peace of code:

#if SIZEOF_CHARP == SIZEOF_INT
typedef int intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG
typedef long intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG
typedef long long intptr;
#else
#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
#endif

Can someone help me with fixing this problem? What does the error mean? I really don't know what goes wrong.

Was it helpful?

Solution

The code is old. Today you can use typedef intptr_t intptr (aka std::intptr_t in <cstdint>).

OTHER TIPS

SIZEOF_CHARP is not being set appropriately (according to whoever wrote that code), hence invoking the error message. Your best bet is to consult the SkyFireEMU documentation, you may need to set this flag before compiling, or something along these lines.

Having said this, I did a quick Google and found this, which describes an identical error message. It suggests writing the following right before the block you provide:

#ifndef SIZEOF_CHARP
#define SIZEOF_CHARP SIZEOF_LONG
#endif

There may still be an underlying problem though, since this really only suppresses the error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top