Skip to content
Snippets Groups Projects
Commit 0cc707ae authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Use xp_timer()-based msclock() on Win32 too.

Now it should keep working after 24 days.
parent f3d18723
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2711 failed
...@@ -690,10 +690,9 @@ char* os_cmdshell(void) ...@@ -690,10 +690,9 @@ char* os_cmdshell(void)
return(shell); return(shell);
} }
/****************************************************************/ /********************************************************/
/* Microsoft (DOS/Win32) real-time system clock implementation. */ /* Stupid real-time system clock implementation. */
/****************************************************************/ /********************************************************/
#ifdef __unix__
clock_t msclock(void) clock_t msclock(void)
{ {
long double t = roundl(xp_timer() * 1000); long double t = roundl(xp_timer() * 1000);
...@@ -705,7 +704,6 @@ clock_t msclock(void) ...@@ -705,7 +704,6 @@ clock_t msclock(void)
return (clock_t)t; return (clock_t)t;
} }
#endif
/****************************************************************************/ /****************************************************************************/
/* Skips all white-space chars at beginning of 'str' */ /* Skips all white-space chars at beginning of 'str' */
......
...@@ -378,14 +378,8 @@ DLLEXPORT char* byte_count_to_str(int64_t bytes, char* str, size_t size); ...@@ -378,14 +378,8 @@ DLLEXPORT char* byte_count_to_str(int64_t bytes, char* str, size_t size);
DLLEXPORT char* byte_estimate_to_str(int64_t bytes, char* str, size_t size, ulong unit, int precision); DLLEXPORT char* byte_estimate_to_str(int64_t bytes, char* str, size_t size, ulong unit, int precision);
/* Microsoft (e.g. DOS/Win32) real-time system clock API (ticks since process started) */ /* Microsoft (e.g. DOS/Win32) real-time system clock API (ticks since process started) */
typedef clock_t msclock_t;
#if defined(_WIN32) || defined(__OS2__)
#define MSCLOCKS_PER_SEC CLOCKS_PER_SEC /* e.g. 18.2 on DOS, 1000.0 on Win32 */
#define msclock() clock()
#else
#define MSCLOCKS_PER_SEC 1000 #define MSCLOCKS_PER_SEC 1000
msclock_t msclock(void); msclock_t msclock(void);
#endif
DLLEXPORT BOOL check_pid(pid_t); DLLEXPORT BOOL check_pid(pid_t);
DLLEXPORT BOOL terminate_pid(pid_t); DLLEXPORT BOOL terminate_pid(pid_t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment