Fixed for windows

This commit is contained in:
Kjell Hedstrom 2015-08-31 23:45:47 -06:00
parent a8d89b67c8
commit 055c4ec2ca
2 changed files with 20 additions and 14 deletions

View File

@ -122,17 +122,18 @@ endif()
# ========================================================================== # ==========================================================================
# INCLUDE (${g3log_SOURCE_DIR}/CPackLists.txt) # INCLUDE (${g3log_SOURCE_DIR}/CPackLists.txt)
IF (NOT MSVC)
MESSAGE("\n\n MESSAGE("\n\n
******************************************************************* *******************************************************************
Please do 'make clean-cmake' before next cmake generation. Please do 'make clean-cmake' before next cmake generation.
It is a good idea to purge your build directory of CMake It is a good idea to purge your build directory of CMake
generated cache files generated cache files
******************************************************************* *******************************************************************
") ")
add_custom_target(clean-cmake add_custom_target(clean-cmake
COMMAND ${CMAKE_COMMAND} -P ${g3log_SOURCE_DIR}/CleanAll.cmake COMMAND ${CMAKE_COMMAND} -P ${g3log_SOURCE_DIR}/CleanAll.cmake
) )
ENDIF()

View File

@ -18,6 +18,11 @@
#include <thread> #include <thread>
#include <exception> #include <exception>
#ifndef _MSC_VER
#define NOEXCEPT noexcept
#else
#define NOEXCEPT throw()
#endif
namespace namespace
{ {
@ -116,7 +121,7 @@ namespace
using deathfunc = void (*) (void); using deathfunc = void (*) (void);
void Death_x10000(deathfunc func, std::string funcname) noexcept { void Death_x10000(deathfunc func, std::string funcname) NOEXCEPT {
LOG(DEBUG) << " trigger exit"; LOG(DEBUG) << " trigger exit";
std::vector<std::future<void>> asyncs; std::vector<std::future<void>> asyncs;
asyncs.reserve(10000); asyncs.reserve(10000);
@ -132,7 +137,7 @@ namespace
} }
void Throw() noexcept { void Throw() NOEXCEPT {
LOG(DEBUG) << " trigger exit"; LOG(DEBUG) << " trigger exit";
std::future<int> empty; std::future<int> empty;
empty.get(); empty.get();
@ -141,7 +146,7 @@ namespace
} }
void SegFaultAttempt_x10000() noexcept { void SegFaultAttempt_x10000() NOEXCEPT {
deathfunc f = []{Throw(); *(char*)0 = 0; char* ptr = 0; *ptr = 1; AccessViolation();}; deathfunc f = []{Throw(); *(char*)0 = 0; char* ptr = 0; *ptr = 1; AccessViolation();};
Death_x10000(f, "throw uncaught exception... and then some sigsegv calls"); Death_x10000(f, "throw uncaught exception... and then some sigsegv calls");
} }