Pb with cpp target

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Pb with cpp target

sledorze
(with the last trunk)
When Host.hx is compiled, this code:

        static function __init__() {
                cpp.Lib.load("std","socket_init",0)();
        }
is translated to:


void Host_obj::__init__()::cpp::Lib_obj::load(HX_CSTRING("std"),HX_CSTRING("socket_init"),(int)0)()

Which does not compile.
I think it should be:

void Host_obj::__init__() {
  cpp::Lib_obj::load(HX_CSTRING("std"),HX_CSTRING("socket_init"),(int)0);
}

I think it must be a pretty common pattern, so, should be a regression.

Stephane
Reply | Threaded
Open this post in threaded view
|

Re: Pb with cpp target

Jan_Flanders
On Sat, Mar 12, 2011 at 6:33 PM, sledorze <[hidden email]> wrote:

> (with the last trunk)
> When Host.hx is compiled, this code:
>
>        static function __init__() {
>                cpp.Lib.load("std","socket_init",0)();
>        }
> is translated to:
>
>
> void
> Host_obj::__init__()::cpp::Lib_obj::load(HX_CSTRING("std"),HX_CSTRING("socket_init"),(int)0)()
>
> Which does not compile.


Same remark as the last part in this post:
http://haxe.1354130.n2.nabble.com/Load-image-from-external-server-with-NME-for-CPP-target-tp6095063p6099489.html

Jan

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Pb with cpp target

sledorze
Thanks! everything works as expected :)

Also missing asynchronicity and wondering if it will change or if I should implement some concurrency constructs on top of the nme API.. (or bring Stax in the scope)
Has it been discussed so far?

Stephane



Reply | Threaded
Open this post in threaded view
|

Re: Pb with cpp target

Gamehaxe
In reply to this post by sledorze
Hi,
Yes, I'm pretty sure this is working in 2.07 release - sounds like an
issue with some of the code-cleanup code that has been written recently.

Nicolas, should I be dealing with this in hxcpp, or is it a codegen issue?

Hugh

> (with the last trunk)
> When Host.hx is compiled, this code:
>
> static function __init__() {
> cpp.Lib.load("std","socket_init",0)();
> }
> is translated to:
>
>
> void
> Host_obj::__init__()::cpp::Lib_obj::load(HX_CSTRING("std"),HX_CSTRING("socket_init"),(int)0)()
>
> Which does not compile.
> I think it should be:
>
> void Host_obj::__init__() {
>   cpp::Lib_obj::load(HX_CSTRING("std"),HX_CSTRING("socket_init"),(int)0);
> }
>
> I think it must be a pretty common pattern, so, should be a regression.
>
> Stephane
>
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/Pb-with-cpp-target-tp6164747p6164747.html
> Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Pb with cpp target

Nicolas Cannasse
Le 13/03/2011 04:15, Hugh Sanderson a écrit :
> Hi,
> Yes, I'm pretty sure this is working in 2.07 release - sounds like an
> issue with some of the code-cleanup code that has been written recently.
>
> Nicolas, should I be dealing with this in hxcpp, or is it a codegen issue?

Because the cf_init is a single expression and not a function, the
sanitizer will remove its surroundings { }. Other platforms might
generate all cf_init init expressions in a single init function, so I
guess this behavior is correct and you should fix it in gencpp.

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org