InlineX-CPP2XS

 view release on metacpan or  search on metacpan

demos/cpp/Inherit.xs  view on Meta::CPAN

Foo::DESTROY()

int
Foo::get_secret()

void
Foo::set_secret(s)
	int	s
    PREINIT:
	I32 *	__temp_markstack_ptr;
    PPCODE:
	__temp_markstack_ptr = PL_markstack_ptr++;
	THIS->set_secret(s);
        if (PL_markstack_ptr != __temp_markstack_ptr) {
          /* truly void, because dXSARGS not invoked */
          PL_markstack_ptr = __temp_markstack_ptr;
          XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
        return; /* assume stack size is correct */

demos/cpp/Inherit.xs  view on Meta::CPAN

	int	s

void
Bar::DESTROY()

void
Bar::set_secret(s)
	int	s
    PREINIT:
	I32 *	__temp_markstack_ptr;
    PPCODE:
	__temp_markstack_ptr = PL_markstack_ptr++;
	THIS->set_secret(s);
        if (PL_markstack_ptr != __temp_markstack_ptr) {
          /* truly void, because dXSARGS not invoked */
          PL_markstack_ptr = __temp_markstack_ptr;
          XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
        return; /* assume stack size is correct */

t/t_cpp.t  view on Meta::CPAN

     $count++ if $_ =~ /#include <iostream/;		#2
     $count++ if $_ =~ /class Foo/;			#1
     $count++ if $_ =~ /protected:/;			#1
     $count++ if $_ =~ /class Bar/;			#1
     $count++ if $_ =~ /PACKAGE/;			#3
     $count++ if $_ =~ /Foo::DESTROY/;			#1
     $count++ if $_ =~ /Bar::DESTROY/;			#1
     $count++ if $_ =~ /PROTOTYPES: DISABLE/;		#3
     $count++ if $_ =~ /BOOT/;				#1
     $count++ if $_ =~ /PREINIT:/;			#2
     $count++ if $_ =~ /PPCODE:/;			#2
     $count++ if $_ =~ /set_secret/;			#6
  }
}

if($ok && ($count != 24)) {
  warn "Inherit.xs not as expected\n";
  print "not ok 1\n";
}

elsif($ok) {print "ok 1\n"}

t/t_hello.t  view on Meta::CPAN



if($ok) {
  for(@rd1) {
     $count++ if $_ =~ /#include <iostream/;			#2
     $count++ if $_ =~ /void greet/;				#1
     $count++ if $_ =~ /MODULE/;				#1
     $count++ if $_ =~ /PACKAGE/;				#1
     $count++ if $_ =~ /PREFIX = remove_/;			#1
     $count++ if $_ =~ /PREINIT:/;				#1
     $count++ if $_ =~ /PPCODE:/;				#1
     $count++ if $_ =~ /BOOT:/;					#1
     $count++ if $_ =~ /printf\(\"Hi from bootstrap\\n\"\);/;	#1
     $count++ if $_ =~ /Remove_me_foo/;				#2
     $count++ if $_ =~ /PROTOTYPES: DISABLE/;			#1
  }
}

if($ok && ($count != 13)) {
  warn "hello.xs not as expected\n";
  print "not ok 1\n";



( run in 0.413 second using v1.01-cache-2.11-cpan-5511b514fd6 )