aboutsummaryrefslogtreecommitdiff
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-03-19 23:26:52 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-03-19 23:26:52 +0000
commit48fe63526e35ddaee7e98879596a569911f41319 (patch)
treeac51c35b589cd58106bb9afd41ad7ad20cb059a8 /lib/System/Win32
parenta24752ff43dc1ad8c18c5d9e78549c45f62b980e (diff)
Fix the Win32 VS2008 build:
- Make type declarations match the struct/class keyword of the definition. - Move AddSignalHandler into the namespace where it belongs. - Correctly call functions from template base. - Some other small changes. With this patch, LLVM and Clang should build properly and with far less noise under VS2008. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/Alarm.inc2
-rw-r--r--lib/System/Win32/Signals.inc22
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/System/Win32/Alarm.inc b/lib/System/Win32/Alarm.inc
index c413b096e7..e0d00a0142 100644
--- a/lib/System/Win32/Alarm.inc
+++ b/lib/System/Win32/Alarm.inc
@@ -39,5 +39,5 @@ int sys::AlarmStatus() {
extern "C" void __stdcall Sleep(unsigned long);
void sys::Sleep(unsigned n) {
- Sleep(n*1000);
+ ::Sleep(n*1000);
}
diff --git a/lib/System/Win32/Signals.inc b/lib/System/Win32/Signals.inc
index 9276ef41a0..560ac3879e 100644
--- a/lib/System/Win32/Signals.inc
+++ b/lib/System/Win32/Signals.inc
@@ -14,6 +14,7 @@
#include "Win32.h"
#include <stdio.h>
#include <vector>
+#include <algorithm>
#ifdef __MINGW32__
#include <imagehlp.h>
@@ -111,6 +112,17 @@ void sys::SetInterruptFunction(void (*IF)()) {
InterruptFunction = IF;
LeaveCriticalSection(&CriticalSection);
}
+
+
+/// AddSignalHandler - Add a function to be called when a signal is delivered
+/// to the process. The handler can have a cookie passed to it to identify
+/// what instance of the handler it is.
+void sys::AddSignalHandler(void (*FnPtr)(void *), void *Cookie) {
+ if (CallBacksToRun == 0)
+ CallBacksToRun = new std::vector<std::pair<void(*)(void*), void*> >();
+ CallBacksToRun->push_back(std::make_pair(FnPtr, Cookie));
+ RegisterHandler();
+}
}
static void Cleanup() {
@@ -256,13 +268,3 @@ static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) {
return FALSE;
}
-/// AddSignalHandler - Add a function to be called when a signal is delivered
-/// to the process. The handler can have a cookie passed to it to identify
-/// what instance of the handler it is.
-void llvm::sys::AddSignalHandler(void (*FnPtr)(void *), void *Cookie) {
- if (CallBacksToRun == 0)
- CallBacksToRun = new std::vector<std::pair<void(*)(void*), void*> >();
- CallBacksToRun->push_back(std::make_pair(FnPtr, Cookie));
- RegisterHandler();
-}
-