[LLVMdev] size_t?

Eric Mader emader at gmx.us
Tue Sep 30 13:55:48 PDT 2014


I'm getting compile errors because size_t is getting redefined. My 
"forced include file" starts with:

#if BUILDING_FOR_WINDOWS
#define NOMINMAX

/* deal with the fact that windef.h also defines BOOL */
#define BOOL WINBOOL

#include <windows.h>
#include <intrin.h>

#undef BOOL
#endif

Looking at the preprocessor expansion of a typical .cpp file, I see that 
crtdefs.h defines size_t like this:

typedef unisgned __int64 size_t;

Later on, <LLVM>\lib\clang\3.6.0\includes\stddef.h defines it as:

typedef unsigned int size_t;

Is there some other magic I need to do to get these to work?

I'm also seeing a bunch of errors like this having to do with intrinsics:

1>  In file included from C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\algorithm:6:
1>  In file included from C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\xmemory:6:
1>  In file included from C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\include\xmemory0:909:
1>  In file included from C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\intrin.h:34:
1>  In file included from C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\x86intrin.h:29:
1>  In file included from C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\immintrin.h:28:
1>C:\Program Files 
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\mmintrin.h(52,40): 
error : cannot initialize a parameter of type 
'__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2 
'int' values) with an rvalue of type '__v2si' (aka 'int')
1>      return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
1>                                         ^~~~~~~~~~~

I suspect that these might be caused by the same thing as the size_t 
problem...

Regards,
Eric Mader



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140930/5dcc9c28/attachment.html>


More information about the llvm-dev mailing list