infra: fix build failure using c++17 (or later) with MSVC.

the WIN32_LEAN_AND_MEAN definition will remove the unused
features in windows.h that helps to improve the build-speed
as well as fixing the issue.

Issue: https://github.com/thorvg/thorvg/issues/2225

Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
This commit is contained in:
Vincent Torri 2024-05-02 15:55:55 +09:00 committed by Hermet Park
parent 55c4d6fe28
commit b1912e2ef9
4 changed files with 6 additions and 1 deletions

View file

@ -124,6 +124,8 @@ if get_option('log') == true
config_h.set10('THORVG_LOG_ENABLED', true) config_h.set10('THORVG_LOG_ENABLED', true)
endif endif
#Miscellaneous
config_h.set10('WIN32_LEAN_AND_MEAN', true)
configure_file( configure_file(
output: 'config.h', output: 'config.h',

View file

@ -25,6 +25,7 @@
#include <vector> #include <vector>
#include <thorvg.h> #include <thorvg.h>
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX MAX_PATH #define PATH_MAX MAX_PATH

View file

@ -24,8 +24,8 @@
#include <thread> #include <thread>
#include <thorvg.h> #include <thorvg.h>
#include <vector> #include <vector>
#include "lodepng.h"
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX MAX_PATH #define PATH_MAX MAX_PATH
@ -36,6 +36,7 @@
#include <limits.h> #include <limits.h>
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
#include "lodepng.h"
#define WIDTH_8K 7680 #define WIDTH_8K 7680
#define HEIGHT_8K 4320 #define HEIGHT_8K 4320

View file

@ -25,6 +25,7 @@
#include <thread> #include <thread>
#include <thorvg.h> #include <thorvg.h>
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX MAX_PATH #define PATH_MAX MAX_PATH