glog icon indicating copy to clipboard operation
glog copied to clipboard

logging_fail fail for x64 in VS2013, libglog_static

Open KevinLucidyne opened this issue 10 years ago • 1 comments

The following code will fail to compile in logging.cc under VS2013 x64 for libglog_static because _asm is no longer supported.

static void logging_fail() {
#if defined(_DEBUG) && defined(_MSC_VER) 
  // When debugging on windows, avoid the obnoxious dialog and make
  // it possible to continue past a LOG(FATAL) in the debugger
  _asm int 3
#else
  abort();
#endif
}

If I change the code to this, the code will compile but when I use glog and fire a LOG(FAIL) in a debugger I will get the R6010 abort() dialog box.

#if defined(_DEBUG) && defined(_MSC_VER) && defined(_M_IX86)

What is the fix for R6010 that will also work for VS2013 x64?

KevinLucidyne avatar Aug 04 '16 17:08 KevinLucidyne

Found on this website: http://blog.csdn.net/fksec/article/details/44341531 You may want to replace the inline assembly code:

_asm int 3

with:

__debugbreak();

Madgeeno avatar Sep 12 '16 08:09 Madgeeno