summaryrefslogtreecommitdiff
path: root/source/kit/time.h
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-06 02:37:27 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-06 02:37:27 +0200
commit7ee126fdeaec9513bb0b97e075f3964b79c00582 (patch)
tree3c947e76e01e353dc6af5910efaa08bf69c35085 /source/kit/time.h
parent3cf844d8637ec31bbbba2997c106330991d67528 (diff)
downloadkit-7ee126fdeaec9513bb0b97e075f3964b79c00582.zip
time.h fixes; incomplete
Diffstat (limited to 'source/kit/time.h')
-rw-r--r--source/kit/time.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/kit/time.h b/source/kit/time.h
new file mode 100644
index 0000000..af36211
--- /dev/null
+++ b/source/kit/time.h
@@ -0,0 +1,38 @@
+#ifndef KIT_TIME_H
+#define KIT_TIME_H
+
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+
+#include <time.h>
+
+#ifndef TIME_UTC
+# define TIME_UTC 1
+
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+
+# if defined(_WIN32) && !defined(__CYGWIN__)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN 1
+# endif
+# include <Windows.h>
+
+static int timespec_get(struct timespec *ts, int base) {
+ // TODO
+ // Windows implementation.
+ //
+}
+# else
+static int timespec_get(struct timespec *ts, int base) {
+ // TODO
+ // Posix implementation.
+ //
+}
+# endif
+#endif
+
+#endif