com php-src: fix nts windows_version_info and reorganiz e: Zend/zend.c

From: Date: Sun, 05 Apr 2015 17:46:38 +0000
Subject: com php-src: fix nts windows_version_info and reorganiz e: Zend/zend.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86085@lists.php.net to get a copy of this message
Commit: 92324b2719386c8a70bef0eb243f853f6df9a93b Author: Anatol Belski <ab@php.net> Sun, 5 Apr 2015 19:45:04 +0200 Parents: b6aeab1b9177f4f6b89e7c1553fd946ea164002c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=92324b2719386c8a70bef0eb243f853f6df9a93b Log: fix nts windows_version_info and reorganize Changed paths: M Zend/zend.c Diff: diff --git a/Zend/zend.c b/Zend/zend.c index 77be1cd..abaa0d2 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -399,6 +399,16 @@ static void zend_set_default_compile_time_values(void) /* {{{ */ } /* }}} */ +static void zend_get_windows_version_info(OSVERSIONINFOEX *osvi) /* {{{ */ +{ + ZeroMemory(osvi, sizeof(OSVERSIONINFOEX)); + osvi->dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + if(!GetVersionEx((OSVERSIONINFO *) osvi)) { + ZEND_ASSERT(0); /* Should not happen as sizeof is used. */ + } +} +/* }}} */ + static void zend_init_exception_op(void) /* {{{ */ { memset(EG(exception_op), 0, sizeof(EG(exception_op))); @@ -517,11 +527,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{ executor_globals->exception = NULL; executor_globals->objects_store.object_buckets = NULL; #ifdef ZEND_WIN32 - ZeroMemory(&executor_globals->windows_version_info, sizeof(OSVERSIONINFOEX)); - executor_globals->windows_version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - if (!GetVersionEx((OSVERSIONINFO *) &executor_globals->windows_version_info)) { - ZEND_ASSERT(0); /* Should not happen as sizeof is used. */ - } + zend_get_windows_version_info(&executor_globals->windows_version_info); #endif } /* }}} */ @@ -773,6 +779,9 @@ void zend_post_startup(void) /* {{{ */ global_persistent_list = &EG(persistent_list); zend_copy_ini_directives(); #else +#ifdef ZEND_WIN32 + zend_get_windows_version_info(&EG(windows_version_info)); +#endif virtual_cwd_deactivate(); #endif }

« previous php.cvs (#86085) next »