From 7f4b9bfbc9c779d542e93d46614c798d3327d95c Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Sun, 7 Nov 2021 10:20:16 -0500 Subject: [PATCH] [dlg] Define DLG_STATIC explicitly. DLG_STATIC is intended to disable Windows DLL linking attributes. It does not hurt to define it explicitly when we wrap DLG code. This fixes tons of LNK4286 and C4273 warnings from MSVC if we forget to define DLG_STATIC as a compiler option. * builds/windows/vc2010/freetype.vcxproj: Remove DLG_STATIC option. * src/dlg/dlgwrap.c [FT_DEBUG_LOGGING]: Define DLG_STATIC. * include/freetype/internal/ftdebug.h [FT_DEBUG_LOGGING]: Ditto. --- builds/windows/vc2010/freetype.vcxproj | 6 +++--- include/freetype/internal/ftdebug.h | 1 + src/dlg/dlgwrap.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/builds/windows/vc2010/freetype.vcxproj b/builds/windows/vc2010/freetype.vcxproj index ccabbd4f4..feb03b0cf 100644 --- a/builds/windows/vc2010/freetype.vcxproj +++ b/builds/windows/vc2010/freetype.vcxproj @@ -203,7 +203,7 @@ Disabled $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT_DEBUG_LOGGING;DLG_STATIC;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT_DEBUG_LOGGING;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug false @@ -229,7 +229,7 @@ Disabled $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT_DEBUG_LOGGING;DLG_STATIC;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT_DEBUG_LOGGING;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug false @@ -255,7 +255,7 @@ Disabled $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT_DEBUG_LOGGING;DLG_STATIC;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT_DEBUG_LOGGING;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug false diff --git a/include/freetype/internal/ftdebug.h b/include/freetype/internal/ftdebug.h index b9787a709..5e8d9294a 100644 --- a/include/freetype/internal/ftdebug.h +++ b/include/freetype/internal/ftdebug.h @@ -32,6 +32,7 @@ #include "compiler-macros.h" #ifdef FT_DEBUG_LOGGING +#define DLG_STATIC #include #include diff --git a/src/dlg/dlgwrap.c b/src/dlg/dlgwrap.c index 98dc4b22c..e0b9a8d29 100644 --- a/src/dlg/dlgwrap.c +++ b/src/dlg/dlgwrap.c @@ -21,6 +21,7 @@ #ifdef FT_DEBUG_LOGGING +#define DLG_STATIC #include "dlg.c" #else /* ANSI C doesn't like empty source files */