Added "Visual Elements" manifest for Windows 8+ "Start" screen tile.
[LameXP.git] / etc / Patches / mpg123-Mingw-w64-WinXP-CompatFix.V2.txt
blobd9148cd22cb03212cea9f1cf65b1c87f0df197f9
1 mpg123 Windows XP compatibility (with MinGW-w64)
2 ================================================
4 The problem:
5 ------------
7 When built with MinGW-w64, mpg123.exe won't run on Windows XP, because it imports "_time32" from "MSVCRT.DLL"
9 ...a function which simply did **not** exist in "MSVCRT.DLL" on Windows XP or Windows XP x64-Edition!
12 The workaround:
13 ---------------
15 In order to fix this problem, it is **extremely** important to add the following compiler option to your CFLAGS:
17 -D__MINGW_USE_VC2005_COMPAT=1
19 This will make your mpg123.exe link against "_time64", which **is** available in "MSVCRT.DLL" on Windows XP.
21 (If you think this "fix" makes no sense at all, then please read the next two sections)
24 Remarks:
25 --------
27 MinGW-w64 links 'time()' from <time.h> against "_time32", **UNLESS** "__MINGW_USE_VC2005_COMPAT" is defined!
29 Note the "UNLESS" in the above sentence - where you certainly would have expected an "IF AND ONLY IF".
31 So, confusingly, the "__MINGW_USE_VC2005_COMPAT" define does the **exact opposite** of what its name indicates.
33 Also it makes **no** sense at all that this MUST be defined **explicitly** to make binaries work on Windows XP.
35 But I am **not** a MinGW-w64 developer, so please don't shoot the messenger ;-)
38 Technical Details:
39 ------------------
41 With **ancient** compilers, such as VC2005, the "time_t" type still used to be a 32-Bit type.
43 With those ancient compilers, "time()" would link against "_time". There was **no** "_time32" or "_time64" yet!
45 But: With any **contemporary** compiler, the "time_t" type is 64-Bit; and "time()" links against "_time64".
47 The MSVCRT export "_time32" is a rather new invention; it is simply an alias for the old 32-Bit "_time" export.
49 On Windows XP (including x64-Edition) **only** "_time64" (64-Bit) and the legacy "_time" (32-Bit) existed!