Forum: Ruby ruby macro bind conflicts tr1 on msvc9.0

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Christoph Heindl (Guest)
on 2009-01-17 11:27
(Received via mailing list)

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 <xxbind>

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

#ifdef bind
#undef bind
#define bind(s, a, l)    rb_w32_bind(s, a, l)

<xxbind> has template methods such as
template<class _Ret,
  class _Fty
    _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,
This topic is locked and can not be replied to.