0

I am porting my tool to PIN 3.0 using Visual c++ 2012 because I now have Windows 10. I followed the porting guide provided here

However, I ran into an error:

error C4890: '__value': use of this keyword requires the command line option: /clr:oldSyntax

When turning this /clr:oldSyntax option on, plus adding RTTI availability (/GR instead of /GR-) as otherwise it is not compatible with /clr:oldSyntax, I get more or less the same issue:

error C2059: syntax error: '__value'

this error is located in the file type_trait.h (header file of the PIN 3.0 Library)

#ifdef _STLP_STATIC_CONST_INIT_BUG
    static const bool __value;
#else
    static const bool __value = sizeof(__test<_Tp>(0)) == sizeof(__select_types::__t1);
#endif

Is this a common issue, and if so is there any workaround ? Or did I missed something in the porting guide ? I understand that the name __value introduced in this PIN 3.0 header is in conclict.

Heyji
  • 1,113
  • 8
  • 26
  • That code is rather brutally unfriendly to C++. Why you'd consider compiling it with /clr in effect is very hard to guess. You just can't. – Hans Passant Sep 21 '16 at 21:47
  • @Hans Passant: I edited the question. I did not compiled it with /clr, but with /clr:oldSyntax, as requested by the compiler. – Heyji Sep 22 '16 at 09:54

1 Answers1

0

This is apparently a "bug" in visual c++ as reported here

The solution is to add the following preprocessor definition:

/D__value=_value
Heyji
  • 1,113
  • 8
  • 26