NTexception.cxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00018
00019
00020 #ifndef _MSC_VER
00021 namespace IGNORE_THIS_FREAKING_NAMESPACE_DARNIT
00022 {
00023 static int trashola=1;
00024 void doit()
00025 {
00026 trashola=2;
00027 }
00028 };
00029 #else
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <windows.h>
00042 #include <portable_io.h>
00043 #include <stdlib.h>
00044
00045 namespace
00048 {
00049 LONG WINAPI death_by_exception(_EXCEPTION_POINTERS *ExceptionInfo)
00050 {
00053
00054
00055 fprintf(stderr, "\n\n\nSegfault or other major exception has occurred\n\n\n");
00056 fflush(stderr);
00057 exit(1);
00058 return 0;
00059 }
00060
00061 struct ForceStaticInvocation
00064 {
00065 ForceStaticInvocation()
00066 {
00067 SetUnhandledExceptionFilter(death_by_exception);
00068 }
00069 };
00070
00071 ForceStaticInvocation exceptionHandlerInstaller;
00072 };
00073 #endif
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086