Aaron Gray | 27 Apr 23:15

idc for windows platform

Hi,
 
Just signed onto fonc mailing list and am also in early stages of looking at MS VC porting of idc.
 
Basically your going to have to do a #ifdef for the MS platforms.
 
you need a comma and also a __VA_ARGS__ rather than a ##ARG, something like :-
 
#ifndef _MSC_VER
 
  #define _send(MSG, RCV, ARG...) ({     \
    register oop _r= (RCV);      \
    struct __closure *_c= (struct __closure *)_libid->bind((MSG), _r); \
    (_c->method)((oop)_c, _r, _r, ##ARG);     \
  })
 
#else
 
  #define _send(MSG, RCV, ...) ({     \
    register oop _r= (RCV);      \
    struct __closure *_c= (struct __closure *)_libid->bind((MSG), _r); \
    (_c->method)((oop)_c, _r, _r, __VA_ARGS__);     \
  })
 
#endif
 
Watch out for wrapped lines :)
 
I have not tried the above as of yet but it should work.
 
Aaron   
<div>
<div>
<div>Hi,</div>
<div>&nbsp;</div>
<div>Just signed onto&nbsp;fonc mailing list and am also 
in early stages of looking at MS VC porting of idc.</div>
<div>&nbsp;</div>
<div>Basically your going to have to do a #ifdef for the 
MS platforms.</div>
<div>&nbsp;</div>
<div>you need a comma and also a __VA_ARGS__ rather than 
a ##ARG, something like :-</div>
<div>&nbsp;</div>
<div>#ifndef _MSC_VER</div>
<div>&nbsp;</div>
<div>&nbsp; #define _send(MSG, RCV, ARG...) 
({&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp;&nbsp;&nbsp; register oop _r= 
(RCV);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp;&nbsp;&nbsp; struct __closure 
*_c= (struct __closure *)_libid-&gt;bind((MSG), _r); \<br>&nbsp;&nbsp;&nbsp; 
(_c-&gt;method)((oop)_c, _r, _r, ##ARG);&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp; 
})</div>
<div>&nbsp;</div>
<div>#else</div>
<div>&nbsp;</div>
<div>&nbsp; #define _send(MSG, RCV, ...) 
({&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp;&nbsp;&nbsp; register oop _r= 
(RCV);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>&nbsp;&nbsp;&nbsp; struct __closure 
*_c= (struct __closure *)_libid-&gt;bind((MSG), _r); \<br>&nbsp;&nbsp;&nbsp; 
(_c-&gt;method)((oop)_c, _r, _r, __VA_ARGS__);&nbsp;&nbsp;&nbsp;&nbsp; 
\<br>&nbsp; })</div>
<div>&nbsp;</div>
<div>#endif</div>
<div>&nbsp;</div>
<div>Watch out for wrapped lines :)</div>
<div>&nbsp;</div>
<div>I have not tried the above as of yet but it should 
work.</div>
<div>&nbsp;</div>
<div>Aaron&nbsp;&nbsp;&nbsp; 
</div>
</div>
</div>
Krzysztof Kowalczyk | 28 Apr 00:51

Re: idc for windows platform

The other form works for both msvc and gcc (see
http://codepad.org/VxF4pBHg for a proof (well, a proof that it
compiles with gcc, or at least a version of gcc)) so the #ifdef isn't
necessary, just use __VA_ARGS__ version. I verified that it compiles
with msvc 2005.

-- kjk

On Sun, Apr 27, 2008 at 2:18 PM, Aaron Gray
<aaronngray.lists@...> wrote:
> Just signed onto fonc mailing list and am also in early stages of looking at
> MS VC porting of idc.
>
> Basically your going to have to do a #ifdef for the MS platforms.
>
> you need a comma and also a __VA_ARGS__ rather than a ##ARG, something like
> :-
>
> #ifndef _MSC_VER
>
>   #define _send(MSG, RCV, ARG...) ({     \
>     register oop _r= (RCV);      \
>     struct __closure *_c= (struct __closure *)_libid->bind((MSG), _r); \
>     (_c->method)((oop)_c, _r, _r, ##ARG);     \
>   })
>
> #else
>
>   #define _send(MSG, RCV, ...) ({     \
>     register oop _r= (RCV);      \
>     struct __closure *_c= (struct __closure *)_libid->bind((MSG), _r); \
>     (_c->method)((oop)_c, _r, _r, __VA_ARGS__);     \
>   })
>
> #endif
>
> Watch out for wrapped lines :)
>
> I have not tried the above as of yet but it should work.
>
> Aaron
> _______________________________________________
>  fonc mailing list
>  fonc@...
>  http://vpri.org/mailman/listinfo/fonc
>
>

Michael FIG | 28 Apr 01:57

Re: idc for windows platform

Hi,

"Krzysztof Kowalczyk" <kkowalczyk@...> writes:

> The other form works for both msvc and gcc (see
> http://codepad.org/VxF4pBHg for a proof (well, a proof that it
> compiles with gcc, or at least a version of gcc)) so the #ifdef isn't
> necessary, just use __VA_ARGS__ version. I verified that it compiles
> with msvc 2005.

Using __VA_ARGS__ is not quite correct with GCC.  You should be able
to call the _send (or _sendv) macro without supplying any arguments
after RCV.  The comma preceding __VA_ARGS__ causes a syntax error
under GCC when there are no other arguments, but if you use ##ARG it
deletes the comma and all is well.

Does MSVC compile properly without arguments?

i.e. does:

_send("abc", 123)

cause a syntax error?

The whole point will be moot when COLA is bootstrapped and no longer
requires a C compiler to generate working executables.

Good luck,

--

-- 
Michael FIG <michael@...> //\
   http://michael.fig.org/    \//

Krzysztof Kowalczyk | 28 Apr 03:18

Re: idc for windows platform

>  "Krzysztof Kowalczyk" <kkowalczyk@...> writes:
>
>  > The other form works for both msvc and gcc (see
>  > http://codepad.org/VxF4pBHg for a proof (well, a proof that it
>  > compiles with gcc, or at least a version of gcc)) so the #ifdef isn't
>  > necessary, just use __VA_ARGS__ version. I verified that it compiles
>  > with msvc 2005.
>
>  Using __VA_ARGS__ is not quite correct with GCC.  You should be able
>  to call the _send (or _sendv) macro without supplying any arguments
>  after RCV.  The comma preceding __VA_ARGS__ causes a syntax error
>  under GCC when there are no other arguments, but if you use ##ARG it
>  deletes the comma and all is well.
>
>  Does MSVC compile properly without arguments?
>
>  i.e. does:
>
>  _send("abc", 123)
>
>  cause a syntax error?

Good point. MSVC handles that according to
http://msdn2.microsoft.com/en-us/library/ms177415(VS.80).aspx
and this test program, which compiles and works as expected with msvc
(and doesn't compile on gcc):

#include <stdio.h>
#define np(s, ...) \
	printf(s, __VA_ARGS__)

int main(int argc, char **argv)
{
  int d = 4;
  np("hello\n");
  np("s %d", d);
  return 0;
}

So #ifdef is needed after all. Alternatively, all places where
_send(a,b) is used, could be changed to _send0(a,b).

-- kjk

Aaron Gray | 28 Apr 03:28

Re: idc for windows platform

On Mon, Apr 28, 2008 at 2:18 AM, Krzysztof Kowalczyk <kkowalczyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>  "Krzysztof Kowalczyk" <kkowalczyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>  > The other form works for both msvc and gcc (see
>  > http://codepad.org/VxF4pBHg for a proof (well, a proof that it
>  > compiles with gcc, or at least a version of gcc)) so the #ifdef isn't
>  > necessary, just use __VA_ARGS__ version. I verified that it compiles
>  > with msvc 2005.
>
>  Using __VA_ARGS__ is not quite correct with GCC.  You should be able
>  to call the _send (or _sendv) macro without supplying any arguments
>  after RCV.  The comma preceding __VA_ARGS__ causes a syntax error
>  under GCC when there are no other arguments, but if you use ##ARG it
>  deletes the comma and all is well.
>
>  Does MSVC compile properly without arguments?
>
>  i.e. does:
>
>  _send("abc", 123)
>
>  cause a syntax error?

Good point. MSVC handles that according to
http://msdn2.microsoft.com/en-us/library/ms177415(VS.80).aspx
and this test program, which compiles and works as expected with msvc
(and doesn't compile on gcc):

#include <stdio.h>
#define np(s, ...) \
       printf(s, __VA_ARGS__)

int main(int argc, char **argv)
{
 int d = 4;
 np("hello\n");
 np("s %d", d);
 return 0;
}

So #ifdef is needed after all. Alternatively, all places where
_send(a,b) is used, could be changed to _send0(a,b).

Here's another possible solution if we are using C99 and have inline functions :-
 
#include <stdarg.h>
 
inline oop _send( oop msg, oop rcv, ...)
{
  va_list ap;
  register oop _r = rcv;
  struct __closure *_c;
  oop ret;

  va_start( ap, rcv);
  _c = (struct __closure *) _libid->bind( msg, _r);
  ret = (_c->method)( (oop) _c, _r, _r, ap);
  va_end( ap);
  return ret;
}
You will probably need a "#define inline __inline" for MS VC.
 
This is untested but should work okay. I am not at a state where I can really test this yet, hopefully I will be able to catch up this week.
 
Regards,
 
Aaron
 
 
 
<div><div class="gmail_quote">On Mon, Apr 28, 2008 at 2:18 AM, Krzysztof Kowalczyk &lt;<a href="mailto:kkowalczyk@...">kkowalczyk@...</a>&gt; wrote:<br><blockquote class="gmail_quote">
<div class="Ih2E3d">&gt; &nbsp;"Krzysztof Kowalczyk" &lt;<a href="mailto:kkowalczyk@...">kkowalczyk@...</a>&gt; writes:<br>&gt;<br>&gt; &nbsp;&gt; The other form works for both msvc and gcc (see<br>&gt; &nbsp;&gt; <a href="http://codepad.org/VxF4pBHg" target="_blank">http://codepad.org/VxF4pBHg</a> for a proof (well, a proof that it<br>
&gt; &nbsp;&gt; compiles with gcc, or at least a version of gcc)) so the #ifdef isn't<br>&gt; &nbsp;&gt; necessary, just use __VA_ARGS__ version. I verified that it compiles<br>&gt; &nbsp;&gt; with msvc 2005.<br>&gt;<br>&gt; &nbsp;Using __VA_ARGS__ is not quite correct with GCC. &nbsp;You should be able<br>
&gt; &nbsp;to call the _send (or _sendv) macro without supplying any arguments<br>&gt; &nbsp;after RCV. &nbsp;The comma preceding __VA_ARGS__ causes a syntax error<br>&gt; &nbsp;under GCC when there are no other arguments, but if you use ##ARG it<br>
&gt; &nbsp;deletes the comma and all is well.<br>&gt;<br>&gt; &nbsp;Does MSVC compile properly without arguments?<br>&gt;<br>&gt; &nbsp;i.e. does:<br>&gt;<br>&gt; &nbsp;_send("abc", 123)<br>&gt;<br>&gt; &nbsp;cause a syntax error?<br><br>
</div>Good point. MSVC handles that according to<br><a href="http://msdn2.microsoft.com/en-us/library/ms177415(VS.80).aspx" target="_blank">http://msdn2.microsoft.com/en-us/library/ms177415(VS.80).aspx</a><br>and this test program, which compiles and works as expected with msvc<br>
(and doesn't compile on gcc):<br><br>#include &lt;stdio.h&gt;<br>#define np(s, ...) \<br>&nbsp; &nbsp; &nbsp; &nbsp;printf(s, __VA_ARGS__)<br><br>int main(int argc, char **argv)<br>{<br>&nbsp;int d = 4;<br>&nbsp;np("hello\n");<br>&nbsp;np("s %d", d);<br>
&nbsp;return 0;<br>}<br><br>So #ifdef is needed after all. Alternatively, all places where<br>_send(a,b) is used, could be changed to _send0(a,b).<br><br>
</blockquote>
<div>Here's another possible solution if we are using C99 and have inline functions :-</div>
<div>&nbsp;</div>
<div>#include &lt;stdarg.h&gt;</div>
<div>&nbsp;</div>
<div>inline oop _send( oop msg, oop rcv, ...)<br>{<br>&nbsp; va_list ap;<br>&nbsp; register oop _r = rcv;<br>&nbsp; struct __closure *_c;<br>&nbsp; oop ret;</div>
<div>
<br>&nbsp; va_start( ap, rcv);<br>
</div>
<div>&nbsp; _c = (struct __closure *) _libid-&gt;bind( msg, _r);<br>&nbsp; ret = (_c-&gt;method)( (oop) _c, _r, _r, ap);<br>
</div>
<div>&nbsp; va_end( ap);<br>
</div>
<div>&nbsp; return ret;<br>}<br>
</div>
<div>You will probably need a "#define inline __inline" for MS VC.</div>
<div>&nbsp;</div>
<div>This is untested but should work okay. I am not at a state where I can really test this yet, hopefully I will be able to catch up this week.</div>
<div>&nbsp;</div>
<div>Regards,</div>
<div>&nbsp;</div>
<div>Aaron</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
</div></div>
Aaron Gray | 28 Apr 03:39

Re: idc for windows platform

On Mon, Apr 28, 2008 at 2:28 AM, Aaron Gray <aaronngray.lists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
On Mon, Apr 28, 2008 at 2:18 AM, Krzysztof Kowalczyk <kkowalczyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>  "Krzysztof Kowalczyk" <kkowalczyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>  > The other form works for both msvc and gcc (see
>  > http://codepad.org/VxF4pBHg for a proof (well, a proof that it
>  > compiles with gcc, or at least a version of gcc)) so the #ifdef isn't
>  > necessary, just use __VA_ARGS__ version. I verified that it compiles
>  > with msvc 2005.
>
>  Using __VA_ARGS__ is not quite correct with GCC.  You should be able
>  to call the _send (or _sendv) macro without supplying any arguments
>  after RCV.  The comma preceding __VA_ARGS__ causes a syntax error
>  under GCC when there are no other arguments, but if you use ##ARG it
>  deletes the comma and all is well.
>
>  Does MSVC compile properly without arguments?
>
>  i.e. does:
>
>  _send("abc", 123)
>
>  cause a syntax error?

Good point. MSVC handles that according to
http://msdn2.microsoft.com/en-us/library/ms177415(VS.80).aspx
and this test program, which compiles and works as expected with msvc
(and doesn't compile on gcc):

#include <stdio.h>
#define np(s, ...) \
       printf(s, __VA_ARGS__)

int main(int argc, char **argv)
{
 int d = 4;
 np("hello\n");
 np("s %d", d);
 return 0;
}

So #ifdef is needed after all. Alternatively, all places where
_send(a,b) is used, could be changed to _send0(a,b).

Here's another possible solution if we are using C99 and have inline functions :-
 
#include <stdarg.h>
 
inline oop _send( oop msg, oop rcv, ...)
{
  va_list ap;
  register oop _r = rcv;
  struct __closure *_c;
  oop ret;

  va_start( ap, rcv);
  _c = (struct __closure *) _libid->bind( msg, _r);
  ret = (_c->method)( (oop) _c, _r, _r, ap);
  va_end( ap);
  return ret;
}
You will probably need a "#define inline __inline" for MS VC.
 
This is untested but should work okay. I am not at a state where I can really test this yet, hopefully I will be able to catch up this week.
 
A hacked PoC :-
 
 
Aaron
 
 
 
<div>
<div class="gmail_quote">On Mon, Apr 28, 2008 at 2:28 AM, Aaron Gray &lt;<a href="mailto:aaronngray.lists@...">aaronngray.lists@...</a>&gt; wrote:<br><blockquote class="gmail_quote">
<div class="gmail_quote">
<div>
<div></div>
<div class="Wj3C7c">On Mon, Apr 28, 2008 at 2:18 AM, Krzysztof Kowalczyk &lt;<a href="mailto:kkowalczyk@..." target="_blank">kkowalczyk@...</a>&gt; wrote:<br><blockquote class="gmail_quote">
<div>&gt; &nbsp;"Krzysztof Kowalczyk" &lt;<a href="mailto:kkowalczyk@..." target="_blank">kkowalczyk@...</a>&gt; writes:<br>&gt;<br>&gt; &nbsp;&gt; The other form works for both msvc and gcc (see<br>&gt; &nbsp;&gt; <a href="http://codepad.org/VxF4pBHg" target="_blank">http://codepad.org/VxF4pBHg</a> for a proof (well, a proof that it<br>
&gt; &nbsp;&gt; compiles with gcc, or at least a version of gcc)) so the #ifdef isn't<br>&gt; &nbsp;&gt; necessary, just use __VA_ARGS__ version. I verified that it compiles<br>&gt; &nbsp;&gt; with msvc 2005.<br>&gt;<br>&gt; &nbsp;Using __VA_ARGS__ is not quite correct with GCC. &nbsp;You should be able<br>
&gt; &nbsp;to call the _send (or _sendv) macro without supplying any arguments<br>&gt; &nbsp;after RCV. &nbsp;The comma preceding __VA_ARGS__ causes a syntax error<br>&gt; &nbsp;under GCC when there are no other arguments, but if you use ##ARG it<br>
&gt; &nbsp;deletes the comma and all is well.<br>&gt;<br>&gt; &nbsp;Does MSVC compile properly without arguments?<br>&gt;<br>&gt; &nbsp;i.e. does:<br>&gt;<br>&gt; &nbsp;_send("abc", 123)<br>&gt;<br>&gt; &nbsp;cause a syntax error?<br><br>
</div>Good point. MSVC handles that according to<br><a href="http://msdn2.microsoft.com/en-us/library/ms177415(VS.80).aspx" target="_blank">http://msdn2.microsoft.com/en-us/library/ms177415(VS.80).aspx</a><br>and this test program, which compiles and works as expected with msvc<br>
(and doesn't compile on gcc):<br><br>#include &lt;stdio.h&gt;<br>#define np(s, ...) \<br>&nbsp; &nbsp; &nbsp; &nbsp;printf(s, __VA_ARGS__)<br><br>int main(int argc, char **argv)<br>{<br>&nbsp;int d = 4;<br>&nbsp;np("hello\n");<br>&nbsp;np("s %d", d);<br>
&nbsp;return 0;<br>}<br><br>So #ifdef is needed after all. Alternatively, all places where<br>_send(a,b) is used, could be changed to _send0(a,b).<br><br>
</blockquote>
</div>
</div>
<div>Here's another possible solution if we are using C99 and have inline functions :-</div>
<div>&nbsp;</div>
<div>#include &lt;stdarg.h&gt;</div>
<div>&nbsp;</div>
<div>inline oop _send( oop msg, oop rcv, ...)<br>{<br>&nbsp; va_list ap;<br>&nbsp; register oop _r = rcv;<br>&nbsp; struct __closure *_c;<br>&nbsp; oop ret;</div>
<div>
<br>&nbsp; va_start( ap, rcv);<br>
</div>
<div>&nbsp; _c = (struct __closure *) _libid-&gt;bind( msg, _r);<br>&nbsp; ret = (_c-&gt;method)( (oop) _c, _r, _r, ap);<br>
</div>
<div>&nbsp; va_end( ap);<br>
</div>
<div>&nbsp; return ret;<br>}<br>
</div>
<div>You will probably need a "#define inline __inline" for MS VC.</div>
<div>&nbsp;</div>
<div>This is untested but should work okay. I am not at a state where I can really test this yet, hopefully I will be able to catch up this week.</div>
<div></div>&nbsp;</div>
</blockquote>
</div>
<div>A hacked PoC :-</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp; <a href="http://codepad.org/8tZyQphW">http://codepad.org/8tZyQphW</a>
</div>
<div>&nbsp;</div>
<div>Aaron</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote">
<div class="gmail_quote">
<div>
<span></span>&nbsp;</div>
<blockquote class="gmail_quote">
<div class="gmail_quote">
<div>&nbsp;</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
Michael FIG | 28 Apr 03:48

Re: idc for windows platform

Hi,

"Aaron Gray" <aaronngray.lists@...> writes:

>       va_start( ap, rcv);
>       _c = (struct __closure *) _libid->bind( msg, _r);
>       ret = (_c->method)( (oop) _c, _r, _r, ap);
>       va_end( ap);

This changes the calling convention... the "ap" argument does not pass
the remaining arguments on the stack, it passes a pointer to them, so
they wouldn't be usable as named parameters.

I think using the __VA_ARGS__ macro is best for MSVC, as per the
reference Krzysztof posted.  Too bad it was introduced in Visual C++
2005... I only have access to 2003.

--

-- 
Michael FIG <michael@...> //\
   http://michael.fig.org/    \//

Aaron Gray | 28 Apr 03:55

Re: idc for windows platform

On Mon, Apr 28, 2008 at 2:48 AM, Michael FIG <michael-y8U0i/lyZOM@public.gmane.org> wrote:
Hi,

"Aaron Gray" <aaronngray.lists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> writes:

>       va_start( ap, rcv);
>       _c = (struct __closure *) _libid->bind( msg, _r);
>       ret = (_c->method)( (oop) _c, _r, _r, ap);
>       va_end( ap);

This changes the calling convention... the "ap" argument does not pass
the remaining arguments on the stack, it passes a pointer to them, so
they wouldn't be usable as named parameters.
Ah, should have noticed that :)
 
Oh, well have to use preprocessor then :(

>I think using the __VA_ARGS__ macro is best for MSVC, as per the
>reference Krzysztof posted.  Too bad it was introduced in Visual C++
>2005... I only have access to 2003.
 
You could use Microsoft Visual Studio Express version :-
 
 
Regards,
 
Aaron
 
<div><div class="gmail_quote">On Mon, Apr 28, 2008 at 2:48 AM, Michael FIG &lt;<a href="mailto:michael@...">michael@...</a>&gt; wrote:<br><blockquote class="gmail_quote">Hi,<br><div class="Ih2E3d">
<br>"Aaron Gray" &lt;<a href="mailto:aaronngray.lists@...">aaronngray.lists@...</a>&gt; writes:<br><br>&gt; &nbsp; &nbsp; &nbsp; va_start( ap, rcv);<br>&gt; &nbsp; &nbsp; &nbsp; _c = (struct __closure *) _libid-&gt;bind( msg, _r);<br>
&gt; &nbsp; &nbsp; &nbsp; ret = (_c-&gt;method)( (oop) _c, _r, _r, ap);<br>&gt; &nbsp; &nbsp; &nbsp; va_end( ap);<br><br>
</div>This changes the calling convention... the "ap" argument does not pass<br>the remaining arguments on the stack, it passes a pointer to them, so<br>
they wouldn't be usable as named parameters.<br>
</blockquote>
<div>Ah, should have noticed that&nbsp;:)</div>
<div>&nbsp;</div>
<div>Oh, well have to use preprocessor then :(</div>
<div>
<br>&gt;I think using the __VA_ARGS__ macro is best for MSVC, as per the<br>&gt;reference Krzysztof posted. &nbsp;Too bad it was introduced in Visual C++<br>&gt;2005... I only have access to 2003.</div>
<div>&nbsp;</div>
<div>You could use Microsoft Visual Studio Express version :-</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp; <a href="http://www.microsoft.com/express/vc/">http://www.microsoft.com/express/vc/</a>
</div>
<div>&nbsp;</div>
<div>Regards,</div>
<div>&nbsp;</div>
<div>Aaron</div>
<div>&nbsp;</div>
</div></div>
Aaron Gray | 28 Apr 04:48

Re: idc for windows platform



On Mon, Apr 28, 2008 at 2:55 AM, Aaron Gray <aaronngray.lists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
On Mon, Apr 28, 2008 at 2:48 AM, Michael FIG <michael-y8U0i/lyZOM@public.gmane.org> wrote:
Hi,

"Aaron Gray" <aaronngray.lists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> writes:

>       va_start( ap, rcv);
>       _c = (struct __closure *) _libid->bind( msg, _r);
>       ret = (_c->method)( (oop) _c, _r, _r, ap);
>       va_end( ap);

This changes the calling convention... the "ap" argument does not pass
the remaining arguments on the stack, it passes a pointer to them, so
they wouldn't be usable as named parameters.
Ah, should have noticed that :)
 
Oh, well have to use preprocessor then :(
 
Just as well, the code generation is crap, and it does not get inlined either, vaargs and inlining do not mix on VS 2008. Shame as I wanted to use it to pass tuples :(
 
Aaron
 
<div>
<br><br><div class="gmail_quote">On Mon, Apr 28, 2008 at 2:55 AM, Aaron Gray &lt;<a href="mailto:aaronngray.lists@...">aaronngray.lists@...</a>&gt; wrote:<br><blockquote class="gmail_quote">
<div class="gmail_quote">
<div class="Ih2E3d">On Mon, Apr 28, 2008 at 2:48 AM, Michael FIG &lt;<a href="mailto:michael@..." target="_blank">michael@...</a>&gt; wrote:<br><blockquote class="gmail_quote">Hi,<br><div>
<br>"Aaron Gray" &lt;<a href="mailto:aaronngray.lists@..." target="_blank">aaronngray.lists@...</a>&gt; writes:<br><br>&gt; &nbsp; &nbsp; &nbsp; va_start( ap, rcv);<br>&gt; &nbsp; &nbsp; &nbsp; _c = (struct __closure *) _libid-&gt;bind( msg, _r);<br>
&gt; &nbsp; &nbsp; &nbsp; ret = (_c-&gt;method)( (oop) _c, _r, _r, ap);<br>&gt; &nbsp; &nbsp; &nbsp; va_end( ap);<br><br>
</div>This changes the calling convention... the "ap" argument does not pass<br>the remaining arguments on the stack, it passes a pointer to them, so<br>
they wouldn't be usable as named parameters.<br>
</blockquote>
</div>
<div>Ah, should have noticed that&nbsp;:)</div>
<div>&nbsp;</div>
<div>Oh, well have to use preprocessor then :(</div>
</div>
</blockquote>
<div>&nbsp;</div>
<div>Just as well, the code generation is crap, and it does not get inlined either, vaargs and inlining do not mix on VS 2008. Shame as I wanted to use it to pass tuples :(</div>
<div>&nbsp;</div>
<div>Aaron</div>
<div>&nbsp;</div>
</div>
</div>

Gmane