Hi,

> The patch does not work with Visual C++ 9.0 2008. The main problem is
> this macros
>
> +#define PUSH(s)      {                           \
> +                 if (stackp >= stack_end)\
> +                     return NULL;        \
> +                  *stackp++ = s;         \
> +             }
> +
> +#define POP()        ({                          \
> +                 if (stackp <= stack)    \
> +                     return NULL;        \
> +                 *--stackp;              \
> +              })
>
> But even though I have changed those macros to
>
> #define PUSH(s)       if (stackp >= stack_end) return NULL; *stackp =
> s; ++stackp;
> #define POP(var)       if (stackp <= stack) return NULL; --stackp; var
> = *stackp;
>
> the resulting gvim executable seems to be losing its regex capability,
> for example typing abc and then searching for a does not work.

({ ... }) is a gcc extension that converts statements to expressions.  
The expression has the value of the last statement in the block ( 
http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC62 
  ). That is, the macro can be used as

     a = PUSH(s);

or in other places where an expression is expected. If you convert the  
macro to a function, it should work on all compilers (and I guess it  
won't even be slower since the compiler will inline the function call  
automatically).

Nico

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui