fix includes and definitions (avoid unistd.h, isatty, fix min,max, round and M_PI)
This commit is contained in:
parent
0e16c4ed97
commit
0209272831
@ -121,6 +121,10 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(-DNOMINMAX) # avoid min and max macros that can break compilation
|
||||
add_definitions(-D_USE_MATH_DEFINES) # define M_PI
|
||||
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||
endif()
|
||||
|
||||
# disable partitioning of LTO process when possible (fixes Debian issues)
|
||||
|
@ -31,7 +31,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <io.h>
|
||||
#define isatty _isatty
|
||||
#define fileno _fileno
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
|
@ -36,7 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
template <typename digitT> digitT round(digitT x) { return std::floor(x + 0.5); }
|
||||
#endif
|
||||
|
||||
typedef unsigned int NodeID;
|
||||
|
Loading…
Reference in New Issue
Block a user