summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-16 13:47:43 +0200
committerAnatol Belski <ab@php.net>2014-10-16 13:47:43 +0200
commit7f1107de9167ab1443a13491f5b70aa3f10fd323 (patch)
treeb3650174f95295198e6233c17adcbdf61b827329 /ext/pgsql
parent0e7682c63c10e374d76a4f93974f7e64716cf234 (diff)
downloadphp-git-7f1107de9167ab1443a13491f5b70aa3f10fd323.tar.gz
converted ext/ereg, ext/phar and ext/pgsql for static tsrmls usage
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/config.m42
-rw-r--r--ext/pgsql/config.w322
-rw-r--r--ext/pgsql/pgsql.c6
-rw-r--r--ext/pgsql/php_pgsql.h5
4 files changed, 12 insertions, 3 deletions
diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4
index 186469861f..bd3470eac5 100644
--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -105,7 +105,7 @@ if test "$PHP_PGSQL" != "no"; then
PHP_ADD_INCLUDE($PGSQL_INCLUDE)
- PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared)
+ PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi
diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32
index d38048d90b..5775dfa023 100644
--- a/ext/pgsql/config.w32
+++ b/ext/pgsql/config.w32
@@ -6,7 +6,7 @@ ARG_WITH("pgsql", "PostgreSQL support", "no");
if (PHP_PGSQL != "no") {
if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) {
- EXTENSION("pgsql", "pgsql.c");
+ EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE /D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND /D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA /D HAVE_PQFTABLE /D HAVE_PQESCAPE_CONN /D HAVE_PQESCAPE_BYTEA_CONN /D HAVE_PQFREEMEM /D HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT /D HAVE_PQPROTOCOLVERSION /D HAVE_PG_LO_CREATE /D HAVE_PG_LO_IMPORT_WITH_OID /D HAVE_PG_LO_TRUNCATE /D HAVE_PG_LO64 /D HAVE_PQESCAPELITERAL /D HAVE_PQOIDVALUE");
} else {
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 207764b165..3645e0a897 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -771,6 +771,9 @@ zend_module_entry pgsql_module_entry = {
/* }}} */
#ifdef COMPILE_DL_PGSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(pgsql)
#endif
@@ -1090,6 +1093,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(pgsql)
{
+#if defined(COMPILE_DL_PGSQL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(pgsql_globals, 0, sizeof(zend_pgsql_globals));
/* Initilize notice message hash at MINIT only */
zend_hash_init_ex(&pgsql_globals->notices, 0, NULL, PHP_PGSQL_NOTICE_PTR_DTOR, 1, 0);
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 661c02f77f..18f1bbe77f 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -322,7 +322,10 @@ ZEND_END_MODULE_GLOBALS(pgsql)
ZEND_EXTERN_MODULE_GLOBALS(pgsql)
#ifdef ZTS
-# define PGG(v) TSRMG(pgsql_globals_id, zend_pgsql_globals *, v)
+# define PGG(v) ZEND_TSRMG(pgsql_globals_id, zend_pgsql_globals *, v)
+# ifdef COMPILE_DL_PGSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define PGG(v) (pgsql_globals.v)
#endif