From: Ard Biesheuvel Date: Fri, 6 Feb 2004 15:11:17 +0000 (+0000) Subject: Fix build with Win32 Interbase 5.x X-Git-Tag: php-5.0.0b4RC1~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9415013456c3022c39f1ac0f679acff28eab6051;p=php Fix build with Win32 Interbase 5.x --- diff --git a/ext/interbase/config.w32 b/ext/interbase/config.w32 index 95f9069dff..9eab6a4599 100644 --- a/ext/interbase/config.w32 +++ b/ext/interbase/config.w32 @@ -2,15 +2,19 @@ // vim:ft=javascript ARG_WITH("interbase", "InterBase support", "no"); +ARG_WITH("interbase5", "InterBase 5.x support", "no"); -if (PHP_INTERBASE != "no") { +if (PHP_INTERBASE != "no" || PHP_INTERBASE5 != "no") { if (CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_INTERBASE", PHP_PHP_BUILD + "\\interbase\\include;" + PHP_INTERBASE) && (CHECK_LIB("fbclient_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE) || CHECK_LIB("gds32_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE))) { EXTENSION("interbase", "interbase.c ibase_service.c ibase_events.c ibase_blobs.c"); AC_DEFINE('HAVE_IBASE', 1, 'Have interbase library'); - AC_DEFINE('HAVE_IBASE6_API', 1, 'Have interbase version 6 API library'); + + if (PHP_INTERBASE != "no") { + AC_DEFINE('HAVE_IBASE6_API', 1, 'Have interbase version 6 API library'); + } } else { WARNING("interbase not enabled; libraries and headers not found"); } diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index d4e6b89b91..68a2cad68e 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -514,6 +514,7 @@ static void _php_ibase_free_event(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ * } /* }}} */ +#if HAVE_IBASE6_API static void _php_ibase_free_service(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */ { ibase_service *sv = (ibase_service *) rsrc->ptr; @@ -534,6 +535,7 @@ static void _php_ibase_free_service(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ efree(sv); } /* }}} */ +#endif /* {{{ startup, shutdown and info functions */ PHP_INI_BEGIN() @@ -569,7 +571,9 @@ PHP_MINIT_FUNCTION(ibase) le_plink = zend_register_list_destructors_ex(php_ibase_commit_link_rsrc, _php_ibase_close_plink, "interbase link persistent", module_number); le_trans = zend_register_list_destructors_ex(_php_ibase_free_trans, NULL, "interbase transaction", module_number); le_event = zend_register_list_destructors_ex(_php_ibase_free_event, NULL, "interbase event", module_number); +#if HAVE_IBASE6_API le_service = zend_register_list_destructors_ex(_php_ibase_free_service, NULL, "interbase service manager handle", module_number); +#endif REGISTER_LONG_CONSTANT("IBASE_DEFAULT", PHP_IBASE_DEFAULT, CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IBASE_TEXT", PHP_IBASE_FETCH_BLOBS, CONST_PERSISTENT); /* deprecated, for BC only */