aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2023-04-30 17:57:02 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2023-04-30 17:57:02 -0400
commit74315872e5104396feb90c1155adbc20bf6ee78c (patch)
treeb43cb2ccb7dd3bc2e005a0236550e94a3ce095b2 /common.h
parentf511688f83dc0386216f9ef097d88ea44cb160a6 (diff)
downloadwhatami-74315872e5104396feb90c1155adbc20bf6ee78c.tar.gz
Add windows supportHEADmaster
Diffstat (limited to 'common.h')
-rw-r--r--common.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/common.h b/common.h
index a5a1fee..c69b058 100644
--- a/common.h
+++ b/common.h
@@ -4,18 +4,24 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
-#include <sys/utsname.h>
-#include <cpuid.h>
#include <ctype.h>
-#include <dirent.h>
#include <limits.h>
-#if defined(__x86_64__) || defined(__i386__)
+#if defined(_WINDOWS) || defined(__MINGW32__)
+#include "win.h"
+#else
+#include <dirent.h>
+#include <unistd.h>
+#include <cpuid.h>
+#include <sys/utsname.h>
+#endif
+
+#if defined(__x86_64__) || defined(__i386__) || defined(__MACHINEX86_X64)
#include "x86.h"
#endif
#if defined(__linux__)
+// nothing yet
#elif defined(__APPLE__)
#include <sys/types.h>
#include <sys/sysctl.h>
@@ -51,11 +57,10 @@ unsigned int get_cpu_count();
char *get_cpu_manufacturer();
char *get_cpu_vendor();
-
size_t rstrip(char *s);
+char *get_sys_dmi_product();
int get_sys_os_dist(char **name, char **version);
ssize_t get_sys_memory();
-char *get_sys_dmi_product();
struct Block_Device **get_block_devices(size_t *total);
#endif //WHATAMI_COMMON_H