# Ruby macro bind conflicts tr1 on msvc9.0

**URL:** <https://www.ruby-forum.com/t/ruby-macro-bind-conflicts-tr1-on-msvc9-0/157984>\
**Category:** Ruby\
**Created:** [January 17, 2009, 10:27am UTC](https://www.ruby-forum.com/t/ruby-macro-bind-conflicts-tr1-on-msvc9-0/157984 "2009-01-17T10:27:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christoph\_Heindl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@Christoph\_Heindl](https://www.ruby-forum.com/u/Christoph_Heindl)\
**Post date:** [January 17, 2009, 10:27am UTC](https://www.ruby-forum.com/t/ruby-macro-bind-conflicts-tr1-on-msvc9-0/157984/1 "2009-01-17T10:27:29Z")

</div>

Hi,

It seems that the macro bind as defined in trunk/include/ruby/win32.h  
conflicts with added tr1 support to msvc9.0 (which is essentially  
SP1). The conflict arises when \<trunk/include/ruby/win32.h\> is  
included along with visual studio standard tr1 include

\<trunk/include/ruby/win32.h\> defines:

#ifdef bind  
#undef bind  
#endif  
#define bind(s, a, l) rb\_w32\_bind(s, a, l)

has template methods such as  
template\<class \_Ret,  
class \_Fty  
\_C\_CLASS\_ARG0\>  
\_Bind\<\_Ret,  
\_BINDN\<\_Callable\_obj\<\_Fty\> \_C\_ARG0\_ARG1\> \>  
bind(\_Fty \_Val \_C\_ARG0\_A0) // \<— here!  
{ // bind to UDT and user-specified return type  
typedef \_BINDN\<\_Callable\_obj\<\_Fty\> \_C\_ARG0\_ARG1\> \_MyBind;  
return (\_Bind\<\_Ret, \_MyBind\>(\_MyBind(\_Val \_C\_A0\_A1)));  
}

Renaming the macro fixed the problem for compiling the ruby wrappers  
I’m working on.

Any solutions other than renaming are appreciated.

Best regards,  
Christoph
