diff options
author | Pierre Joye <pajoye@php.net> | 2009-12-10 02:25:47 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2009-12-10 02:25:47 +0000 |
commit | 7179910573b9445565c320cc3f44ab40c3235795 (patch) | |
tree | 62a51948af0bef697e42693bc2e45df60fdb77c0 /ext/gmp | |
parent | 06a417b6a95787283789acba55be65158d9d6a5a (diff) | |
download | php-git-7179910573b9445565c320cc3f44ab40c3235795.tar.gz |
- [DOC] expose MPIR version when mpir is used instead of gmp
Diffstat (limited to 'ext/gmp')
-rw-r--r-- | ext/gmp/config.w32 | 1 | ||||
-rw-r--r-- | ext/gmp/gmp.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ext/gmp/config.w32 b/ext/gmp/config.w32 index fdaa606af0..8c863f9bc8 100644 --- a/ext/gmp/config.w32 +++ b/ext/gmp/config.w32 @@ -8,6 +8,7 @@ if (PHP_GMP != "no") { CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) { EXTENSION("gmp", "gmp.c"); AC_DEFINE('HAVE_GMP', 1, 'GMP support'); + AC_DEFINE('HAVE_MPIR', 1, 'MPIR support'); } else { WARNING("GMP not enabled; libraries and headers not found"); } diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index b4c8f7fe67..864e0e75b8 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -356,6 +356,9 @@ ZEND_MODULE_STARTUP_D(gmp) REGISTER_LONG_CONSTANT("GMP_ROUND_ZERO", GMP_ROUND_ZERO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_ROUND_PLUSINF", GMP_ROUND_PLUSINF, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_ROUND_MINUSINF", GMP_ROUND_MINUSINF, CONST_CS | CONST_PERSISTENT); +#ifdef mpir_version + REGISTER_STRING_CONSTANT("GMP_MPIR_VERSION", (char *)mpir_version, CONST_CS | CONST_PERSISTENT); +#endif REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT); mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); @@ -383,7 +386,11 @@ ZEND_MODULE_INFO_D(gmp) { php_info_print_table_start(); php_info_print_table_row(2, "gmp support", "enabled"); +#ifdef mpir_version + php_info_print_table_row(2, "MPIR version", mpir_version); +#else php_info_print_table_row(2, "GMP version", gmp_version); +#endif php_info_print_table_end(); } /* }}} */ @@ -746,7 +753,7 @@ ZEND_FUNCTION(gmp_init) return; } -#if __GNU_MP_VERSION >= 4 && __GNU_MP_VERSION_MINOR >= 2 +#if (__GNU_MP_VERSION >= 4 && __GNU_MP_VERSION_MINOR >= 2) if (base && (base < 2 || base > 62)) { #else if (base && (base < 2 || base > 36)) { |