From 66e4ace39f8f27f4cd7013e09f241327118c968a Mon Sep 17 00:00:00 2001 From: Jean Carass Date: Fri, 2 Nov 2018 08:51:57 -0700 Subject: [PATCH] Replaced strcpy_s, strcat_s for MinGW builds. --- modules/highgui/src/window_w32.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp index a4ec2d51b6..f1e423a4b0 100644 --- a/modules/highgui/src/window_w32.cpp +++ b/modules/highgui/src/window_w32.cpp @@ -99,6 +99,19 @@ static const char* trackbar_text = #define WM_MOUSEHWHEEL 0x020E #endif +#if defined(__MINGW32__) || defined(__MINGW64__) +static inline void mingw_strcpy_s(char *dest, size_t destsz, const char *src){ + strcpy(dest, src); +} + +static inline void mingw_strcat_s(char *dest, size_t destsz, const char *src){ + strcat(dest, src); +} + +#define strcpy_s mingw_strcpy_s +#define strcat_s mingw_strcat_s +#endif + static void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ) { assert( bmi && width >= 0 && height >= 0 && (bpp == 8 || bpp == 24 || bpp == 32));