Merge branch 'modplug-gh' into 'master'

contrib: modplug: update to newer Github version

See merge request videolan/vlc!3825
This commit is contained in:
Steve Lhomme 2024-04-28 07:10:52 +00:00
commit 16f9a83a67
12 changed files with 375 additions and 49 deletions

View File

@ -0,0 +1,28 @@
From b34692aeb907d47d4c898c67b03b32c37e3d2dba Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 14 Jun 2023 09:20:07 +0200
Subject: [PATCH] Define WAVE_FORMAT_PCM when it's not defined
When compiling for UWP it's not defined. We could force a DESKTOP build
but it's cleaner to just redefine this common value.
---
src/load_wav.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/load_wav.cpp b/src/load_wav.cpp
index 48de613..b6eed5a 100644
--- a/src/load_wav.cpp
+++ b/src/load_wav.cpp
@@ -10,6 +10,9 @@
#ifndef WAVE_FORMAT_EXTENSIBLE
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
#endif
+#ifndef WAVE_FORMAT_PCM
+#define WAVE_FORMAT_PCM 1
+#endif
/////////////////////////////////////////////////////////////
// WAV file support
--
2.37.3.windows.1

View File

@ -0,0 +1,26 @@
From 9fd72f6f6ac9897a6ea252390ed7fd376ad50a69 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 14 Jun 2023 09:15:15 +0200
Subject: [PATCH 1/4] Fix bogus cast into potential WCHAR string
It will be the case when compiling with UNICODE.
---
src/load_amf.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/load_amf.cpp b/src/load_amf.cpp
index 89876af..c826c96 100644
--- a/src/load_amf.cpp
+++ b/src/load_amf.cpp
@@ -171,7 +171,7 @@ BOOL CSoundFile::ReadAMF(LPCBYTE lpStream, const DWORD dwMemLength)
DWORD dwMemPos;
if ((!lpStream) || (dwMemLength < 2048)) return FALSE;
- if ((!strncmp((LPCTSTR)lpStream, "ASYLUM Music Format V1.0", 25)) && (dwMemLength > 4096))
+ if ((!strncmp((LPCSTR)lpStream, "ASYLUM Music Format V1.0", 25)) && (dwMemLength > 4096))
{
UINT numorders, numpats, numsamples;
--
2.37.3.windows.1

View File

@ -0,0 +1,26 @@
From 687d2f6b1e92d13eeb2e5d08b238f6821bae3ade Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 26 Jun 2023 09:50:04 +0200
Subject: [PATCH] Fix libm detection when compiling with Android CMake
toolchain
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9fd20d..f43526f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ include_directories(AFTER
${PROJECT_BINARY_DIR}
)
-if(UNIX AND NOT APPLE)
+if((UNIX OR ANDROID) AND NOT APPLE)
find_library(MATH_LIB m)
if(MATH_LIB)
set(CMAKE_REQUIRED_LIBRARIES m)
--
2.37.3.windows.1

View File

@ -0,0 +1,91 @@
From f82fc2f44bbc497f8a6b5baa62bd82e4256969f0 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 14 Jun 2023 09:17:09 +0200
Subject: [PATCH 2/4] replace lstrcpyn with strncpy
This is the define used on other platforms.
---
src/libmodplug/sndfile.h | 2 +-
src/load_it.cpp | 2 +-
src/load_med.cpp | 4 ++--
src/load_ptm.cpp | 2 +-
src/sndfile.cpp | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/libmodplug/sndfile.h b/src/libmodplug/sndfile.h
index 1888500..6298d40 100644
--- a/src/libmodplug/sndfile.h
+++ b/src/libmodplug/sndfile.h
@@ -613,7 +613,7 @@ public:
UINT GetMaxPosition() const;
void SetCurrentPos(UINT nPos);
void SetCurrentOrder(UINT nOrder);
- void GetTitle(LPSTR s) const { lstrcpyn(s,m_szNames[0],32); }
+ void GetTitle(LPSTR s) const { strncpy(s,m_szNames[0],32); }
LPCSTR GetTitle() const { return m_szNames[0]; }
UINT GetSampleName(UINT nSample,LPSTR s=NULL) const;
UINT GetInstrumentName(UINT nInstr,LPSTR s=NULL) const;
diff --git a/src/load_it.cpp b/src/load_it.cpp
index 45fa8e4..a87343b 100644
--- a/src/load_it.cpp
+++ b/src/load_it.cpp
@@ -624,7 +624,7 @@ BOOL CSoundFile::SaveIT(LPCSTR lpszFileName, UINT nPacking)
dwPatNamLen = 0;
dwChnNamLen = 0;
header.id = 0x4D504D49; // IMPM
- lstrcpyn((char *)header.songname, m_szNames[0], 27);
+ strncpy((char *)header.songname, m_szNames[0], 27);
header.reserved1 = 0x1004;
header.ordnum = 0;
while ((header.ordnum < MAX_ORDERS) && (Order[header.ordnum] < 0xFF)) header.ordnum++;
diff --git a/src/load_med.cpp b/src/load_med.cpp
index e5b3076..5248939 100644
--- a/src/load_med.cpp
+++ b/src/load_med.cpp
@@ -737,7 +737,7 @@ BOOL CSoundFile::ReadMed(const BYTE *lpStream, DWORD dwMemLength)
if (maxnamelen > 32) maxnamelen = 32;
for (UINT i=0; i<ientries; i++) if (i < m_nSamples)
{
- lstrcpyn(m_szNames[i+1], psznames + i*ientrysz, maxnamelen);
+ strncpy(m_szNames[i+1], psznames + i*ientrysz, maxnamelen);
m_szNames[i+1][31] = '\0';
}
}
@@ -768,7 +768,7 @@ BOOL CSoundFile::ReadMed(const BYTE *lpStream, DWORD dwMemLength)
if (trknamelen > MAX_CHANNELNAME) trknamelen = MAX_CHANNELNAME;
if ((trknameofs) && (trknamelen < dwMemLength) && (trknameofs < dwMemLength - trknamelen))
{
- lstrcpyn(ChnSettings[i].szName, (LPCSTR)(lpStream+trknameofs), trknamelen);
+ strncpy(ChnSettings[i].szName, (LPCSTR)(lpStream+trknameofs), trknamelen);
ChnSettings[i].szName[MAX_CHANNELNAME-1] = '\0';
}
}
diff --git a/src/load_ptm.cpp b/src/load_ptm.cpp
index 0ace71a..fa4d300 100644
--- a/src/load_ptm.cpp
+++ b/src/load_ptm.cpp
@@ -109,7 +109,7 @@ BOOL CSoundFile::ReadPTM(const BYTE *lpStream, DWORD dwMemLength)
MODINSTRUMENT *pins = &Ins[ismp+1];
PTMSAMPLE *psmp = (PTMSAMPLE *)(lpStream+dwMemPos);
- lstrcpyn(m_szNames[ismp+1], psmp->samplename, 28);
+ strncpy(m_szNames[ismp+1], psmp->samplename, 28);
memcpy(pins->name, psmp->filename, 12);
pins->name[12] = 0;
pins->nGlobalVol = 64;
diff --git a/src/sndfile.cpp b/src/sndfile.cpp
index 24550de..d24d24c 100644
--- a/src/sndfile.cpp
+++ b/src/sndfile.cpp
@@ -1789,7 +1789,7 @@ BOOL CSoundFile::SetPatternName(UINT nPat, LPCSTR lpszName)
if (nPat >= MAX_PATTERNS) return FALSE;
if (lpszName == NULL) return(FALSE);
- if (lpszName) lstrcpyn(szName, lpszName, MAX_PATTERNNAME);
+ if (lpszName) strncpy(szName, lpszName, MAX_PATTERNNAME);
szName[MAX_PATTERNNAME-1] = 0;
if (!m_lpszPatternNames) m_nPatternNames = 0;
if (nPat >= m_nPatternNames)
--
2.37.3.windows.1

View File

@ -0,0 +1,64 @@
From 5361f3db7e333b10191def8a834303a8429cd5c7 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 14 Jun 2023 09:18:01 +0200
Subject: [PATCH 3/4] replace lstrcpy with strcpy
This is the define used on other platforms.
---
src/load_mod.cpp | 2 +-
src/load_xm.cpp | 2 +-
src/sndfile.cpp | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/load_mod.cpp b/src/load_mod.cpp
index 4b64b23..9ea48c8 100644
--- a/src/load_mod.cpp
+++ b/src/load_mod.cpp
@@ -469,7 +469,7 @@ BOOL CSoundFile::SaveMod(LPCSTR lpszFileName, UINT nPacking)
fwrite(ord, 128, 1, f);
// Writing signature
if (m_nChannels == 4)
- lstrcpy((LPSTR)&bTab, "M.K.");
+ strcpy((LPSTR)&bTab, "M.K.");
else
wsprintf((LPSTR)&bTab, "%luCHN", m_nChannels);
fwrite(bTab, 4, 1, f);
diff --git a/src/load_xm.cpp b/src/load_xm.cpp
index 4d5a493..266ca6b 100644
--- a/src/load_xm.cpp
+++ b/src/load_xm.cpp
@@ -610,7 +610,7 @@ BOOL CSoundFile::SaveXM(LPCSTR lpszFileName, UINT nPacking)
fwrite("Extended Module: ", 17, 1, f);
fwrite(m_szNames[0], 20, 1, f);
s[0] = 0x1A;
- lstrcpy((LPSTR)&s[1], (nPacking) ? "MOD Plugin packed " : "FastTracker v2.00 ");
+ strcpy((LPSTR)&s[1], (nPacking) ? "MOD Plugin packed " : "FastTracker v2.00 ");
s[21] = 0x04;
s[22] = 0x01;
fwrite(s, 23, 1, f);
diff --git a/src/sndfile.cpp b/src/sndfile.cpp
index d24d24c..5a1096d 100644
--- a/src/sndfile.cpp
+++ b/src/sndfile.cpp
@@ -376,12 +376,12 @@ void CSoundFile::ResetMidiCfg()
//-----------------------------
{
memset(&m_MidiCfg, 0, sizeof(m_MidiCfg));
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_START*32], "FF");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_STOP*32], "FC");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON*32], "9c n v");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF*32], "9c n 0");
- lstrcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p");
- lstrcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z");
+ strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_START*32], "FF");
+ strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_STOP*32], "FC");
+ strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON*32], "9c n v");
+ strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF*32], "9c n 0");
+ strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p");
+ strcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z");
for (int iz=0; iz<16; iz++) wsprintf(&m_MidiCfg.szMidiZXXExt[iz*32], "F0F001%02X", iz*8);
}
--
2.37.3.windows.1

View File

@ -0,0 +1,42 @@
From 42d228e2e9d506328495c9daab45ff1e2fd46cc6 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 26 Jun 2023 09:35:09 +0200
Subject: [PATCH 4/4] replace wsprintf with snprintf
wsprintf is deprecated and not allowed in Universal Windows Platform builds.
It can be replaced by StringCbPrintfA but it requires strsafe.h. We can
just use snprintf() which is the C runtime equivalent.
---
src/load_mod.cpp | 2 +-
src/sndfile.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/load_mod.cpp b/src/load_mod.cpp
index 9ea48c8..98be525 100644
--- a/src/load_mod.cpp
+++ b/src/load_mod.cpp
@@ -471,7 +471,7 @@ BOOL CSoundFile::SaveMod(LPCSTR lpszFileName, UINT nPacking)
if (m_nChannels == 4)
strcpy((LPSTR)&bTab, "M.K.");
else
- wsprintf((LPSTR)&bTab, "%luCHN", m_nChannels);
+ snprintf(LPSTR)&bTab, sizeof(bTab), "%luCHN", m_nChannels);
fwrite(bTab, 4, 1, f);
// Writing patterns
for (UINT ipat=0; ipat<nbp; ipat++) if (Patterns[ipat])
diff --git a/src/sndfile.cpp b/src/sndfile.cpp
index 5a1096d..4784752 100644
--- a/src/sndfile.cpp
+++ b/src/sndfile.cpp
@@ -382,7 +382,7 @@ void CSoundFile::ResetMidiCfg()
strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF*32], "9c n 0");
strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p");
strcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z");
- for (int iz=0; iz<16; iz++) wsprintf(&m_MidiCfg.szMidiZXXExt[iz*32], "F0F001%02X", iz*8);
+ for (int iz=0; iz<16; iz++) snprintf(&m_MidiCfg.szMidiZXXExt[iz*32], sizeof(m_MidiCfg.szMidiZXXExt), "F0F001%02X", iz*8);
}
--
2.37.3.windows.1

View File

@ -1,12 +0,0 @@
--- ./configure.ac.orig 2019-10-11 12:40:29.000000000 +0200
+++ ./configure.ac 2019-10-11 12:40:50.000000000 +0200
@@ -21,7 +21,9 @@ AC_DISABLE_STATIC([])
AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
+AC_LANG_PUSH([C])
AC_C_BIGENDIAN
+AC_LANG_POP([C])
#AC_LIBTOOL_WIN32_DLL
#AC_PROG_LIBTOOL

View File

@ -1,9 +1,24 @@
--- libmodplug-0.8.9.0/libmodplug.pc.in.old 2020-04-29 21:39:14.000000000 +0200
+++ libmodplug-0.8.9.0/libmodplug.pc.in 2020-04-29 21:40:06.000000000 +0200
@@ -8,5 +8,5 @@
From 41cb3263b1d72cfa9810d9b9dde560fbcacd62b0 Mon Sep 17 00:00:00 2001
From: David Fuhrmann <dfuhrmann@videolan.org>
Date: Wed, 13 May 2020 19:42:15 +0200
Subject: [PATCH] Link against libc++ on macOS
libstdc++ is not available anymore in modern sdks.
---
libmodplug.pc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmodplug.pc.in b/libmodplug.pc.in
index 9cc88a5..b33b415 100644
--- a/libmodplug.pc.in
+++ b/libmodplug.pc.in
@@ -8,5 +8,5 @@ Description: The ModPlug mod file playing library.
Version: @VERSION@
Requires:
Libs: -L${libdir} -lmodplug
-Libs.private: -lstdc++ -lm
+Libs.private: -lc++ -lm
Cflags: -I${includedir} -DMODPLUG_STATIC
--
2.37.3.windows.1

View File

@ -1,15 +0,0 @@
--- libmodplug/configure.ac.old 2019-08-14 09:18:02.000000000 +0200
+++ libmodplug/configure.ac 2019-08-14 09:18:28.000000000 +0200
@@ -44,12 +44,6 @@
esac
AC_SUBST(LT_LDFLAGS)
-# require 10.5+ for osx/x86_64 builds
-case "$host" in
- x86_64-*-darwin*)
- CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.5"
- LDFLAGS="$LDFLAGS -mmacosx-version-min=10.5" ;;
-esac
# symbol visibility
ac_save_CXXFLAGS="$CXXFLAGS"

View File

@ -1,9 +1,64 @@
diff -rupN libmodplug-old/libmodplug.pc.in libmodplug-new/libmodplug.pc.in
--- libmodplug-old/libmodplug.pc.in 2013-08-23 09:55:58.000000000 +1000
+++ libmodplug-new/libmodplug.pc.in 2014-06-12 20:59:17.705886752 +1000
From a206c5e0fa753b525cc3583e3514cd74870b13fe Mon Sep 17 00:00:00 2001
From: Konstantinos Tsanaktsidis <kjtsanaktsidis@gmail.com>
Date: Thu, 12 Jun 2014 15:34:46 +0200
Subject: [PATCH] Fix libmod_plugin undefined __imp_ symbols building for win32
When building current HEAD of master for x86_64-w64-mingw32 against current
contribs, compilation fails at libmod_plugin due to undefined symbols of
the form __imp_ModPlug_*. This patch modifies libmodplug in contribs by
adding -DMODPLUG_STATIC to CFlags in the pkg-config file. A bug is also
fixed in the main build system to make sure the CFLAGS are picked up from
this pkg-config file.
This problem occurs because of the following code in
contrib/x86_64-w64-mingw32/include/libmodplug/modplug.h. This code is
present in libmodplug obtained from running "make fetch & make" in the
contribs directory, but not present in the prebuilt contribs obtained from
running "make prebuilt".
#if defined(_WIN32) || defined(__CYGWIN__)
# if defined(MODPLUG_BUILD) && defined(DLL_EXPORT)
# define MODPLUG_EXPORT __declspec(dllexport)
# elif defined(MODPLUG_BUILD) || defined(MODPLUG_STATIC)
# define MODPLUG_EXPORT
# else
# define MODPLUG_EXPORT __declspec(dllimport)
# endif
When building for Windows, if MODPLUG_STATIC is not defined, MODPLUG_EXPORT
is defined as "__declspec(dllimport)". On Windows, dynamic symbols are
prefixed with "__imp_", so this causes GCC to adjust the symbol references
to the libmodplug functions accordingly.
This patch therefore adds a patch to contribs for libmodplug's pkg-config
file. It adds -DMODPLUG_STATIC to CFlags, so that when libmod_plugin is
building it will have the correct symbol names.
However, there is also a bug in the build system that needs to be fixed for
this to work. The configure script sets a CXXFLAGS_mod containing the
output of pkg-config for libmodplug, but not CFLAGS_mod. Additionally, the
Makefile.ac for libmod_plugin sets CXXFLAGS when in fact the relevant files
(mod.c) are plain C. Autotools therefore ignores these CXXFLAGS when
generating a makefile.
The solution is to add a macro to configure.ac to set CFLAGS_mod. This then
needs to be used in modules/demux/Makefile.am to populate
libmod_plugin_la_CFLAGS instead of libmod_plugin_la_CXXFLAGS (which gets
ignored).
---
libmodplug.pc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmodplug.pc.in b/libmodplug.pc.in
index bbf05f9..9cc88a5 100644
--- a/libmodplug.pc.in
+++ b/libmodplug.pc.in
@@ -9,4 +9,4 @@ Version: @VERSION@
Requires:
Libs: -L${libdir} -lmodplug
Libs.private: -lstdc++ -lm
-Cflags: -I${includedir}
+Cflags: -I${includedir} -DMODPLUG_STATIC
--
2.37.3.windows.1

View File

@ -1,5 +1,7 @@
# modplug
MODPLUG_GITURL := $(GITHUB)/Konstanty/libmodplug.git
MODPLUG_HASH := d1b97ed0020bc620a059d3675d1854b40bd2608d
MODPLUG_VERSION := 0.8.9.0
MODPLUG_URL := $(SF)/modplug-xmms/libmodplug-$(MODPLUG_VERSION).tar.gz
@ -8,30 +10,36 @@ ifeq ($(call need_pkg,"libmodplug >= 0.8.9.0"),)
PKGS_FOUND += modplug
endif
MODPLUG_CXXFLAGS := $(CXXFLAGS) -std=gnu++98
$(TARBALLS)/libmodplug-$(MODPLUG_VERSION).tar.gz:
$(call download_pkg,$(MODPLUG_URL),modplug)
.sum-modplug: libmodplug-$(MODPLUG_VERSION).tar.gz
$(TARBALLS)/libmodplug-$(MODPLUG_HASH).tar.xz:
$(call download_git,$(MODPLUG_GITURL),,$(MODPLUG_HASH))
libmodplug: libmodplug-$(MODPLUG_VERSION).tar.gz .sum-modplug
# .sum-modplug: libmodplug-$(MODPLUG_VERSION).tar.gz
.sum-modplug: libmodplug-$(MODPLUG_HASH).tar.xz
$(call check_githash,$(MODPLUG_HASH))
touch $@
libmodplug: libmodplug-$(MODPLUG_HASH).tar.xz .sum-modplug
$(UNPACK)
$(APPLY) $(SRC)/modplug/modplug-win32-static.patch
$(APPLY) $(SRC)/modplug/macosx-do-not-force-min-version.patch
$(APPLY) $(SRC)/modplug/fix-endianness-check.diff
ifdef HAVE_MACOSX
$(APPLY) $(SRC)/modplug/mac-use-c-stdlib.patch
endif
$(APPLY) $(SRC)/modplug/0001-Fix-libm-detection-when-compiling-with-Android-CMake.patch
$(APPLY) $(SRC)/modplug/0001-Define-WAVE_FORMAT_PCM-when-it-s-not-defined.patch
$(APPLY) $(SRC)/modplug/0001-Fix-bogus-cast-into-potential-WCHAR-string.patch
$(APPLY) $(SRC)/modplug/0002-replace-lstrcpyn-with-strncpy.patch
$(APPLY) $(SRC)/modplug/0003-replace-lstrcpy-with-strcpy.patch
$(APPLY) $(SRC)/modplug/0004-replace-wsprintf-with-snprintf.patch
$(call pkg_static,"libmodplug.pc.in")
$(MOVE)
MODPLUG_CONF := CXXFLAGS="$(MODPLUG_CXXFLAGS)"
.modplug: libmodplug
$(RECONF)
$(MAKEBUILDDIR)
$(MAKECONFIGURE) $(MODPLUG_CONF)
+$(MAKEBUILD)
+$(MAKEBUILD) install
.modplug: libmodplug toolchain.cmake
$(CMAKECLEAN)
$(HOSTVARS) $(CMAKE)
+$(CMAKEBUILD)
$(CMAKEINSTALL)
touch $@

View File

@ -206,8 +206,6 @@ if [ ! -z "$BUILD_UCRT" ]; then
if [ ! -z "$WINSTORE" ]; then
CONTRIBFLAGS="$CONTRIBFLAGS --disable-disc --disable-srt --disable-sdl --disable-SDL_image"
# FIXME enable discs ?
# modplug uses GlobalAlloc/Free and lstrcpyA/wsprintfA/lstrcpynA
CONTRIBFLAGS="$CONTRIBFLAGS --disable-modplug"
# gettext uses sys/socket.h improperly
CONTRIBFLAGS="$CONTRIBFLAGS --disable-gettext"
# fontconfig uses GetWindowsDirectory and SHGetFolderPath