update
This commit is contained in:
parent
f24c4ebc63
commit
c73f9039ec
|
@ -10,6 +10,7 @@ if test "$PHP_ARMA" != "no"; then
|
|||
ARMA_SRC=" \
|
||||
src/php_arma.cc \
|
||||
src/constants.cc \
|
||||
src/base.cc \
|
||||
src/complex.cc \
|
||||
src/mapval.cc \
|
||||
"
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// php-armadillo/base.cc
|
||||
//
|
||||
// @Author CismonX
|
||||
//
|
||||
|
||||
#include "base.hh"
|
||||
|
||||
namespace php_arma
|
||||
{
|
||||
void base_init()
|
||||
{
|
||||
base_ce = interface_register<base_php_name>();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// php-armadillo/base.hh
|
||||
//
|
||||
// @Author CismonX
|
||||
//
|
||||
|
||||
#ifndef PHP_ARMA_BASE_HH
|
||||
#define PHP_ARMA_BASE_HH
|
||||
|
||||
#include "php_arma.hh"
|
||||
|
||||
namespace php_arma
|
||||
{
|
||||
template <typename T, typename ChildT>
|
||||
struct base
|
||||
{
|
||||
using native_t = typename ChildT::native_t;
|
||||
};
|
||||
|
||||
void base_init();
|
||||
|
||||
constexpr const char base_php_name[] = "Internal\\Base";
|
||||
|
||||
inline zend_class_entry *base_ce;
|
||||
}
|
||||
|
||||
#endif // !PHP_ARMA_BASE_HH
|
|
@ -7,6 +7,7 @@
|
|||
#include "php_arma.hh"
|
||||
#include "constants.hh"
|
||||
#include "complex.hh"
|
||||
#include "base.hh"
|
||||
#include "mapval.hh"
|
||||
|
||||
#ifdef PHP_ARMA_OPERATOR
|
||||
|
@ -19,6 +20,7 @@ PHP_MINIT_FUNCTION(arma)
|
|||
{
|
||||
php_arma::constants_init();
|
||||
php_arma::complex_init();
|
||||
php_arma::base_init();
|
||||
php_arma::mapval_init();
|
||||
|
||||
#ifdef PHP_ARMA_OPERATOR
|
||||
|
|
|
@ -226,6 +226,7 @@ namespace php_arma
|
|||
{
|
||||
zend_throw_exception_ex(zend_ce_error, -3,
|
||||
"Class %s is not explicitly constructible.", ZSTR_VAL(ce->name));
|
||||
return zend_objects_new(ce);
|
||||
}
|
||||
|
||||
/// Helper functions for handling scalar types.
|
||||
|
|
Reference in New Issue