From: Date: Thu, 12 Jan 2012 07:45:39 +0000 (+0000) Subject: Put __attribute__((noreturn)) for declartions of function pointers X-Git-Tag: accepted/tizen/5.0/unified/20181102.024921~133 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11e78e4c66a1db78e611fac91fd3429059976f38;hp=6232847ecb73144658450f2c09968595a0abca65;p=platform%2Fupstream%2Fglog.git Put __attribute__((noreturn)) for declartions of function pointers Clang needs this change. git-svn-id: https://google-glog.googlecode.com/svn/trunk@103 eb4d4688-79bd-11dd-afb4-1d65580434c0 --- diff --git a/src/logging.cc b/src/logging.cc index d768b95..1b864cd 100644 --- a/src/logging.cc +++ b/src/logging.cc @@ -1247,6 +1247,14 @@ void LogMessage::RecordCrashReason( #endif } +#ifdef HAVE___ATTRIBUTE__ +# define ATTRIBUTE_NORETURN __attribute__((noreturn)) +#else +# define ATTRIBUTE_NORETURN +#endif + +static void logging_fail() ATTRIBUTE_NORETURN; + static void logging_fail() { #if defined(_DEBUG) && defined(_MSC_VER) // When debugging on windows, avoid the obnoxious dialog and make @@ -1257,15 +1265,13 @@ static void logging_fail() { #endif } -#ifdef HAVE___ATTRIBUTE__ +typedef void (*logging_fail_func_t)() ATTRIBUTE_NORETURN; + GOOGLE_GLOG_DLL_DECL -void (*g_logging_fail_func)() __attribute__((noreturn)) = &logging_fail; -#else -GOOGLE_GLOG_DLL_DECL void (*g_logging_fail_func)() = &logging_fail; -#endif +logging_fail_func_t g_logging_fail_func = &logging_fail; void InstallFailureFunction(void (*fail_func)()) { - g_logging_fail_func = fail_func; + g_logging_fail_func = (logging_fail_func_t)fail_func; } void LogMessage::Fail() {