Introduce MG_ENABLE_CUSTOM_MILLIS

This commit is contained in:
Sergey Lyubka committed 2022-04-04 18:14:59 +01:00
1 parent 417533e90c
commit 0ed64707f3
5 files changed
+16 -1

No files matched your search

+4
View File
@@ -57,6 +57,10 @@
#define MG_ENABLE_CUSTOM_RANDOM 0
#endif
#ifndef MG_ENABLE_CUSTOM_MILLIS
#define MG_ENABLE_CUSTOM_MILLIS 0
#endif
#ifndef MG_ENABLE_PACKED_FS
#define MG_ENABLE_PACKED_FS 0
#endif
+3
View File
@@ -78,6 +78,8 @@ int mg_check_ip_acl(struct mg_str acl, uint32_t remote_ip) {
return allowed == '+';
}
#if MG_ENABLE_CUSTOM_MILLIS
#else
int64_t mg_millis(void) {
#if MG_ARCH == MG_ARCH_WIN32
return GetTickCount();
@@ -112,3 +114,4 @@ int64_t mg_millis(void) {
return time(NULL) * 1000;
#endif
}
#endif