mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00

Export a PHPAPI function to return gmp_ce (and make the actual storage static). Provide gmp_object struct in header w/ inline accessor. Install php_gmp_int.h header. Remove unnecessary `#ifdef HAVE_GMP` checks.
31 lines
634 B
C
31 lines
634 B
C
#ifndef incl_PHP_GMP_INT_H
|
|
#define incl_PHP_GMP_INT_H
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include "php.h"
|
|
#include <gmp.h>
|
|
|
|
typedef struct _gmp_object {
|
|
mpz_t num;
|
|
zend_object std;
|
|
} gmp_object;
|
|
|
|
static inline gmp_object *php_gmp_object_from_zend_object(zend_object *zobj) {
|
|
return (gmp_object *)( ((char *)zobj) - XtOffsetOf(gmp_object, std) );
|
|
}
|
|
|
|
PHPAPI zend_class_entry *php_gmp_class_entry();
|
|
|
|
/* GMP and MPIR use different datatypes on different platforms */
|
|
#ifdef PHP_WIN32
|
|
typedef zend_long gmp_long;
|
|
typedef zend_ulong gmp_ulong;
|
|
#else
|
|
typedef long gmp_long;
|
|
typedef unsigned long gmp_ulong;
|
|
#endif
|
|
|
|
#endif
|