summaryrefslogtreecommitdiff
path: root/win32/time.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove inappropriate FreeLibrary callAnatol Belski2018-06-111-3/+0
|
* vim folds and modelinesAnatol Belski2017-07-041-12/+12
|
* We do not need to check the return value of php_win32_init_gettimeofday() ↵Kalle Sommer Nielsen2016-08-111-3/+1
| | | | anymore, as the symbol is always going to be available to us
* The call to FreeLibrary() should be within the if, so we don't pass ↵Kalle Sommer Nielsen2016-08-111-3/+3
| | | | INVALID_HANDLE_VALUE to it, in case LoadLibrary() fails
* Get rid of these slow calls to LoadLibrary()/GetProcAddress() calls on ↵Kalle Sommer Nielsen2016-08-111-4/+7
| | | | | | | | | | | | | | | | | | | | | | Windows, we require Windows Vista as bare minimum for PHP anyway, so it does not make any sense to do this slow emulation anyway. GD: - PrintWindow() is available as of Windows XP, it requires linking to User32.lib, which config.w32 for ext/gd already. CLI: - The borrowed functions from PostgreSQL to set the titles of the console window uses SetConsoleTitle() and GetConsoleTitle(), both are available as of Windows 2000 from Kernel32.lib which we already are linking against. Standard: - The disk space utility functions uses GetDiskFreeSpaceExA() which is available as of Windows XP, again links to Kernel32.lib. - The symlink() PHP function uses CreateSymbolicLinkA() which is available from Windows Vista, again from Kernel32.lib. - php_get_windows_name() in info.c uses GetNativeSystemInfo() which is available as of Windows XP and GetProductInfo() which is available as of Windows Vista, both are again from Kernel32.lib. Notes: - ext/interbase & ext/pdo_firebird uses GetProcAddress(), I'm not entirely sure how to handle this one. - ext/sqlite3, this is apart of the bundled libsqlite3, I don't really wanna play around with our bundled libs and make it a bigger issue for those who maintain and upgrade them. - ext/readline, the call to GetProcAddress() here does not do any system calls, so it is left as is. - win32/ioutil.c uses GetProcAddress(), but the function it attempts to load (PathCchCanonicalizeEx()) is only available from Windows 8 and greater (Pathcch.lib linkage). - win32/time.c uses GetSystemTimePreciseAsFileTime() which is available from Windows 8 and greater to get the current system date and time which the highest possible precision and falls back to GetSystemTimeAsFileTime() (available as of Windows 2000), again Kernel32.lib, the GetSystemTimePreciseAsFileTime() is left in a GetProcAddress().
* introduced DllMain for the main php DLLAnatol Belski2015-06-021-4/+10
| | | | | | | | | | | | | | | | | | | | | The particular need on this is because of the current situation with determining the background functionality for the gettimeofday. DllMain allows to initialize stuff before the DLL can be actually used. Thus, we use different time API on win7 and win8 and later, so the function pointer needs to be initialized before anything in the DLL could even demand it. The change also opens the door for the further optimizations, as now we're able to do the very basic initializations for the whole DLL before it could ever start to live. Fe on this way the TLS initialization could be done, when utilizing the DLL_THREAD_ATTACH/DETACH case. Whether it's really usable in portable way should be synced with other platforms. Be aware that it's dangerous as it possibly causes dead locks. So to use with care. One willing to add items to DllMain should better read the documentation twice and even then try to defer the necessary action.
* remove dead codeAnatol Belski2015-05-201-84/+0
|
* add vim modelinesAnatol Belski2015-05-201-0/+8
|
* trailing whitespace removalStanislav Malyshev2015-01-101-2/+2
|
* improved system time function determinationAnatol Belski2014-12-231-8/+7
| | | | | | It doesn't need to LoadLibrary and all that stuff every time, but once on the first access. Also the functions which are not directly used inlined now.
* Fixed possible precision loss in microtimeAnatol Belski2013-03-231-6/+13
| | | | | | This is related to the fix for bug #64370. MSVC natively supports __int64 type, so calculating with 32 bit ints is neither necessary nor reliable. Therefore an older piece of code is reused.
* Backported patch for #64370Anatol Belski2013-03-151-91/+42
|
* Remove unused codesXinchen Hui2012-06-071-10/+8
|
* based on microsoft's description,the direct convert from FILETIME struct to ↵slayercat2012-06-071-2/+12
| | | | | | | | | __int64 is unsafe. via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx "Do not cast a pointer to a FILETIME structure to either a ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows."
* - Fixed bug #53297 (gettimeofday implementation in php/win32/time.c can returnGustavo André dos Santos Lopes2010-11-121-1/+1
| | | | | 1 million microsecs). (ped at 7gods dot org) - Moved line out of order in NEWS.
* - MFH:Pierre Joye2009-01-191-1/+12
| | | | | | | | - add nanosleep - expose nanosleep and usleep - [DOC] time_ nanosleep and time_ sleep_ until available on windows - change nanosleep signature to match posix one
* MFH:Kalle Sommer Nielsen2008-08-141-0/+2
| | | | | | * Last _WIN32_WINNT macro redef * Include <config.w32.h> where _WIN32_WINNT was
* MFH:Kalle Sommer Nielsen2008-08-131-4/+0
| | | | | | * Remove NTDDI_VERSION declaring and use the one in config.w32.h * Remove another _WIN32_WINNT macro redef in win32/time.c
* Misc. win32 thread safety fixes.Wez Furlong2004-07-291-30/+31
|
* make usleep actually work properlyWez Furlong2004-01-131-2/+2
|
* Fix build for new usleep implementation.Wez Furlong2003-11-291-1/+6
| | | | | | NB: we now depend on windows 98 and later; windows 95 does not have these timing functions.
* implement usleep for win32Wez Furlong2003-11-291-29/+9
|
* Allow dynamically compiled extensions to use gettimeofday() on win32.Edin Kadribasic2002-06-231-2/+2
|
* Fix for time.c under win32. Patch By: "Vanhanen, Reijo" ↵James Moore2001-02-041-27/+116
| | | | | | | <Reijo.Vanhanen@helsoft.fi> @- microtime under windows now returns accurate values (James)
* * fixed some #if/#ifdef issuesStig Bakken1999-06-161-1/+1
| | | | | | | | | | | | * hand-patched in php3 changes from 3.0.6 to HEAD in these files: fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch] ext/standard/php3_string.h ext/standard/string.c * added some new file/socket macros for more readable code: FP_FGETS(buf,len,sock,fp,issock) FP_FREAD(buf,len,sock,fp,issock) FP_FEOF(sock,fp,issock) FP_FGETC(sock,fp,issock)
* A lot of cleanups... Removed old thread-safe code and other redundant code ↵Zeev Suraski1999-04-241-8/+7
| | | | and files
* Remove tls.[ch]Zeev Suraski1999-04-231-3/+1
|
* PHP 4.0Zeev Suraski1999-04-071-0/+156