Fix residual Visual Studio build problems

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeff Cohen 2004-12-09 05:51:11 +00:00
parent b6a0d3595b
commit 31127e1d89
4 changed files with 15 additions and 25 deletions

View File

@ -66,6 +66,7 @@ typedef u_int64_t uint64_t;
#else /* _MSC_VER */ #else /* _MSC_VER */
// Visual C++ doesn't provide standard integer headers, but it does provide // Visual C++ doesn't provide standard integer headers, but it does provide
// built-in data types. // built-in data types.
#include <stddef.h>
typedef __int64 int64_t; typedef __int64 int64_t;
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
typedef signed int int32_t; typedef signed int int32_t;

View File

@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "Win32.h" #include "Win32.h"
#include <windef.h>
namespace llvm { namespace llvm {
using namespace sys; using namespace sys;
@ -23,33 +22,30 @@ using namespace sys;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
DynamicLibrary::DynamicLibrary() : handle(0) { DynamicLibrary::DynamicLibrary() : handle(0) {
handle = new HMODULE; handle = (void*) GetModuleHandle(NULL);
*((HMODULE*)handle) = GetModuleHandle(NULL);
if (*((HMODULE*)handle) == 0) { if (handle == 0) {
ThrowError("Can't GetModuleHandle: "); ThrowError("Can't GetModuleHandle: ");
} }
} }
DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) { DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
handle = new HMODULE; handle = LoadLibrary(filename);
*((HMODULE*)handle) = LoadLibrary(filename);
if (*((HMODULE*)handle) == 0) { if (handle == 0) {
ThrowError("Can't LoadLibrary: "); ThrowError("Can't LoadLibrary: ");
} }
} }
DynamicLibrary::~DynamicLibrary() { DynamicLibrary::~DynamicLibrary() {
assert(handle !=0 && "Invalid DynamicLibrary handle"); assert(handle !=0 && "Invalid DynamicLibrary handle");
if (*((HMODULE*)handle)) if (handle)
FreeLibrary(*((HMODULE*)handle)); FreeLibrary((HMODULE*)handle);
delete (HMODULE*)handle;
} }
void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) { void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
assert(handle !=0 && "Invalid DynamicLibrary handle"); assert(handle !=0 && "Invalid DynamicLibrary handle");
return (void*) GetProcAddress(*((HMODULE*)handle), symbolName); return (void*) GetProcAddress((HMODULE*)handle, symbolName);
} }
} }

View File

@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "Win32.h" #include "Win32.h"
#include <windef.h>
namespace llvm { namespace llvm {
using namespace sys; using namespace sys;
@ -23,33 +22,30 @@ using namespace sys;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
DynamicLibrary::DynamicLibrary() : handle(0) { DynamicLibrary::DynamicLibrary() : handle(0) {
handle = new HMODULE; handle = (void*) GetModuleHandle(NULL);
*((HMODULE*)handle) = GetModuleHandle(NULL);
if (*((HMODULE*)handle) == 0) { if (handle == 0) {
ThrowError("Can't GetModuleHandle: "); ThrowError("Can't GetModuleHandle: ");
} }
} }
DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) { DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
handle = new HMODULE; handle = LoadLibrary(filename);
*((HMODULE*)handle) = LoadLibrary(filename);
if (*((HMODULE*)handle) == 0) { if (handle == 0) {
ThrowError("Can't LoadLibrary: "); ThrowError("Can't LoadLibrary: ");
} }
} }
DynamicLibrary::~DynamicLibrary() { DynamicLibrary::~DynamicLibrary() {
assert(handle !=0 && "Invalid DynamicLibrary handle"); assert(handle !=0 && "Invalid DynamicLibrary handle");
if (*((HMODULE*)handle)) if (handle)
FreeLibrary(*((HMODULE*)handle)); FreeLibrary((HMODULE*)handle);
delete (HMODULE*)handle;
} }
void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) { void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
assert(handle !=0 && "Invalid DynamicLibrary handle"); assert(handle !=0 && "Invalid DynamicLibrary handle");
return (void*) GetProcAddress(*((HMODULE*)handle), symbolName); return (void*) GetProcAddress((HMODULE*)handle, symbolName);
} }
} }

View File

@ -310,9 +310,6 @@
<File <File
RelativePath="..\..\lib\Transforms\Scalar\SimplifyCFG.cpp"> RelativePath="..\..\lib\Transforms\Scalar\SimplifyCFG.cpp">
</File> </File>
<File
RelativePath="..\..\lib\Transforms\Scalar\SymbolStripping.cpp">
</File>
<File <File
RelativePath="..\..\lib\Transforms\Scalar\TailDuplication.cpp"> RelativePath="..\..\lib\Transforms\Scalar\TailDuplication.cpp">
</File> </File>