|
SHOGUN v0.9.3
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 1999-2009 Soeren Sonnenburg 00008 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #include "lib/ShogunException.h" 00012 #include "lib/Signal.h" 00013 00014 #include <string.h> 00015 #include <stdio.h> 00016 #include <stdlib.h> 00017 00018 using namespace shogun; 00019 00020 ShogunException::ShogunException(const char* str) 00021 { 00022 #ifndef WIN32 00023 CSignal::unset_handler(); 00024 #endif 00025 val = (char*) malloc(sizeof(char)*4096); 00026 if (val) 00027 strncpy(val,str,4096); 00028 else 00029 { 00030 fprintf(stderr, "Could not even allocate memory for exception - dying.\n"); 00031 exit(1); 00032 } 00033 } 00034 00035 ShogunException::~ShogunException() 00036 { 00037 }