1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 13:06:38 +02:00

Use clock_gettime if it is available.

This commit is contained in:
Sadie Powell
2024-03-18 11:13:46 +00:00
parent 753119c4a1
commit cb3848b7db
13 changed files with 42 additions and 31 deletions
-16
View File
@@ -64,22 +64,6 @@ USHORT WindowsGetLanguage(const Anope::string &lang)
return LANG_NEUTRAL;
}
/** Like gettimeofday(), but it works on Windows.
* @param tv A timeval struct
* @param tz Should be NULL, it is not used
* @return 0 on success
*/
int gettimeofday(timeval *tv, void *)
{
SYSTEMTIME st;
GetSystemTime(&st);
tv->tv_sec = Anope::CurTime;
tv->tv_usec = st.wMilliseconds;
return 0;
}
int setenv(const char *name, const char *value, int overwrite)
{
return SetEnvironmentVariable(name, value);