Commit 18c9e684 authored by Edwin Carlinet's avatar Edwin Carlinet

Merge branch 'development/fix-vs2019' into 'dev'

Compilation fixes for VS 2019

See merge request !83
parents 7954fdac a2e32f52
Pipeline #14837 passed with stages
in 4 minutes and 29 seconds
......@@ -58,11 +58,16 @@ endif()
#### MSVC Compiler Configuration
if (MSVC)
## This hack is for Ninja generator from VS CODE
string(REGEX REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
##
add_compile_options("/wd4458" # masque le membre de classe
"/wd4456" # masque la déclaration locale précédente
"/wd5030" # l'attribut 'noinline' n'est pas reconnu
"/wd4457" # la déclaration de '?' masque le paramètre de fonction
)
add_compile_options("/WX" "/W4" "/wd4244" "/wd4127" "/permissive-")
add_compile_definitions(_SCL_SECURE_NO_WARNINGS)
add_compile_definitions(_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
......
link_libraries(${FreeImage_LIBRARIES})
add_definitions(-DMLN_IMG_PATH="$(CMAKE_SOURCE_DIR)/img/")
add_compile_definitions(MLN_IMG_PATH="${CMAKE_SOURCE_DIR}/img/")
add_executable(meaningfullness meaningfullness.cpp)
add_test(meaningfullness meaningfullness)
\ No newline at end of file
link_libraries(${FreeImage_LIBRARIES})
add_definitions(-DMLN_IMG_PATH="$(CMAKE_SOURCE_DIR)/img/")
add_compile_definitions(MLN_IMG_PATH="${CMAKE_SOURCE_DIR}/img/")
add_executable(mumford_shah mumford_shah.cpp)
add_test(mumford_shah mumford_shah)
\ No newline at end of file
find_package(benchmark)
add_definitions(-DMLN_IMG_PATH="${CMAKE_SOURCE_DIR}/img/")
add_compile_definitions(MLN_IMG_PATH="${CMAKE_SOURCE_DIR}/img/")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
......
This diff is collapsed.
......@@ -18,7 +18,7 @@ namespace mln
struct winc4_t : dyn_neighborhood_base<constant_neighborhood_tag, winc4_t>
{
constexpr const std::array<point2d, 5>& offsets() { return dpoints; }
constexpr const std::array<point2d, 5>& offsets() const { return dpoints; }
static const int static_size = 5;
static const std::array<point2d, 5> dpoints;
};
......@@ -29,7 +29,7 @@ namespace mln
struct winc8_t : dyn_neighborhood_base<constant_neighborhood_tag, winc8_t>
{
constexpr const std::array<point2d, 9>& offsets() { return dpoints; }
constexpr const std::array<point2d, 9>& offsets() const { return dpoints; }
static const int static_size = 9;
static const std::array<point2d, 9> dpoints;
};
......@@ -41,7 +41,7 @@ namespace mln
struct winc2_v_t : dyn_neighborhood_base<constant_neighborhood_tag, winc2_v_t>
{
constexpr const std::array<point2d, 3>& offsets() { return dpoints; }
constexpr const std::array<point2d, 3>& offsets() const { return dpoints; }
static const int static_size = 3;
static const std::array<point2d, 3> dpoints;
};
......@@ -52,7 +52,7 @@ namespace mln
struct winc2_h_t : dyn_neighborhood_base<constant_neighborhood_tag, winc2_h_t>
{
constexpr const std::array<point2d, 3>& offsets() { return dpoints; }
constexpr const std::array<point2d, 3>& offsets() const { return dpoints; }
static const int static_size = 3;
static const std::array<point2d, 3> dpoints;
};
......
......@@ -135,14 +135,9 @@ namespace mln
{
// VISUAL STUDIO does not support constexpr pointer to function
// static constexpr void (*ptr) (void*,void*,std::size_t) = &value_convert<VIN, VOUT>;
static void (*const ptr)(void*, void*, std::size_t);
static constexpr void (*const ptr)(void*, void*, std::size_t) = &value_convert<VIN, VOUT>;
};
template <typename VIN, typename VOUT>
void(*const default_converter < VIN, VOUT,
typename std::enable_if<std::is_scalar<VIN>::value and std::is_scalar<VOUT>::value and
value_traits<VIN>::quant<value_traits<VOUT>::quant>::type>::ptr)(
void*, void*, std::size_t) = &value_convert<VIN, VOUT>;
#define MLN_INTERNAL_CONV_EXPAND(r, data, VIN) \
if (sidx == typeid(VIN)) \
......
......@@ -162,7 +162,7 @@ namespace mln
/*********************************/
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::bounded_hqueue()
inline bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::bounded_hqueue()
: m_q(NULL), m_end(NULL)
{
m_head.resize(nLevel);
......@@ -170,14 +170,14 @@ namespace mln
}
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::bounded_hqueue(
inline bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::bounded_hqueue(
const size_t* histo)
{
init(histo);
}
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::~bounded_hqueue()
inline bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::~bounded_hqueue()
{
if (m_q != NULL)
{
......@@ -189,7 +189,7 @@ namespace mln
}
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline void bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::init(
inline void bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::init(
const size_t* histo)
{
mln_precondition(m_q == NULL);
......@@ -206,7 +206,7 @@ namespace mln
}
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline bool bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::empty(
inline bool bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::empty(
unsigned level) const
{
mln_precondition(level < nLevel);
......@@ -214,7 +214,7 @@ namespace mln
}
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline void bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::push_at_level(
inline void bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::push_at_level(
const T& x, unsigned level)
{
mln_precondition(level < nLevel);
......@@ -223,7 +223,7 @@ namespace mln
}
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline T bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::pop_at_level(
inline T bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::pop_at_level(
unsigned level)
{
mln_precondition(level < nLevel);
......@@ -243,7 +243,7 @@ namespace mln
}
template <typename T, std::size_t nLevel, typename Allocator, bool queue>
inline T bounded_hqueue<T, nLevel, Allocator, queue, typename std::enable_if<(nLevel > 16)>::type>::top_at_level(
inline T bounded_hqueue<T, nLevel, Allocator, queue, std::enable_if_t<(nLevel > 16)>>::top_at_level(
unsigned level) const
{
mln_precondition(level < nLevel);
......
project(tests)
# add link flag to test framework
add_definitions(-DMLN_IMG_PATH="${CMAKE_SOURCE_DIR}/img/")
add_compile_definitions(MLN_IMG_PATH="${CMAKE_SOURCE_DIR}/img/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment