From: Adam Dickmeiss Date: Fri, 4 Jul 2003 19:17:09 +0000 (+0000) Subject: On Windows, handle YAZ versions that don't export yaz_version. X-Git-Tag: BEFORE_ARG_INFO~376 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0c7a95ba1b68df82be30dfe780b62306afba01c;p=php On Windows, handle YAZ versions that don't export yaz_version. --- 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);