]> granicus.if.org Git - php/commitdiff
On Windows, handle YAZ versions that don't export yaz_version.
authorAdam Dickmeiss <dickmeiss@php.net>
Fri, 4 Jul 2003 19:17:09 +0000 (19:17 +0000)
committerAdam Dickmeiss <dickmeiss@php.net>
Fri, 4 Jul 2003 19:17:09 +0000 (19:17 +0000)
ext/yaz/php_yaz.c

index 8733b28a02cec31d58892371ac9d664c27fe2ea4..4277825bb64821b7c957307411f4b93ad2d68a8d 100644 (file)
@@ -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);