Alt-FFI-Raw-Platypus

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN


                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or (at your option)
    any later version.

README  view on Meta::CPAN

    This distribution provides an alternative implementation of FFI::Raw
    that uses FFI::Platypus instead of its own XS code. This may be useful
    in situations that you want to use modules that rely on FFI::Raw on
    platforms that are not supported by the original implementation. This
    approach should allow you to use FFI::Raw code without changing any
    code!

    This implementation uses FFI::Platypus::Legacy::Raw which is a fork of
    the original FFI::Raw that lives in its own namespace. The former is
    useful when you want to migrate to Platypus from Raw to take advantage
    of its type system and ability to attach xsubs, but do not want to
    change all of your code all at once.

SEE ALSO

    Alt

    FFI::Platypus

    FFI::Platypus::Legacy::Raw

lib/Alt/FFI/Raw/Platypus.pm  view on Meta::CPAN


This distribution provides an alternative implementation of L<FFI::Raw> that uses
L<FFI::Platypus> instead of its own XS code.  This may be useful in situations
that you want to use modules that rely on L<FFI::Raw> on platforms that are not
supported by the original implementation.  This approach should allow you to use
L<FFI::Raw> code without changing any code!

This implementation uses L<FFI::Platypus::Legacy::Raw> which is a fork of the
original L<FFI::Raw> that lives in its own namespace.  The former is useful when
you want to migrate to Platypus from Raw to take advantage of its type system
and ability to attach xsubs, but do not want to change all of your code all at
once.

=head1 SEE ALSO

=over 4

=item L<Alt>

=item L<FFI::Platypus>

lib/FFI/Raw.pm  view on Meta::CPAN

  no strict 'refs';
  *$function = *{"FFI::Platypus::Legacy::Raw::$function"};
}

sub platypus
{
  require Carp;
  Carp::croak("platypus not available for FFI::Raw interface");
}

sub attach
{
  require Carp;
  Carp::croak("attach not available for FFI::Raw interface");
}

1;

__END__

=pod

=encoding UTF-8

t/alt_ffi_raw_platypus.t  view on Meta::CPAN

use Test2::V0 -no_srand => 1;
use Alt::FFI::Raw::Platypus;
use FFI::Raw;

subtest 'do not allow extensions' => sub {

  eval { FFI::Raw->attach };
  like $@, qr/attach not available for FFI::Raw interface/;

  eval { FFI::Raw->platypus };
  like $@, qr/platypus not available for FFI::Raw interface/;

};

done_testing



( run in 0.767 second using v1.01-cache-2.11-cpan-e1769b4cff6 )