00001 /* runtime.hpp 00002 * 00003 * Copyright (C) 2003 Sawtooth Consulting Ltd. 00004 * 00005 * This file is part of yaSSL. 00006 * 00007 * yaSSL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * There are special exceptions to the terms and conditions of the GPL as it 00013 * is applied to yaSSL. View the full text of the exception in the file 00014 * FLOSS-EXCEPTIONS in the directory of this software distribution. 00015 * 00016 * yaSSL is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00024 */ 00025 00026 /* runtime.hpp provides C++ runtime support functions when building a pure C 00027 * version of yaSSL, user must define YASSL_PURE_C 00028 */ 00029 00030 00031 00032 #ifndef yaSSL_NEW_HPP 00033 #define yaSSL_NEW_HPP 00034 00035 #ifdef HAVE_CONFIG_H 00036 #include "config.h" 00037 #endif 00038 00039 #ifdef __sun 00040 00041 #include <assert.h> 00042 00043 // Handler for pure virtual functions 00044 namespace __Crun { 00045 static void pure_error(void) 00046 { 00047 assert("Pure virtual method called." == "Aborted"); 00048 } 00049 } // namespace __Crun 00050 00051 #endif // __sun 00052 00053 00054 #if defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) 00055 00056 #if __GNUC__ > 2 00057 00058 extern "C" { 00059 #if !defined(DO_TAOCRYPT_KERNEL_MODE) 00060 #include <assert.h> 00061 #else 00062 #include "kernelc.hpp" 00063 #endif 00064 00065 /* Disallow inline __cxa_pure_virtual() */ 00066 static int __cxa_pure_virtual() __attribute__((noinline, used)); 00067 static int __cxa_pure_virtual() 00068 { 00069 // oops, pure virtual called! 00070 assert("Pure virtual method called." == "Aborted"); 00071 return 0; 00072 } 00073 00074 } // extern "C" 00075 00076 #endif // __GNUC__ > 2 00077 #endif // compiler check 00078 #endif // yaSSL_NEW_HPP 00079
1.4.7

