Compilation fix for Windows

This commit is contained in:
Pierre Pronchery 2011-06-02 19:51:06 +00:00
parent 12c19e4214
commit 213ac67002

View File

@ -18,7 +18,9 @@
#include <System.h> #include <System.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/utsname.h> #ifndef __WIN32__
# include <sys/utsname.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@ -189,6 +191,11 @@ static HostKernel _detect_kernel(HostOS os, char const * release);
static void _configure_detect(Configure * configure) static void _configure_detect(Configure * configure)
{ {
#ifdef __WIN32__
configure->arch = HA_I386;
configure->os = HO_WIN32;
configure->kernel = HK_UNKNOWN;
#else
struct utsname un; struct utsname un;
if(uname(&un) < 0) if(uname(&un) < 0)
@ -204,6 +211,7 @@ static void _configure_detect(Configure * configure)
configure->prefs->os != NULL configure->prefs->os != NULL
? configure->prefs->os : un.sysname); ? configure->prefs->os : un.sysname);
configure->kernel = _detect_kernel(configure->os, un.release); configure->kernel = _detect_kernel(configure->os, un.release);
#endif
if(configure->prefs->flags & PREFS_v) if(configure->prefs->flags & PREFS_v)
printf("Detected system %s version %s on %s\n", printf("Detected system %s version %s on %s\n",
sHostOS[configure->os], sHostOS[configure->os],