Having trouble with %typemap(out)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Having trouble with %typemap(out)

Myria
Hi =^-^=

I'm trying to use SWIG with Lua, but I'm running into a problem with
%typemap(out).  With the following .i file:


%module Kitty

class Meow
{
};

Meow *ReturnTest();

%typemap(out) Meow * {
        thisworddoesntappearinoutput
}


...the ReturnTest wrapper is not using my typemap:


static int _wrap_ReturnTest(lua_State* L) {
  int SWIG_arg = 0;
  Meow *result = 0 ;

  SWIG_check_num_args("ReturnTest",0,0)
  result = (Meow *)ReturnTest();
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_Meow,0); SWIG_arg++;
  return SWIG_arg;

  if(0) SWIG_fail;

fail:
  lua_error(L);
  return SWIG_arg;
}



Why isn't this working?

Thanks,

Melissa

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Having trouble with %typemap(out)

William S Fulton
On 11 October 2016 at 20:34, Myria <[hidden email]> wrote:

> Hi =^-^=
>
> I'm trying to use SWIG with Lua, but I'm running into a problem with
> %typemap(out).  With the following .i file:
>
>
> %module Kitty
>
> class Meow
> {
> };
>
> Meow *ReturnTest();
>
The typemap below will only be used for code from this point onwards,
which clearly does not include the code above.

> %typemap(out) Meow * {
>         thisworddoesntappearinoutput
> }
>

William

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...