This forum has been archived. Please start a new discussion on GitHub.

slice and WinXP SP2 SDK

slice generated files contain __in and __out as identifiers, conflict with WinXP SP2 SDK.

slice generates codes:
    ::IceInternal::Outgoing __out(__connection.get(), __reference.get(), __operation, static_cast< ::Ice::OperationMode>(2), __context, __compress);

WinINet.h includes a new header file, specstrings.h, which has some macros with same names defined:

specstrings.h, line 214:
    #define __in                    __pre __valid \
                                    __pre __deref __readonly

    // __out p
    // Specifices that the pointer p is an OUT paramters.  It has the
    // precodition that the pointer is not null.  The purpose of the
    // "__exceptthat __mabyereadonly" statement is to enable the common
    // annotation of "__in __out p".  The postcondition is the pointer
    // must be valid and the memory the pointer references must be
    // valid.
    #define __out                   __pre __notnull \
                                    __pre __deref __exceptthat __maybereadonly \
                                    __post __valid


  • IIRC, C++ standard says that identifiers begin with underline(s) are reserved to complier/runtime lib implementations.
  • Thanks for the bug report! We'll fix this, of course.

    You are right about the reserved identifiers. This is one thing that is a real problem in C++: there is a reserved namespace for the compiler and libraries, but no reserved namespace for applications (or application libraries). Yet, to be certain that clashes with user-defined symbols cannot happen, leading underscores are pretty the only option.


  • The thread here:
    states pretty much the same thing when VS 2005 Beta 2 is installed.