Fix residual Visual Studio build problems
authorJeff Cohen <jeffc@jolt-lang.org>
Thu, 9 Dec 2004 05:51:11 +0000 (05:51 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Thu, 9 Dec 2004 05:51:11 +0000 (05:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18688 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/DataTypes.h.in
lib/System/Win32/DynamicLibrary.cpp
lib/System/Win32/DynamicLibrary.inc
win32/Transforms/Transforms.vcproj

index d5d1fc697afe43b93e56a3626541640dacbd3c01..4290ae6095853f656a39e0fd53fcfe414d6ebed4 100644 (file)
@@ -66,6 +66,7 @@ typedef u_int64_t uint64_t;
 #else /* _MSC_VER */
 // Visual C++ doesn't provide standard integer headers, but it does provide
 // built-in data types.
+#include <stddef.h>
 typedef __int64 int64_t;
 typedef unsigned __int64 uint64_t;
 typedef signed   int int32_t;
index d743454746ae173d9ac4bc9cb63e6a5606d6d698..cc3376eedf9ef758cfeb6ecbfe91317b611f54bd 100644 (file)
@@ -12,7 +12,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "Win32.h"
-#include <windef.h>
 
 namespace llvm {
 using namespace sys;
@@ -23,33 +22,30 @@ using namespace sys;
 //===----------------------------------------------------------------------===//
 
 DynamicLibrary::DynamicLibrary() : handle(0) {
-  handle = new HMODULE;
-  *((HMODULE*)handle) = GetModuleHandle(NULL);
+  handle = (void*) GetModuleHandle(NULL);
   
-  if (*((HMODULE*)handle) == 0) {
+  if (handle == 0) {
     ThrowError("Can't GetModuleHandle: ");
   }
 }
 
 DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
-  handle = new HMODULE;
-  *((HMODULE*)handle) = LoadLibrary(filename);
+  handle = LoadLibrary(filename);
 
-  if (*((HMODULE*)handle) == 0) {
+  if (handle == 0) {
     ThrowError("Can't LoadLibrary: ");
   }
 }
 
 DynamicLibrary::~DynamicLibrary() {
   assert(handle !=0 && "Invalid DynamicLibrary handle");
-  if (*((HMODULE*)handle))
-    FreeLibrary(*((HMODULE*)handle));
-  delete (HMODULE*)handle;
+  if (handle)
+    FreeLibrary((HMODULE*)handle);
 }
 
 void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
   assert(handle !=0 && "Invalid DynamicLibrary handle");
-  return (void*) GetProcAddress(*((HMODULE*)handle), symbolName);
+  return (void*) GetProcAddress((HMODULE*)handle, symbolName);
 }
 
 }
index d743454746ae173d9ac4bc9cb63e6a5606d6d698..cc3376eedf9ef758cfeb6ecbfe91317b611f54bd 100644 (file)
@@ -12,7 +12,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "Win32.h"
-#include <windef.h>
 
 namespace llvm {
 using namespace sys;
@@ -23,33 +22,30 @@ using namespace sys;
 //===----------------------------------------------------------------------===//
 
 DynamicLibrary::DynamicLibrary() : handle(0) {
-  handle = new HMODULE;
-  *((HMODULE*)handle) = GetModuleHandle(NULL);
+  handle = (void*) GetModuleHandle(NULL);
   
-  if (*((HMODULE*)handle) == 0) {
+  if (handle == 0) {
     ThrowError("Can't GetModuleHandle: ");
   }
 }
 
 DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
-  handle = new HMODULE;
-  *((HMODULE*)handle) = LoadLibrary(filename);
+  handle = LoadLibrary(filename);
 
-  if (*((HMODULE*)handle) == 0) {
+  if (handle == 0) {
     ThrowError("Can't LoadLibrary: ");
   }
 }
 
 DynamicLibrary::~DynamicLibrary() {
   assert(handle !=0 && "Invalid DynamicLibrary handle");
-  if (*((HMODULE*)handle))
-    FreeLibrary(*((HMODULE*)handle));
-  delete (HMODULE*)handle;
+  if (handle)
+    FreeLibrary((HMODULE*)handle);
 }
 
 void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
   assert(handle !=0 && "Invalid DynamicLibrary handle");
-  return (void*) GetProcAddress(*((HMODULE*)handle), symbolName);
+  return (void*) GetProcAddress((HMODULE*)handle, symbolName);
 }
 
 }
index 8308497280ce3a486f3e429dbec41e9fe6aaa6d1..d9685f2b1de0c2eb9e87f4d0b716bec93f0525d7 100644 (file)
                                <File
                                        RelativePath="..\..\lib\Transforms\Scalar\SimplifyCFG.cpp">
                                </File>
-                               <File
-                                       RelativePath="..\..\lib\Transforms\Scalar\SymbolStripping.cpp">
-                               </File>
                                <File
                                        RelativePath="..\..\lib\Transforms\Scalar\TailDuplication.cpp">
                                </File>