Support git Notes.
[TortoiseGit.git] / ext / gitdll / die.cpp
blob09e4324dcc49f85c19620205dcd06c3736a8ffc0
1 #include "stdafx.h"
2 #include "gitdll.h"
3 #include "stdio.h"
5 #define MAX_ERROR_STR_SIZE 512
6 extern "C" char g_last_error[MAX_ERROR_STR_SIZE]={0};
7 extern "C" int close_all();
9 extern "C" void die_dll(const char *err, va_list params)
11 memset(g_last_error,0,MAX_ERROR_STR_SIZE);
12 vsnprintf(g_last_error, MAX_ERROR_STR_SIZE-1, err, params);
13 close_all();
14 throw g_last_error;
17 extern "C" void vc_exit(int code)
19 close_all();
20 throw code;