From b7718905aa257f159aa494e7d07332645344a907 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Mon, 16 May 2022 11:36:51 +0100 Subject: [PATCH 01/10] Merged with Master branch and addressed the issues raised by https://github.com/areaDetector/ADSupport/issues/38 --- supportApp/GraphicsMagickSrc/coders/Makefile | 2 +- supportApp/GraphicsMagickSrc/magick/Makefile | 2 +- supportApp/GraphicsMagickSrc/ttf/Makefile | 1 - supportApp/hdf5Src/H5win32defs.h | 5 ++++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/supportApp/GraphicsMagickSrc/coders/Makefile b/supportApp/GraphicsMagickSrc/coders/Makefile index cdc95d7f..ebecc99d 100644 --- a/supportApp/GraphicsMagickSrc/coders/Makefile +++ b/supportApp/GraphicsMagickSrc/coders/Makefile @@ -204,7 +204,7 @@ ifeq ($(WITH_GRAPHICSMAGICK),YES) endif endif - LIB_SYS_LIBS_WIN32 += User32 Gdi32 OleAut32 + LIB_SYS_LIBS_WIN32 += user32 gdi32 oleaut32 endif # ($(GRAPHICSMAGICK_EXTERNAL),NO) endif # ($(WITH_GRAPHICSMAGICK),YES) diff --git a/supportApp/GraphicsMagickSrc/magick/Makefile b/supportApp/GraphicsMagickSrc/magick/Makefile index 952f26e9..819c917a 100644 --- a/supportApp/GraphicsMagickSrc/magick/Makefile +++ b/supportApp/GraphicsMagickSrc/magick/Makefile @@ -209,7 +209,7 @@ ifeq ($(WITH_GRAPHICSMAGICK),YES) endif endif - LIB_SYS_LIBS_WIN32 += Advapi32 User32 Gdi32 + LIB_SYS_LIBS_WIN32 += advapi32 user32 gdi32 LIB_SYS_LIBS_Linux += Xext endif # ($(GRAPHICSMAGICK_EXTERNAL),NO) diff --git a/supportApp/GraphicsMagickSrc/ttf/Makefile b/supportApp/GraphicsMagickSrc/ttf/Makefile index 12287669..7be94f10 100644 --- a/supportApp/GraphicsMagickSrc/ttf/Makefile +++ b/supportApp/GraphicsMagickSrc/ttf/Makefile @@ -1,7 +1,6 @@ TOP = ../../.. include $(TOP)/configure/CONFIG -DIRS += builds DIRS += src include $(TOP)/configure/RULES_DIRS diff --git a/supportApp/hdf5Src/H5win32defs.h b/supportApp/hdf5Src/H5win32defs.h index 0149faa9..6ead9217 100644 --- a/supportApp/hdf5Src/H5win32defs.h +++ b/supportApp/hdf5Src/H5win32defs.h @@ -78,13 +78,16 @@ typedef __int64 h5_stat_size_t; */ #define HDmemset(X,C,Z) memset((void*)(X),C,Z) +#ifndef _TIMEZONE_DEFINED +#define _TIMEZONE_DEFINED struct timezone { int tz_minuteswest; int tz_dsttime; }; +#endif /* time.h before VS2015 does not include timespec */ -#if (_MSC_VER < 1900) +#if defined (_MSC_VER) && (_MSC_VER < 1900) struct timespec { time_t tv_sec; /* Seconds - >= 0 */ From 39bf212dfa72e905e333be32d6c5577af79171a0 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Tue, 17 May 2022 09:50:55 +0100 Subject: [PATCH 02/10] MingW already establishes it's own unhandled exception handler, which conflicts with the one emplaced by magick. --- supportApp/GraphicsMagickSrc/magick/magick.c | 2 +- supportApp/GraphicsMagickSrc/magick/nt_base.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/supportApp/GraphicsMagickSrc/magick/magick.c b/supportApp/GraphicsMagickSrc/magick/magick.c index ad0fb6ff..590d8b41 100644 --- a/supportApp/GraphicsMagickSrc/magick/magick.c +++ b/supportApp/GraphicsMagickSrc/magick/magick.c @@ -1178,7 +1178,7 @@ InitializeMagick(const char *path) MinimumCoderClass=PrimaryCoderClass; } -#if defined(MSWINDOWS) +#if defined(MSWINDOWS) && !defined(__MINGW32__) NTInitializeExceptionHandlers(); /* WIN32 Exceptions */ #endif /* defined(MSWINDOWS) */ InitializeMagickSignalHandlers(); /* Signal handlers */ diff --git a/supportApp/GraphicsMagickSrc/magick/nt_base.c b/supportApp/GraphicsMagickSrc/magick/nt_base.c index 0e70ee17..a5b9b03f 100644 --- a/supportApp/GraphicsMagickSrc/magick/nt_base.c +++ b/supportApp/GraphicsMagickSrc/magick/nt_base.c @@ -398,6 +398,7 @@ MagickExport MagickBool IsWindows95() % % */ +#ifndef __MINGW32__ static LONG WINAPI MagickUnhandledExceptionFilter(struct _EXCEPTION_POINTERS *info) { @@ -640,7 +641,8 @@ NTInitializeExceptionHandlers() SEM_NOOPENFILEERRORBOX); (void) SetUnhandledExceptionFilter(MagickUnhandledExceptionFilter); } - +#endif // __MINGW32__ + #if !defined(HasLTDL) /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% From 176ff45ef0b54711a34da58100d355e72e708e11 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Tue, 17 May 2022 14:54:15 +0100 Subject: [PATCH 03/10] Both USR_CFLAGS and USR_CXXFLAGS need to be set, I think. --- supportApp/GraphicsMagickSrc/Magick++/lib/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile index 60d78e04..43c58d6a 100644 --- a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile +++ b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile @@ -8,23 +8,30 @@ ifeq ($(WITH_GRAPHICSMAGICK),YES) ifeq (windows-x64, $(findstring windows-x64, $(T_A))) USR_CXXFLAGS_WIN32 += -DWIN64 + USR_CFLAGS_WIN32 += -DWIN64 endif ifeq (win32-x86, $(findstring win32-x86, $(T_A))) USR_CXXFLAGS_WIN32 += -DWIN32 + USR_CFLAGS_WIN32 += -DWIN32 endif USR_CXXFLAGS_WIN32 += -D_VISUALC_ + USR_CFLAGS_WIN32 += -D_VISUALC_ ifeq ($(SHARED_LIBRARIES),YES) USR_CXXFLAGS_WIN32 += -D_DLL + USR_CFLAGS_WIN32 += -D_DLL USR_CXXFLAGS_WIN32 += -D_MAGICKDLL_ + USR_CFLAGS_WIN32 += -D_MAGICKDLL_ else USR_CXXFLAGS_WIN32 += -D_LIB + USR_CFLAGS_WIN32 += -D_LIB endif ifeq ($(GRAPHICSMAGICK_PREFIX_SYMBOLS),YES) USR_CXXFLAGS += -DPREFIX_MAGICK_SYMBOLS + USR_CFLAGS += -DPREFIX_MAGICK_SYMBOLS endif USR_INCLUDES += -I$(TOP)/supportApp/GraphicsMagickSrc From c706760e247e6e091d2895b14d36a4b2880a63a1 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Thu, 19 May 2022 11:41:31 +0100 Subject: [PATCH 04/10] Reverted undesired changes - these did not help. --- supportApp/GraphicsMagickSrc/Magick++/lib/Makefile | 7 ------- supportApp/GraphicsMagickSrc/magick/magick.c | 2 +- supportApp/GraphicsMagickSrc/magick/nt_base.c | 4 +--- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile index 43c58d6a..60d78e04 100644 --- a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile +++ b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile @@ -8,30 +8,23 @@ ifeq ($(WITH_GRAPHICSMAGICK),YES) ifeq (windows-x64, $(findstring windows-x64, $(T_A))) USR_CXXFLAGS_WIN32 += -DWIN64 - USR_CFLAGS_WIN32 += -DWIN64 endif ifeq (win32-x86, $(findstring win32-x86, $(T_A))) USR_CXXFLAGS_WIN32 += -DWIN32 - USR_CFLAGS_WIN32 += -DWIN32 endif USR_CXXFLAGS_WIN32 += -D_VISUALC_ - USR_CFLAGS_WIN32 += -D_VISUALC_ ifeq ($(SHARED_LIBRARIES),YES) USR_CXXFLAGS_WIN32 += -D_DLL - USR_CFLAGS_WIN32 += -D_DLL USR_CXXFLAGS_WIN32 += -D_MAGICKDLL_ - USR_CFLAGS_WIN32 += -D_MAGICKDLL_ else USR_CXXFLAGS_WIN32 += -D_LIB - USR_CFLAGS_WIN32 += -D_LIB endif ifeq ($(GRAPHICSMAGICK_PREFIX_SYMBOLS),YES) USR_CXXFLAGS += -DPREFIX_MAGICK_SYMBOLS - USR_CFLAGS += -DPREFIX_MAGICK_SYMBOLS endif USR_INCLUDES += -I$(TOP)/supportApp/GraphicsMagickSrc diff --git a/supportApp/GraphicsMagickSrc/magick/magick.c b/supportApp/GraphicsMagickSrc/magick/magick.c index 590d8b41..ad0fb6ff 100644 --- a/supportApp/GraphicsMagickSrc/magick/magick.c +++ b/supportApp/GraphicsMagickSrc/magick/magick.c @@ -1178,7 +1178,7 @@ InitializeMagick(const char *path) MinimumCoderClass=PrimaryCoderClass; } -#if defined(MSWINDOWS) && !defined(__MINGW32__) +#if defined(MSWINDOWS) NTInitializeExceptionHandlers(); /* WIN32 Exceptions */ #endif /* defined(MSWINDOWS) */ InitializeMagickSignalHandlers(); /* Signal handlers */ diff --git a/supportApp/GraphicsMagickSrc/magick/nt_base.c b/supportApp/GraphicsMagickSrc/magick/nt_base.c index a5b9b03f..0e70ee17 100644 --- a/supportApp/GraphicsMagickSrc/magick/nt_base.c +++ b/supportApp/GraphicsMagickSrc/magick/nt_base.c @@ -398,7 +398,6 @@ MagickExport MagickBool IsWindows95() % % */ -#ifndef __MINGW32__ static LONG WINAPI MagickUnhandledExceptionFilter(struct _EXCEPTION_POINTERS *info) { @@ -641,8 +640,7 @@ NTInitializeExceptionHandlers() SEM_NOOPENFILEERRORBOX); (void) SetUnhandledExceptionFilter(MagickUnhandledExceptionFilter); } -#endif // __MINGW32__ - + #if !defined(HasLTDL) /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% From 1b5b589b560b90fb37d152ed7440aef4162119b5 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Thu, 19 May 2022 16:55:57 +0100 Subject: [PATCH 05/10] Need to define XMLPUBFUN __declspec(dllimport) for DLL importing builds. There's no need for any difference between Visual Studio and MingW build defines. --- .../xml2Src/os/default/libxml/xmlexports.h | 34 ++----------------- supportApp/xml2Src/xmllint.c | 1 + 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/supportApp/xml2Src/os/default/libxml/xmlexports.h b/supportApp/xml2Src/os/default/libxml/xmlexports.h index 2c79f814..99b1f317 100644 --- a/supportApp/xml2Src/os/default/libxml/xmlexports.h +++ b/supportApp/xml2Src/os/default/libxml/xmlexports.h @@ -51,7 +51,7 @@ /** DOC_DISABLE */ /* Windows platform with MS compiler */ -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) && (defined(_MSC_VER) || defined(__MINGW32__)) #undef XMLPUBFUN #undef XMLPUBVAR #undef XMLCALL @@ -60,10 +60,11 @@ #define XMLPUBFUN __declspec(dllexport) #define XMLPUBVAR __declspec(dllexport) #else - #define XMLPUBFUN #if !defined(LIBXML_STATIC) #define XMLPUBVAR __declspec(dllimport) extern + #define XMLPUBFUN __declspec(dllimport) #else + #define XMLPUBFUN #define XMLPUBVAR extern #endif #endif @@ -102,35 +103,6 @@ #endif #endif -/* Windows platform with GNU compiler (Mingw) */ -#if defined(_WIN32) && defined(__MINGW32__) - #undef XMLPUBFUN - #undef XMLPUBVAR - #undef XMLCALL - #undef XMLCDECL - /* - * if defined(IN_LIBXML) this raises problems on mingw with msys - * _imp__xmlFree listed as missing. Try to workaround the problem - * by also making that declaration when compiling client code. - */ - #if defined(IN_LIBXML) && !defined(LIBXML_STATIC) - #define XMLPUBFUN __declspec(dllexport) - #define XMLPUBVAR __declspec(dllexport) extern - #else - #define XMLPUBFUN - #if !defined(LIBXML_STATIC) - #define XMLPUBVAR __declspec(dllimport) extern - #else - #define XMLPUBVAR extern - #endif - #endif - #define XMLCALL __cdecl - #define XMLCDECL __cdecl - #if !defined _REENTRANT - #define _REENTRANT - #endif -#endif - /* Cygwin platform, GNU compiler */ #if defined(_WIN32) && defined(__CYGWIN__) #undef XMLPUBFUN diff --git a/supportApp/xml2Src/xmllint.c b/supportApp/xml2Src/xmllint.c index 67f7adb2..79ac0159 100644 --- a/supportApp/xml2Src/xmllint.c +++ b/supportApp/xml2Src/xmllint.c @@ -6,6 +6,7 @@ * daniel@veillard.com */ +#define IN_LIBXML #include "libxml.h" #include From 72530632c603f20c63ff93aaf2ed2f828234ff35 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Mon, 23 May 2022 16:38:09 +0100 Subject: [PATCH 06/10] Allow multiple symbol defs for mingw builds. --- supportApp/GraphicsMagickSrc/Magick++/lib/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile index 60d78e04..d3d26c27 100644 --- a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile +++ b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile @@ -26,6 +26,10 @@ ifeq ($(WITH_GRAPHICSMAGICK),YES) ifeq ($(GRAPHICSMAGICK_PREFIX_SYMBOLS),YES) USR_CXXFLAGS += -DPREFIX_MAGICK_SYMBOLS endif + ifeq (mingw, $(findstring mingw, $(T_A))) + # multiple definition of `_Unwind_Resume on Linux. I don't know how to fix it. + USR_LDFLAGS += -Wl,-allow-multiple-definition + endif USR_INCLUDES += -I$(TOP)/supportApp/GraphicsMagickSrc USR_INCLUDES += -I$(TOP)/supportApp/GraphicsMagickSrc/lcms/include From ab5b0e560864bdc892dbfa564dcde684d905e4d4 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Mon, 30 May 2022 14:29:57 +0100 Subject: [PATCH 07/10] __GNUC__ is #defined when building with mingw. But we still want to use win32/pthread --- supportApp/bloscSrc/blosc/blosc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supportApp/bloscSrc/blosc/blosc.c b/supportApp/bloscSrc/blosc/blosc.c index d858c517..6d82fb19 100644 --- a/supportApp/bloscSrc/blosc/blosc.c +++ b/supportApp/bloscSrc/blosc/blosc.c @@ -54,7 +54,7 @@ #include #endif /* _WIN32 */ -#if defined(_WIN32) && !defined(__GNUC__) +#if defined(_WIN32) #include "win32/pthread.h" #include "win32/pthread.c" #else From 219f3f719deb333f29c883ad7fb836389dc4c6ad Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Mon, 30 May 2022 16:24:39 +0100 Subject: [PATCH 08/10] Don't need builds directory. Can we build using Win32 (rather than posix) model and not get multiply-defined symbols? --- .../GraphicsMagickSrc/Magick++/lib/Makefile | 2 +- .../GraphicsMagickSrc/ttf/builds/Makefile | 6 - .../ttf/builds/windows/Makefile | 12 - .../ttf/builds/windows/ftdebug.c | 237 ------------------ 4 files changed, 1 insertion(+), 256 deletions(-) delete mode 100644 supportApp/GraphicsMagickSrc/ttf/builds/Makefile delete mode 100644 supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile delete mode 100644 supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c diff --git a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile index d3d26c27..236e1bdb 100644 --- a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile +++ b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile @@ -28,7 +28,7 @@ ifeq ($(WITH_GRAPHICSMAGICK),YES) endif ifeq (mingw, $(findstring mingw, $(T_A))) # multiple definition of `_Unwind_Resume on Linux. I don't know how to fix it. - USR_LDFLAGS += -Wl,-allow-multiple-definition + # USR_LDFLAGS += -Wl,-allow-multiple-definition endif USR_INCLUDES += -I$(TOP)/supportApp/GraphicsMagickSrc diff --git a/supportApp/GraphicsMagickSrc/ttf/builds/Makefile b/supportApp/GraphicsMagickSrc/ttf/builds/Makefile deleted file mode 100644 index 33fd399f..00000000 --- a/supportApp/GraphicsMagickSrc/ttf/builds/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configure/CONFIG - -DIRS += windows - -include $(TOP)/configure/RULES_DIRS diff --git a/supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile b/supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile deleted file mode 100644 index 9f4466a7..00000000 --- a/supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TOP = ../../../../.. -include $(TOP)/configure/CONFIG - -ifeq ($(WITH_GRAPHICSMAGICK),YES) - ifeq ($(GRAPHICSMAGICK_EXTERNAL),NO) - - LIB_SRCS_WIN32 += ftdebug.c - - endif # ($(GRAPHICSMAGICK_EXTERNAL),NO) -endif # ($(WITH_GRAPHICSMAGICK),YES) - -include $(TOP)/configure/RULES diff --git a/supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c b/supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c deleted file mode 100644 index 09c3b65a..00000000 --- a/supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c +++ /dev/null @@ -1,237 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftdebug.c */ -/* */ -/* Debugging and logging component for Win32 (body). */ -/* */ -/* Copyright 1996-2015 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This component contains various macros and functions used to ease the */ - /* debugging of the FreeType engine. Its main purpose is in assertion */ - /* checking, tracing, and error detection. */ - /* */ - /* There are now three debugging modes: */ - /* */ - /* - trace mode */ - /* */ - /* Error and trace messages are sent to the log file (which can be the */ - /* standard error output). */ - /* */ - /* - error mode */ - /* */ - /* Only error messages are generated. */ - /* */ - /* - release mode: */ - /* */ - /* No error message is sent or generated. The code is free from any */ - /* debugging parts. */ - /* */ - /*************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H - - -#ifdef FT_DEBUG_LEVEL_ERROR - -#include -#include -#include - -#include - - - /* documentation is in ftdebug.h */ - - FT_BASE_DEF( void ) - FT_Message( const char* fmt, - ... ) - { - static char buf[8192]; - va_list ap; - - - va_start( ap, fmt ); - vprintf( fmt, ap ); - /* send the string to the debugger as well */ - vsprintf( buf, fmt, ap ); - OutputDebugStringA( buf ); - va_end( ap ); - } - - - /* documentation is in ftdebug.h */ - - FT_BASE_DEF( void ) - FT_Panic( const char* fmt, - ... ) - { - static char buf[8192]; - va_list ap; - - - va_start( ap, fmt ); - vsprintf( buf, fmt, ap ); - OutputDebugStringA( buf ); - va_end( ap ); - - exit( EXIT_FAILURE ); - } - - - /* documentation is in ftdebug.h */ - - FT_BASE_DEF( int ) - FT_Throw( FT_Error error, - int line, - const char* file ) - { - FT_UNUSED( error ); - FT_UNUSED( line ); - FT_UNUSED( file ); - - return 0; - } - - -#ifdef FT_DEBUG_LEVEL_TRACE - - - /* array of trace levels, initialized to 0 */ - int ft_trace_levels[trace_count]; - - /* define array of trace toggle names */ -#define FT_TRACE_DEF( x ) #x , - - static const char* ft_trace_toggles[trace_count + 1] = - { -#include FT_INTERNAL_TRACE_H - NULL - }; - -#undef FT_TRACE_DEF - - - /*************************************************************************/ - /* */ - /* Initialize the tracing sub-system. This is done by retrieving the */ - /* value of the "FT2_DEBUG" environment variable. It must be a list of */ - /* toggles, separated by spaces, `;' or `,'. Example: */ - /* */ - /* "any:3 memory:6 stream:5" */ - /* */ - /* This will request that all levels be set to 3, except the trace level */ - /* for the memory and stream components which are set to 6 and 5, */ - /* respectively. */ - /* */ - /* See the file `include/freetype/internal/fttrace.h' for details of the */ - /* available toggle names. */ - /* */ - /* The level must be between 0 and 6; 0 means quiet (except for serious */ - /* runtime errors), and 6 means _very_ verbose. */ - /* */ - FT_BASE_DEF( void ) - ft_debug_init( void ) - { - const char* ft2_debug = getenv( "FT2_DEBUG" ); - - - if ( ft2_debug ) - { - const char* p = ft2_debug; - const char* q; - - - for ( ; *p; p++ ) - { - /* skip leading whitespace and separators */ - if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' ) - continue; - - /* read toggle name, followed by ':' */ - q = p; - while ( *p && *p != ':' ) - p++; - - if ( !*p ) - break; - - if ( *p == ':' && p > q ) - { - int n, i, len = (int)( p - q ); - int level = -1, found = -1; - - - for ( n = 0; n < trace_count; n++ ) - { - const char* toggle = ft_trace_toggles[n]; - - - for ( i = 0; i < len; i++ ) - { - if ( toggle[i] != q[i] ) - break; - } - - if ( i == len && toggle[i] == 0 ) - { - found = n; - break; - } - } - - /* read level */ - p++; - if ( *p ) - { - level = *p - '0'; - if ( level < 0 || level > 7 ) - level = -1; - } - - if ( found >= 0 && level >= 0 ) - { - if ( found == trace_any ) - { - /* special case for "any" */ - for ( n = 0; n < trace_count; n++ ) - ft_trace_levels[n] = level; - } - else - ft_trace_levels[found] = level; - } - } - } - } - } - - -#else /* !FT_DEBUG_LEVEL_TRACE */ - - - FT_BASE_DEF( void ) - ft_debug_init( void ) - { - /* nothing */ - } - - -#endif /* !FT_DEBUG_LEVEL_TRACE */ - -#endif /* FT_DEBUG_LEVEL_ERROR */ - - -/* END */ From 975be1937300272019f7f90839b3920cb5f3d456 Mon Sep 17 00:00:00 2001 From: "Heesterman, Peter J" Date: Mon, 30 May 2022 17:30:27 +0100 Subject: [PATCH 09/10] Yes, we still need the force:multiple. --- supportApp/GraphicsMagickSrc/Magick++/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile index 236e1bdb..d3d26c27 100644 --- a/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile +++ b/supportApp/GraphicsMagickSrc/Magick++/lib/Makefile @@ -28,7 +28,7 @@ ifeq ($(WITH_GRAPHICSMAGICK),YES) endif ifeq (mingw, $(findstring mingw, $(T_A))) # multiple definition of `_Unwind_Resume on Linux. I don't know how to fix it. - # USR_LDFLAGS += -Wl,-allow-multiple-definition + USR_LDFLAGS += -Wl,-allow-multiple-definition endif USR_INCLUDES += -I$(TOP)/supportApp/GraphicsMagickSrc From 121173cc9aa439913e2a03e316a859001c2159b4 Mon Sep 17 00:00:00 2001 From: Peter Heesterman Date: Sat, 9 Aug 2025 14:20:39 +0100 Subject: [PATCH 10/10] Revert "Don't need builds directory." This reverts commit 219f3f719deb333f29c883ad7fb836389dc4c6ad. --- .../GraphicsMagickSrc/ttf/builds/Makefile | 6 + .../ttf/builds/windows/Makefile | 12 + .../ttf/builds/windows/ftdebug.c | 237 ++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 supportApp/GraphicsMagickSrc/ttf/builds/Makefile create mode 100644 supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile create mode 100644 supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c diff --git a/supportApp/GraphicsMagickSrc/ttf/builds/Makefile b/supportApp/GraphicsMagickSrc/ttf/builds/Makefile new file mode 100644 index 00000000..33fd399f --- /dev/null +++ b/supportApp/GraphicsMagickSrc/ttf/builds/Makefile @@ -0,0 +1,6 @@ +TOP = ../../../.. +include $(TOP)/configure/CONFIG + +DIRS += windows + +include $(TOP)/configure/RULES_DIRS diff --git a/supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile b/supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile new file mode 100644 index 00000000..9f4466a7 --- /dev/null +++ b/supportApp/GraphicsMagickSrc/ttf/builds/windows/Makefile @@ -0,0 +1,12 @@ +TOP = ../../../../.. +include $(TOP)/configure/CONFIG + +ifeq ($(WITH_GRAPHICSMAGICK),YES) + ifeq ($(GRAPHICSMAGICK_EXTERNAL),NO) + + LIB_SRCS_WIN32 += ftdebug.c + + endif # ($(GRAPHICSMAGICK_EXTERNAL),NO) +endif # ($(WITH_GRAPHICSMAGICK),YES) + +include $(TOP)/configure/RULES diff --git a/supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c b/supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c new file mode 100644 index 00000000..09c3b65a --- /dev/null +++ b/supportApp/GraphicsMagickSrc/ttf/builds/windows/ftdebug.c @@ -0,0 +1,237 @@ +/***************************************************************************/ +/* */ +/* ftdebug.c */ +/* */ +/* Debugging and logging component for Win32 (body). */ +/* */ +/* Copyright 1996-2015 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This component contains various macros and functions used to ease the */ + /* debugging of the FreeType engine. Its main purpose is in assertion */ + /* checking, tracing, and error detection. */ + /* */ + /* There are now three debugging modes: */ + /* */ + /* - trace mode */ + /* */ + /* Error and trace messages are sent to the log file (which can be the */ + /* standard error output). */ + /* */ + /* - error mode */ + /* */ + /* Only error messages are generated. */ + /* */ + /* - release mode: */ + /* */ + /* No error message is sent or generated. The code is free from any */ + /* debugging parts. */ + /* */ + /*************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H + + +#ifdef FT_DEBUG_LEVEL_ERROR + +#include +#include +#include + +#include + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Message( const char* fmt, + ... ) + { + static char buf[8192]; + va_list ap; + + + va_start( ap, fmt ); + vprintf( fmt, ap ); + /* send the string to the debugger as well */ + vsprintf( buf, fmt, ap ); + OutputDebugStringA( buf ); + va_end( ap ); + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( void ) + FT_Panic( const char* fmt, + ... ) + { + static char buf[8192]; + va_list ap; + + + va_start( ap, fmt ); + vsprintf( buf, fmt, ap ); + OutputDebugStringA( buf ); + va_end( ap ); + + exit( EXIT_FAILURE ); + } + + + /* documentation is in ftdebug.h */ + + FT_BASE_DEF( int ) + FT_Throw( FT_Error error, + int line, + const char* file ) + { + FT_UNUSED( error ); + FT_UNUSED( line ); + FT_UNUSED( file ); + + return 0; + } + + +#ifdef FT_DEBUG_LEVEL_TRACE + + + /* array of trace levels, initialized to 0 */ + int ft_trace_levels[trace_count]; + + /* define array of trace toggle names */ +#define FT_TRACE_DEF( x ) #x , + + static const char* ft_trace_toggles[trace_count + 1] = + { +#include FT_INTERNAL_TRACE_H + NULL + }; + +#undef FT_TRACE_DEF + + + /*************************************************************************/ + /* */ + /* Initialize the tracing sub-system. This is done by retrieving the */ + /* value of the "FT2_DEBUG" environment variable. It must be a list of */ + /* toggles, separated by spaces, `;' or `,'. Example: */ + /* */ + /* "any:3 memory:6 stream:5" */ + /* */ + /* This will request that all levels be set to 3, except the trace level */ + /* for the memory and stream components which are set to 6 and 5, */ + /* respectively. */ + /* */ + /* See the file `include/freetype/internal/fttrace.h' for details of the */ + /* available toggle names. */ + /* */ + /* The level must be between 0 and 6; 0 means quiet (except for serious */ + /* runtime errors), and 6 means _very_ verbose. */ + /* */ + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + const char* ft2_debug = getenv( "FT2_DEBUG" ); + + + if ( ft2_debug ) + { + const char* p = ft2_debug; + const char* q; + + + for ( ; *p; p++ ) + { + /* skip leading whitespace and separators */ + if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' ) + continue; + + /* read toggle name, followed by ':' */ + q = p; + while ( *p && *p != ':' ) + p++; + + if ( !*p ) + break; + + if ( *p == ':' && p > q ) + { + int n, i, len = (int)( p - q ); + int level = -1, found = -1; + + + for ( n = 0; n < trace_count; n++ ) + { + const char* toggle = ft_trace_toggles[n]; + + + for ( i = 0; i < len; i++ ) + { + if ( toggle[i] != q[i] ) + break; + } + + if ( i == len && toggle[i] == 0 ) + { + found = n; + break; + } + } + + /* read level */ + p++; + if ( *p ) + { + level = *p - '0'; + if ( level < 0 || level > 7 ) + level = -1; + } + + if ( found >= 0 && level >= 0 ) + { + if ( found == trace_any ) + { + /* special case for "any" */ + for ( n = 0; n < trace_count; n++ ) + ft_trace_levels[n] = level; + } + else + ft_trace_levels[found] = level; + } + } + } + } + } + + +#else /* !FT_DEBUG_LEVEL_TRACE */ + + + FT_BASE_DEF( void ) + ft_debug_init( void ) + { + /* nothing */ + } + + +#endif /* !FT_DEBUG_LEVEL_TRACE */ + +#endif /* FT_DEBUG_LEVEL_ERROR */ + + +/* END */