Re: weak_ref issue patch

Glen Fraser <[email protected]> Mon, 22 Jul 2013 16:49:52 +0200
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
--===============0802250004842969901==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_7F6FCDB3-F50B-4345-AA4F-734FCFE3FB09"


--Apple-Mail=_7F6FCDB3-F50B-4345-AA4F-734FCFE3FB09
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

It turns out that the patch does not fix my problem.  After more =
web-searching, I see I should be using the adopt policy =
(http://www.rasterbar.com/products/luabind/docs.html#adopt), to pass Lua =
object ownership to C++.  However, whenever I try to include =
luabind/adopt_policy.hpp, I get tons of errors (on Xcode 4.6.3 with =
clang or gcc).

With Clang LLVM:
.../addons/ofxLua/src/luabind/luabind/handle.hpp:136:5: Expected member =
name or ';' after declaration specifiers
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:82:3: =
Declaration does not declare anything
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:83:3: =
Declaration does not declare anything
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:91:71: =
Expected unqualified-id
.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:534:45: Too many =
arguments provided to function-like macro invocation
.../addons/ofxLua/src/luabind/luabind/nil.hpp:36:40: Expected =
unqualified-id
.../addons/ofxLua/src/luabind/luabind/object.hpp:109:5: Declaration does =
not declare anything
.../addons/ofxLua/src/luabind/luabind/object.hpp:110:5: Declaration does =
not declare anything
.../addons/ofxLua/src/luabind/luabind/object.hpp:116:57: Expected =
unqualified-id
.../addons/ofxLua/src/luabind/luabind/object.hpp:884:5: Expected member =
name or ';' after declaration specifiers
.../addons/ofxLua/src/luabind/luabind/object.hpp:905:5: Expected member =
name or ';' after declaration specifiers
.../addons/ofxLua/src/luabind/luabind/object.hpp:1249:37: Too many =
arguments provided to function-like macro invocation
.../addons/ofxLua/src/luabind/luabind/object.hpp:1249:17: Function =
definition does not declare parameters
.../addons/ofxLua/src/luabind/luabind/object.hpp:1251:53: Too many =
arguments provided to function-like macro invocation
.../addons/ofxLua/src/ofxLua.h:590:20: No member named 'nil' in =
namespace 'luabind'
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:94:33: =
Non-type template argument of type 'bool' is not an integral constant =
expression
.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:195:9: No =
matching function for call to 'make_pointee_instance'
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:94:33: =
Non-type template argument of type 'bool' is not an integral constant =
expression
.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:195:9: No =
matching function for call to 'make_pointee_instance'
.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:534:36: No =
member named 'check' in =
'luabind::value_wrapper_traits<luabind::adl::argument>'

With LLVM GCC:
.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:534: Macro =
"check" passed 2 arguments, but takes just 1
.../addons/ofxLua/src/luabind/luabind/object.hpp:1249: Macro "check" =
passed 2 arguments, but takes just 1
.../addons/ofxLua/src/luabind/luabind/object.hpp:1251: Macro "check" =
passed 2 arguments, but takes just 1
.../addons/ofxLua/src/luabind/luabind/handle.hpp:136: Expected =
unqualified-id before '{' token
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:82: =
Expected unqualified-id before ';' token
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:83: =
Declaration does not declare anything
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:90: =
Expected unqualified-id before ')' token
.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:94: =
'luabind::detail::has_get_pointer_::impl<T>::value' is not a valid =
template argument for type 'bool' because it is a non-constant =
expression
.../addons/ofxLua/src/luabind/luabind/nil.hpp:36: Expected =
unqualified-id before '__null'
.../addons/ofxLua/src/luabind/luabind/object.hpp:109: Expected =
unqualified-id before ';' token
.../addons/ofxLua/src/luabind/luabind/object.hpp:110: Declaration does =
not declare anything
.../addons/ofxLua/src/luabind/luabind/object.hpp:115: Expected =
unqualified-id before ')' token
.../addons/ofxLua/src/luabind/luabind/object.hpp:119: =
'luabind::adl::is_object_interface_aux::impl<T>::value' is not a valid =
template argument for type 'bool' because it is a non-constant =
expression

(and many more)

As you can see, I'm using a version of luabind in the ofxLua project, =
but I also tried taking a copy of luabind directly from Git =
(https://github.com/luabind/luabind), but had a similar pile of compile =
errors.  Anyone else run into something similar?  More important, can =
anyone help me with this?

Thanks,
Glen.

On Jul 22, 2013, at 2:02 PM, Glen F <[email protected]> wrote:

> Hi there, I know this is an old thread...  Was there no follow-up on =
this?=20
> I've run into the same problem with weak references getting garbage
> collected when deriving from C++ classes.
>=20
> Max's patch hasn't been integrated into luabind, as far as I can tell. =
 I'm
> happy to fork my own luabind and patch it, but wondering why this was =
not
> put into the main repo -- was it not judged a correct fix?
>=20
> Thanks,
> Glen.
>=20
>=20
>=20
>=20
> --
> View this message in context: =
http://lua.2524044.n2.nabble.com/weak-ref-issue-patch-tp7581558p7650973.ht=
ml
> Sent from the Lua C++ Bind mailing list archive at Nabble.com.
>=20
> =
--------------------------------------------------------------------------=
----
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> =
http://pubads.g.doubleclick.net/gampad/clk?id=3D48808831&iu=3D/4140/ostg.c=
lktrk
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user


--Apple-Mail=_7F6FCDB3-F50B-4345-AA4F-734FCFE3FB09
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">It =
turns out that the patch does not fix my problem. &nbsp;After more =
web-searching, I see I should be using the adopt policy (<a =
href=3D"http://www.rasterbar.com/products/luabind/docs.html#adopt">http://=
www.rasterbar.com/products/luabind/docs.html#adopt</a>), to pass Lua =
object ownership to C++. &nbsp;However, whenever I try to include =
luabind/adopt_policy.hpp, I get tons of errors (on Xcode 4.6.3 with =
clang or gcc).<div><br></div><div><b>With Clang =
LLVM:</b></div><div>.../addons/ofxLua/src/luabind/luabind/handle.hpp:136:5=
: Expected member name or ';' after declaration =
specifiers</div><div>.../addons/ofxLua/src/luabind/luabind/detail/has_get_=
pointer.hpp:82:3: Declaration does not declare =
anything<br>.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.h=
pp:83:3: Declaration does not declare =
anything<br>.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.h=
pp:91:71: Expected =
unqualified-id<br>.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:=
534:45: Too many arguments provided to function-like =
macro&nbsp;invocation<br>.../addons/ofxLua/src/luabind/luabind/nil.hpp:36:=
40: Expected =
unqualified-id<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:109:5: =
Declaration does not declare =
anything<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:110:5: =
Declaration does not declare =
anything<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:116:57: =
Expected =
unqualified-id<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:884:5: =
Expected member name or ';' after declaration =
specifiers<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:905:5: =
Expected member name or ';' after declaration =
specifiers<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:1249:37: =
Too many arguments provided to function-like macro =
invocation<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:1249:17: =
Function definition does not declare =
parameters<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:1251:53: =
Too many arguments provided to function-like macro =
invocation<br>.../addons/ofxLua/src/ofxLua.h:590:20: No member named =
'nil' in namespace =
'luabind'<br>.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.=
hpp:94:33: Non-type template argument of type 'bool' is not&nbsp;an =
integral constant =
expression<br>.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:195:=
9: No matching function for call to =
'make_pointee_instance'<br>.../addons/ofxLua/src/luabind/luabind/detail/ha=
s_get_pointer.hpp:94:33: Non-type template argument of type 'bool' is =
not&nbsp;an integral constant =
expression<br>.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp:195:=
9: No matching function for call to =
'make_pointee_instance'<br>.../addons/ofxLua/src/luabind/luabind/detail/po=
licy.hpp:534:36: No member named 'check' =
in&nbsp;'luabind::value_wrapper_traits&lt;luabind::adl::argument&gt;'<br><=
/div><div><br></div><div><b>With LLVM =
GCC:</b></div><div>.../addons/ofxLua/src/luabind/luabind/detail/policy.hpp=
:534: Macro&nbsp;"check" passed 2 arguments, but takes just =
1<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:1249: =
Macro&nbsp;"check" passed 2 arguments, but takes just =
1<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:1251: =
Macro&nbsp;"check" passed 2 arguments, but takes just =
1<br>.../addons/ofxLua/src/luabind/luabind/handle.hpp:136: =
Expected&nbsp;unqualified-id before '{' =
token<br>.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:=
82: Expected unqualified-id before ';' =
token<br>.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:=
83: Declaration does not declare =
anything<br>.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.h=
pp:90: Expected unqualified-id before ')' =
token<br>.../addons/ofxLua/src/luabind/luabind/detail/has_get_pointer.hpp:=
94: 'luabind::detail::has_get_pointer_::impl&lt;T&gt;::value' is not a =
valid template argument&nbsp;for type 'bool' because it is a =
non-constant =
expression<br>.../addons/ofxLua/src/luabind/luabind/nil.hpp:36: =
Expected&nbsp;unqualified-id before =
'__null'<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:109: =
Expected&nbsp;unqualified-id before ';' =
token<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:110: =
Declaration&nbsp;does not declare =
anything<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:115: =
Expected&nbsp;unqualified-id before ')' =
token<br>.../addons/ofxLua/src/luabind/luabind/object.hpp:119:&nbsp;'luabi=
nd::adl::is_object_interface_aux::impl&lt;T&gt;::value' is not a valid =
template argument&nbsp;for type 'bool' because it is a non-constant =
expression<br><br>(and&nbsp;many more)</div><div><br></div><div>As you =
can see, I'm using a version of luabind in the ofxLua project, but I =
also tried taking a copy of luabind directly from Git (<a =
href=3D"https://github.com/luabind/luabind">https://github.com/luabind/lua=
bind</a>), but had a similar pile of compile errors. &nbsp;Anyone else =
run into something similar? &nbsp;More important, can anyone help me =
with =
this?</div><div><br></div><div>Thanks,</div><div>Glen.</div><div><br></div=
><div><div><div><div>On Jul 22, 2013, at 2:02 PM, Glen F &lt;<a =
href=3D"mailto:[email protected]">[email protected]</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite">Hi there, I know this is an old thread... &nbsp;Was there =
no follow-up on this? <br>I've run into the same problem with weak =
references getting garbage<br>collected when deriving from C++ =
classes.<br><br>Max's patch hasn't been integrated into luabind, as far =
as I can tell. &nbsp;I'm<br>happy to fork my own luabind and patch it, =
but wondering why this was not<br>put into the main repo -- was it not =
judged a correct =
fix?<br><br>Thanks,<br>Glen.<br><br><br><br><br>--<br>View this message =
in context: <a =
href=3D"http://lua.2524044.n2.nabble.com/weak-ref-issue-patch-tp7581558p76=
50973.html">http://lua.2524044.n2.nabble.com/weak-ref-issue-patch-tp758155=
8p7650973.html</a><br>Sent from the Lua C++ Bind mailing list archive at =
<a =
href=3D"http://Nabble.com">Nabble.com</a>.<br><br>------------------------=
------------------------------------------------------<br>See everything =
from the browser to the database with AppDynamics<br>Get end-to-end =
visibility with application monitoring from AppDynamics<br>Isolate =
bottlenecks and diagnose root cause in seconds.<br>Start your free trial =
of AppDynamics Pro today!<br><a =
href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D48808831&amp;iu=3D=
/4140/ostg.clktrk">http://pubads.g.doubleclick.net/gampad/clk?id=3D4880883=
1&amp;iu=3D/4140/ostg.clktrk</a><br>______________________________________=
_________<br>luabind-user mailing =
list<br>[email protected]<br>https://lists.sourceforge.ne=
t/lists/listinfo/luabind-user<br></blockquote></div><br></div></div></body=
></html>=

--Apple-Mail=_7F6FCDB3-F50B-4345-AA4F-734FCFE3FB09--


--===============0802250004842969901==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
--===============0802250004842969901==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user

--===============0802250004842969901==--