diff options
author | mayah <mayah@mayah.jp> | 2017-03-07 11:22:24 +0900 |
---|---|---|
committer | mayah <mayah@mayah.jp> | 2017-03-07 11:22:24 +0900 |
commit | 8fa778aa12cfd24767ca15bfd630f1e820eabd92 (patch) | |
tree | 2bfcf37e266fdb124f66fbbcc2f3d4290a58693f /src/windows | |
parent | ab6545470bdb6fb14442923b2aa3289983bea968 (diff) | |
download | glog-8fa778aa12cfd24767ca15bfd630f1e820eabd92.tar.gz glog-8fa778aa12cfd24767ca15bfd630f1e820eabd92.tar.bz2 glog-8fa778aa12cfd24767ca15bfd630f1e820eabd92.zip |
Add __declspec(noreturn) on Win
Currently cl.exe doesn't know LOG(FATAL) exits the program. Set
__declspec(noreturn).
Diffstat (limited to 'src/windows')
-rwxr-xr-x | src/windows/glog/logging.h | 6 | ||||
-rwxr-xr-x | src/windows/preprocess.sh | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/windows/glog/logging.h b/src/windows/glog/logging.h index 3e51254..7456752 100755 --- a/src/windows/glog/logging.h +++ b/src/windows/glog/logging.h @@ -1250,7 +1250,7 @@ public: void SendToSyslogAndLog(); // Actually dispatch to syslog and the logs // Call abort() or similar to perform LOG(FATAL) crash. - static void Fail(); + static void __declspec(noreturn) Fail(); std::ostream& stream(); @@ -1298,7 +1298,7 @@ class GOOGLE_GLOG_DLL_DECL LogMessageFatal : public LogMessage { public: LogMessageFatal(const char* file, int line); LogMessageFatal(const char* file, int line, const CheckOpString& result); - ~LogMessageFatal(); + __declspec(noreturn) ~LogMessageFatal(); }; // A non-macro interface to the log facility; (useful @@ -1602,7 +1602,7 @@ class GOOGLE_GLOG_DLL_DECL NullStreamFatal : public NullStream { NullStreamFatal() { } NullStreamFatal(const char* file, int line, const CheckOpString& result) : NullStream(file, line, result) { } - ~NullStreamFatal() throw () { _exit(1); } + __declspec(noreturn) ~NullStreamFatal() throw () { _exit(1); } }; // Install a signal handler that will dump signal information and a stack diff --git a/src/windows/preprocess.sh b/src/windows/preprocess.sh index 5398988..c35e929 100755 --- a/src/windows/preprocess.sh +++ b/src/windows/preprocess.sh @@ -95,7 +95,7 @@ DLLDEF_DEFINES="\ -e "s!@ac_cv_have_libgflags@!0!g" \ -e "s!@ac_cv_have___builtin_expect@!0!g" \ -e "s!@ac_cv_cxx_using_operator@!1!g" \ - -e "s!@ac_cv___attribute___noreturn@!!g" \ + -e "s!@ac_cv___attribute___noreturn@!__declspec(noreturn)!g" \ -e "s!@ac_cv___attribute___noinline@!!g" \ -e "s!@ac_cv___attribute___printf_4_5@!!g" \ -e "s!@ac_google_attribute@!${HAVE___ATTRIBUTE__:-0}!g" \ |