summaryrefslogtreecommitdiff
path: root/ext/yaz
diff options
context:
space:
mode:
authorAdam Dickmeiss <dickmeiss@php.net>2003-07-04 19:17:09 +0000
committerAdam Dickmeiss <dickmeiss@php.net>2003-07-04 19:17:09 +0000
commita0c7a95ba1b68df82be30dfe780b62306afba01c (patch)
tree528e98f30143a6a15c171d5e971705e137b4782d /ext/yaz
parent9a2992902993fc2317a956062f0ead10fd1338d9 (diff)
downloadphp-git-a0c7a95ba1b68df82be30dfe780b62306afba01c.tar.gz
On Windows, handle YAZ versions that don't export yaz_version.
Diffstat (limited to 'ext/yaz')
-rw-r--r--ext/yaz/php_yaz.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/yaz/php_yaz.c b/ext/yaz/php_yaz.c
index 8733b28a02..4277825bb6 100644
--- a/ext/yaz/php_yaz.c
+++ b/ext/yaz/php_yaz.c
@@ -1545,7 +1545,19 @@ PHP_MINFO_FUNCTION(yaz)
{
char version_str[20];
+#if WIN32
+ HINSTANCE h = LoadLibrary("yaz");
+ unsigned long (__cdecl *p)(char *version_str, char *sys_str) = 0;
+ strcpy(version_str, "unknown");
+
+ if (h && (p = (unsigned long(__cdecl*)(char*,char*))
+ GetProcAddress(h, "yaz_version")))
+ p(version_str, 0);
+ if (h)
+ FreeLibrary(h);
+#else
yaz_version(version_str, 0);
+#endif
php_info_print_table_start();
php_info_print_table_row(2, "YAZ Support", "enabled");
php_info_print_table_row(2, "YAZ Version", version_str);