Commit 56928e06 authored by Edwin Carlinet's avatar Edwin Carlinet

Make things compile with MSVC.

parent 49c4f13b
Pipeline #19826 failed with stages
in 45 minutes and 57 seconds
......@@ -78,7 +78,7 @@ if (MSVC)
"/wd4457" # la déclaration de '?' masque le paramètre de fonction
"/wd4996" # '...': was declared deprecated
)
add_compile_options("/WX" "/W3" "/wd4244" "/wd4127" "/permissive-")
add_compile_options("/WX" "/W3" "/wd4244" "/wd4127")
add_compile_definitions(_SCL_SECURE_NO_WARNINGS)
add_compile_definitions(_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
add_compile_definitions(_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
......
......@@ -4,7 +4,9 @@
#include <mln/core/range/rows.hpp>
#include <mln/core/range/view/zip.hpp>
#ifdef _MSC_VER
# define __restrict__ __restrict
#endif
void Mult_Inplace_New_Values(mln::image2d<uint8_t>& img)
......
......@@ -4,9 +4,10 @@
#include <mln/core/range/view/reverse.hpp>
#include <mln/core/range/view/zip.hpp>
#include <vector>
#ifdef _MSC_VER
# define __restrict__ __restrict
#endif
void Mult_Inplace_New_Values_Reversed(mln::image2d<uint8_t>& img)
{
......
......@@ -7,14 +7,17 @@
#include <benchmark/benchmark.h>
#ifdef _MSC_VER
# define __restrict__ __restrict
#endif
void Mult_Inplace_C(uint8_t* buffer, int width, int height, std::ptrdiff_t stride);
void Threshold_Inplace_C(uint8_t* buffer, int width, int height, std::ptrdiff_t stride);
void LUT_Inplace_C(const uint8_t* LUT, uint8_t* buffer, int width, int height, std::ptrdiff_t stride);
void Mult_C(const uint8_t* ibuffer, uint8_t* obuffer, int width, int height, std::ptrdiff_t stride);
void Threshold_C(const uint8_t* ibuffer, uint8_t* obuffer, int width, int height, std::ptrdiff_t stride);
void LUT_C(const uint8_t* LUT, const uint8_t* ibuffer, uint8_t* obuffer, int width, int height,
void Mult_C(const uint8_t* __restrict__ ibuffer, uint8_t* __restrict__ obuffer, int width, int height, std::ptrdiff_t stride);
void Threshold_C(const uint8_t* __restrict__ ibuffer, uint8_t* __restrict__ obuffer, int width, int height, std::ptrdiff_t stride);
void LUT_C(const uint8_t* LUT, const uint8_t* __restrict__ ibuffer, uint8_t* __restrict__ obuffer, int width, int height,
std::ptrdiff_t stride);
void Mult_New_Values(const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
......@@ -23,8 +26,8 @@ void Mult_New_Pixels(const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>&
void Threshold_New_Values(const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void Threshold_New_Pixels(const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void LUT_New_Values(const uint8_t* LUT, const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void LUT_New_Pixels(const uint8_t* LUT, const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void LUT_New_Values(const uint8_t LUT[], const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void LUT_New_Pixels(const uint8_t LUT[], const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void Mult_Inplace_New_Values(mln::image2d<uint8_t>& img);
void Threshold_Inplace_New_Values(mln::image2d<uint8_t>& img);
......@@ -43,9 +46,9 @@ void Threshold_Inplace_C_Reversed(uint8_t* buffer, int width, int height, std::p
void LUT_Inplace_C_Reversed(const uint8_t* LUT, uint8_t* buffer, int width, int height, std::ptrdiff_t stride);
void Mult_C_Reversed(const uint8_t* ibuffer, uint8_t* obuffer, int width, int height, std::ptrdiff_t stride);
void Threshold_C_Reversed(const uint8_t* ibuffer, uint8_t* obuffer, int width, int height, std::ptrdiff_t stride);
void LUT_C_Reversed(const uint8_t* LUT, const uint8_t* ibuffer, uint8_t* obuffer, int width, int height,
void Mult_C_Reversed(const uint8_t* __restrict__ ibuffer, uint8_t* __restrict__ obuffer, int width, int height, std::ptrdiff_t stride);
void Threshold_C_Reversed(const uint8_t* __restrict__ ibuffer, uint8_t* __restrict__ obuffer, int width, int height, std::ptrdiff_t stride);
void LUT_C_Reversed(const uint8_t* LUT, const uint8_t* __restrict__ ibuffer, uint8_t* __restrict__ obuffer, int width, int height,
std::ptrdiff_t stride);
void Mult_New_Values_Reversed(const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
......@@ -54,9 +57,9 @@ void Mult_New_Pixels_Reversed(const mln::image2d<uint8_t>& input, mln::image2d<u
void Threshold_New_Values_Reversed(const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void Threshold_New_Pixels_Reversed(const mln::image2d<uint8_t>& input, mln::image2d<uint8_t>& output);
void LUT_New_Values_Reversed(const uint8_t* LUT, const mln::image2d<uint8_t>& input,
void LUT_New_Values_Reversed(const uint8_t LUT[], const mln::image2d<uint8_t>& input,
mln::image2d<uint8_t>& output);
void LUT_New_Pixels_Reversed(const uint8_t* LUT, const mln::image2d<uint8_t>& input,
void LUT_New_Pixels_Reversed(const uint8_t LUT[], const mln::image2d<uint8_t>& input,
mln::image2d<uint8_t>& output);
void Mult_Inplace_New_Values_Reversed(mln::image2d<uint8_t>& img);
......
......@@ -65,12 +65,7 @@ add_library(doc-lib lut.cpp)
target_link_libraries(doc-lib Pylene::Pylene)
# for program_options, need to separate CONAN and regular FindBoost
if (TARGET Boost::program_options)
link_libraries(Boost::program_options)
elseif (TARGET CONAN_LIB::Boost_boost_program_options)
link_libraries(CONAN_LIB::Boost_boost_program_options)
endif()
link_libraries(Pylene::Pylene)
link_libraries(doc-lib)
......@@ -84,3 +79,12 @@ add_executable(area_filter area_filter.cpp)
add_executable(cdt cdt.cpp)
add_executable(first_start_1 first_start_1.cpp)
add_executable(intro-1 intro-1.cpp)
target_compile_definitions(erosion-cli PRIVATE BOOST_ALL_NO_LIB)
# for program_options, need to separate CONAN and regular FindBoost
if (TARGET Boost::program_options)
target_link_libraries(erosion-cli PRIVATE Boost::program_options)
elseif (TARGET Boost::Boost)
target_link_libraries(erosion-cli PRIVATE Boost::Boost)
endif()
\ No newline at end of file
......@@ -28,7 +28,7 @@ elseif (MSVC)
target_compile_options(Pylene PUBLIC
"/wd4275" # non dll-interface class '...' used as base for dll-interface (fmt lib)
"/wd5104" # found 'L#x' in macro replacement list, did you mean
"/experimental:preprocess" # required by range-v3
"/experimental:preprocessor" # required by range-v3
"/permissive-" # required by range-v3
)
endif ()
......
......@@ -17,7 +17,7 @@ namespace mln
{
int SR = 5; // Spatial window radius
int NITER = 30; // Maximal number of iteration
float eps = 0.1; //
float eps = 0.1f; //
double hs2 = hs * hs;
double hr2 = hr * hr;
double eps2 = eps * eps;
......
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