GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — EosSdk/panic.cpp at master · peterkuria2000/EosSdk Expand file tree/ Copy pathpanic.cppMore file actions 57 lines (46 loc) · 1.13 KB / Copy pathpanic.cppFile metadata and controls57 lines (46 loc) · 1.13 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 // Copyright (c) 2013 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #include <cassert> #include <cstdio> #include <cstdlib> #include "eos/panic.h" #include "eos/exception.h" namespace eos { static void throw_exception(error const & exception) { exception.raise(); } auto exception_handler = throw_exception; void panic(char const * fmt, ...) { va_list ap; va_start(ap, fmt); vpanic(fmt, ap); // not reached } void panic(error const & error) { if(exception_handler) { exception_handler(error); } fprintf(stderr, "%s\n", error.what()); for(;;) { abort(); } } struct legacy_exception : public error { virtual ~legacy_exception() noexcept { } explicit legacy_exception(std::string const & msg) noexcept : error(msg) { } virtual void raise() const { throw *this; } }; void vpanic(char const * fmt, va_list ap) { char buf[1024]; vsnprintf(buf, 1024, fmt, ap); panic(legacy_exception(buf)); } void exception_handler_is(exception_handler_t h) { assert(h && "exception handler must not be null"); exception_handler = h; } } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |