| OLD | NEW |
| (Empty) |
| 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |
| 2 /* This Source Code Form is subject to the terms of the Mozilla Public | |
| 3 * License, v. 2.0. If a copy of the MPL was not distributed with this | |
| 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
| 5 | |
| 6 /* | |
| 7 * NT interval timers | |
| 8 * | |
| 9 */ | |
| 10 | |
| 11 /* Mozilla's build system defines this globally. */ | |
| 12 #ifdef WIN32_LEAN_AND_MEAN | |
| 13 #undef WIN32_LEAN_AND_MEAN | |
| 14 #endif | |
| 15 #include "primpl.h" | |
| 16 | |
| 17 #ifdef WINCE | |
| 18 typedef DWORD (*IntervalFuncType)(void); | |
| 19 static IntervalFuncType intervalFunc; | |
| 20 #endif | |
| 21 | |
| 22 void | |
| 23 _PR_MD_INTERVAL_INIT() | |
| 24 { | |
| 25 #ifdef WINCE | |
| 26 HMODULE mmtimerlib = LoadLibraryW(L"mmtimer.dll"); /* XXX leaked! */ | |
| 27 if (mmtimerlib) { | |
| 28 intervalFunc = (IntervalFuncType)GetProcAddress(mmtimerlib, | |
| 29 "timeGetTime"); | |
| 30 } else { | |
| 31 intervalFunc = &GetTickCount; | |
| 32 } | |
| 33 #endif | |
| 34 } | |
| 35 | |
| 36 PRIntervalTime | |
| 37 _PR_MD_GET_INTERVAL() | |
| 38 { | |
| 39 /* milliseconds since system start */ | |
| 40 #ifdef WINCE | |
| 41 return (*intervalFunc)(); | |
| 42 #else | |
| 43 return timeGetTime(); | |
| 44 #endif | |
| 45 } | |
| 46 | |
| 47 PRIntervalTime | |
| 48 _PR_MD_INTERVAL_PER_SEC() | |
| 49 { | |
| 50 return 1000; | |
| 51 } | |
| OLD | NEW |