From 422ecc98e4a8d0b4bd64e33cffa3d06ca2f16a62 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 12 Feb 2017 12:03:01 +0000 Subject: [PATCH] Fixup choice of easylogging++ vs libunwind stack trace code --- contrib/epee/include/misc_log_ex.h | 5 +++-- external/easylogging++/easylogging++.h | 3 +++ src/common/stack_trace.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/epee/include/misc_log_ex.h b/contrib/epee/include/misc_log_ex.h index b1685f38..ae61965f 100644 --- a/contrib/epee/include/misc_log_ex.h +++ b/contrib/epee/include/misc_log_ex.h @@ -51,8 +51,9 @@ #define ELPP_THREAD_SAFE #define ELPP_DEFAULT_LOG_FILE "" -#ifndef __ANDROID__ -#define ELPP_STACKTRACE_ON_CRASH 0 +#if !defined __GNUC__ || defined __MINGW32__ || defined __MINGW64__ || defined __ANDROID__ +#else +#define ELPP_STACKTRACE_ON_CRASH 1 #endif #define ELPP_DISABLE_DEFAULT_CRASH_HANDLING #define ELPP_FEATURE_CRASH_LOG 1 diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h index 24e271e8..1cf9dbac 100644 --- a/external/easylogging++/easylogging++.h +++ b/external/easylogging++/easylogging++.h @@ -198,12 +198,15 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre # if (ELPP_COMPILER_GCC && !ELPP_MINGW) # define ELPP_STACKTRACE 1 # else +# define ELPP_STACKTRACE 0 # if ELPP_COMPILER_MSVC # pragma message("Stack trace not available for this compiler") # else # warning "Stack trace not available for this compiler"; # endif // ELPP_COMPILER_MSVC # endif // ELPP_COMPILER_GCC +#else +# define ELPP_STACKTRACE 0 #endif // (defined(ELPP_STACKTRACE_ON_CRASH)) // Miscellaneous macros #define ELPP_UNUSED(x) (void)x diff --git a/src/common/stack_trace.cpp b/src/common/stack_trace.cpp index 67065aae..ef64c20c 100644 --- a/src/common/stack_trace.cpp +++ b/src/common/stack_trace.cpp @@ -26,7 +26,7 @@ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#if !defined __GNUC__ || defined __MINGW32__ || defined __MINGW64__ +#if !defined __GNUC__ || defined __MINGW32__ || defined __MINGW64__ || defined __ANDROID__ #define USE_UNWIND #endif