added definition _WINDOWS for (mingw and others) compatibility
This commit is contained in:
parent
18adaef056
commit
5ee50170b0
4 changed files with 23 additions and 13 deletions
|
|
@ -53,6 +53,10 @@ INCLUDE(ConfigureChecks.cmake)
|
|||
# now create config headers
|
||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
|
||||
|
||||
# Set a special flag if the environment is windows
|
||||
IF (WIN32)
|
||||
ADD_DEFINITIONS(-D_WINDOWS=1)
|
||||
ENDIF (WIN32)
|
||||
######################################################################################
|
||||
|
||||
|
||||
|
|
@ -61,7 +65,7 @@ configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
|
|||
#####################################################################################
|
||||
|
||||
# the user should choose the build type on windows environments,excepted under cygwin (default=none)
|
||||
SET(CMAKE_DEFAULT_BUILD_TYPE None CACHE STRING "Variable that stores the default CMake build type" FORCE)
|
||||
SET(CMAKE_DEFAULT_BUILD_TYPE "" CACHE STRING "Variable that stores the default CMake build type" FORCE)
|
||||
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
|
|
@ -101,4 +105,3 @@ ENDIF (ENABLE_CMAKE_TESTING)
|
|||
|
||||
######################################################################################
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -42,11 +42,13 @@ void signal_handler( int sig )
|
|||
// ---------------------------
|
||||
{
|
||||
// --- On veut la paix, jusqu'a la fin ---
|
||||
#ifdef SIGQUIT
|
||||
signal( SIGINT, SIG_IGN );
|
||||
signal( SIGQUIT, SIG_IGN );
|
||||
std::cerr << "Ctrl C entered ... closing down" << std::endl ;
|
||||
arret_demande = true;
|
||||
#ifndef _WINDOWS
|
||||
#ifdef SIGQUIT
|
||||
signal( SIGINT, SIG_IGN );
|
||||
signal( SIGQUIT, SIG_IGN );
|
||||
std::cerr << "Ctrl C entered ... closing down" << std::endl ;
|
||||
arret_demande = true;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// the same thing can probably be done in MS environement, but I hoave no way
|
||||
// to test it so at the moment it is commented out when in MSVC
|
||||
#ifndef _MSC_VER
|
||||
|
||||
|
||||
#ifndef eoCtrlCContinue_h
|
||||
#define eoCtrlCContinue_h
|
||||
|
|
@ -52,9 +52,15 @@ public:
|
|||
// First checks that no other eoCtrlCContinue does exist
|
||||
if (existCtrlCContinue)
|
||||
throw std::runtime_error("A signal handler for Ctrl C is already defined!\n");
|
||||
signal( SIGINT, signal_handler );
|
||||
signal( SIGQUIT, signal_handler );
|
||||
existCtrlCContinue = true;
|
||||
|
||||
#ifndef _WINDOWS
|
||||
#ifdef SIGQUIT
|
||||
signal( SIGINT, signal_handler );
|
||||
signal( SIGQUIT, signal_handler );
|
||||
existCtrlCContinue = true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/** Returns false when Ctrl C has been typed in
|
||||
|
|
@ -72,5 +78,4 @@ public:
|
|||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// of MSVC comment-out
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#ifndef _WINDOWS
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
|
|
|||
Reference in a new issue