Various small Windows fixes.

Also fixed some tabs/spaces and compiler warning issues.
This commit is contained in:
Matt Pharr
2011-10-04 15:49:50 -07:00
parent 06975bc7ab
commit 59caa3d4e1
2 changed files with 18 additions and 17 deletions

View File

@@ -7,11 +7,11 @@ set LLVM_INSTALL_DIR=c:\users\mmp\llvm-dev
REM Both the LLVM binaries and python need to be in the path
set path=%LLVM_INSTALL_DIR%\bin;%PATH%;c:\cygwin\bin
msbuild ispc.vcxproj /m:4 /V:m /p:Platform=Win32 /p:Configuration=Release
msbuild ispc.vcxproj /V:m /p:Platform=Win32 /p:Configuration=Release
msbuild examples\examples.sln /m:4 /V:m /p:Platform=x64 /p:Configuration=Release
msbuild examples\examples.sln /m:4 /V:m /p:Platform=x64 /p:Configuration=Debug
msbuild examples\examples.sln /m:4 /V:m /p:Platform=Win32 /p:Configuration=Release
msbuild examples\examples.sln /m:4 /V:m /p:Platform=Win32 /p:Configuration=Debug
msbuild examples\examples.sln /V:m /p:Platform=x64 /p:Configuration=Release /t:rebuild
msbuild examples\examples.sln /V:m /p:Platform=x64 /p:Configuration=Debug /t:rebuild
msbuild examples\examples.sln /V:m /p:Platform=Win32 /p:Configuration=Release /t:rebuild
msbuild examples\examples.sln /V:m /p:Platform=Win32 /p:Configuration=Debug /t:rebuild

View File

@@ -57,6 +57,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
typedef int Bool;
@@ -147,21 +148,21 @@ void __do_print(const char *format, const char *types, int width, int mask,
int __num_cores() {
#ifdef _MSC_VER
// This is quite a hack. Including all of windows.h to get this definition
// pulls in a bunch of stuff that leads to undefined symbols at link time.
// So we don't #include <windows.h> but instead have the equivalent declarations
// here. Presumably this struct declaration won't be changing in the future
// anyway...
struct SYSTEM_INFO {
int pad0[2];
void *pad1[2];
int *pad2;
int dwNumberOfProcessors;
// This is quite a hack. Including all of windows.h to get this definition
// pulls in a bunch of stuff that leads to undefined symbols at link time.
// So we don't #include <windows.h> but instead have the equivalent declarations
// here. Presumably this struct declaration won't be changing in the future
// anyway...
struct SYSTEM_INFO {
int pad0[2];
void *pad1[2];
int *pad2;
int dwNumberOfProcessors;
int pad3[3];
};
};
struct SYSTEM_INFO sysInfo;
extern void __stdcall GetSystemInfo(struct SYSTEM_INFO *);
extern void __stdcall GetSystemInfo(struct SYSTEM_INFO *);
GetSystemInfo(&sysInfo);
return sysInfo.dwNumberOfProcessors;
#else