msvc tests

This commit is contained in:
Robin Müller 2020-12-20 15:32:03 +01:00
parent 3540adf022
commit d8e5000d47
6 changed files with 40 additions and 9 deletions

View File

@ -106,14 +106,20 @@ else()
)
endif()
set(WARNING_FLAGS
if(CMAKE_COMPILER_IS_GNUCXX)
set(WARNING_FLAGS
-Wall
-Wextra
-Wshadow=local
-Wimplicit-fallthrough=1
-Wno-unused-parameter
-Wno-psabi
)
)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(COMPILER_FLAGS "/permissive-")
endif()
# Required include paths to compile the FSFW
target_include_directories(${LIB_FSFW_NAME} INTERFACE
@ -132,5 +138,6 @@ target_include_directories(${LIB_FSFW_NAME} PRIVATE
# Machine specific options can be set with the ABI_FLAGS variable.
target_compile_options(${LIB_FSFW_NAME} PRIVATE
${WARNING_FLAGS}
${COMPILER_FLAGS}
${ABI_FLAGS}
)

View File

@ -1,7 +1,9 @@
#ifndef SGP4PROPAGATOR_H_
#define SGP4PROPAGATOR_H_
#ifndef WIN32
#include <sys/time.h>
#endif
#include "../contrib/sgp4/sgp4unit.h"
#include "../returnvalues/HasReturnvaluesIF.h"

View File

@ -2,7 +2,13 @@
#define TIMEVALOPERATIONS_H_
#include <stdint.h>
#ifdef WIN32
// Why MSVC? Why? :)))
#include <Windows.h>
#else
#include <sys/time.h>
#endif
timeval& operator+=(timeval& lhs, const timeval& rhs);

View File

@ -22,9 +22,23 @@
#else
#error "Can't decide which end is which!"
#endif
#else
#ifdef WIN32
#include <Windows.h>
#if REG_DWORD == REG_DWORD_LITTLE_ENDIAN
#define BYTE_ORDER_SYSTEM LITTLE_ENDIAN
#else
#define BYTE_ORDER_SYSTEM BIG_ENDIAN
#endif
#else
#error __BYTE_ORDER__ not defined
#endif
#endif
#endif

View File

@ -30,7 +30,7 @@ protected:
//! This is called when buffer becomes full. If
//! buffer is not used, then this is called every
//! time when characters are put to stream.
int overflow(int c = Traits::eof()) override;
int overflow(int c = std::ostream::traits_type::eof()) override;
//! This function is called when stream is flushed,
//! for example when std::endl is put to stream.

View File

@ -6,7 +6,9 @@
#include "../globalfunctions/timevalOperations.h"
#include <cstdint>
#ifndef WIN32
#include <sys/time.h>
#endif
//! Don't use these for time points, type is not large enough for UNIX epoch.
using dur_millis_t = uint32_t;