Skip to content

Windows Puzzles Merge Notes

Erik Massop edited this page Nov 4, 2017 · 1 revision

Post-DrJekyll

After Anders Gustafsson merged some Windows-related changes from his PostJ branch (after the DrJekyll release) I moved Windows-related work into win32 and win32-crap branches of xmms2-puzzles. I improved and cleaned some commits as well as resolved some merge conflicts. I'll document what's been done here for review purposes.

The win32 branch contains win32 commits that are in good shape and (hopefully) ready for merge. The win32-crap branch contains win32 as its base, plus some commits that are important for building on Windows, but which are not yet optimal or in need of some discussion. The following are the contents of my win32 branch.

  • Daniel Chokola BUG(1609): copy scripts on win32
    • Copies startup.d/shutdown.d scripts to the user directory at runtime.
    • Works line on *nix, only copies instead of symlinks.
    • Still, it copies some of the default .sh scripts, which are useless on Windows.
  • Daniel Chokola OTHER: log error when a script fails to run
    • XMMS2 is very quiet when a script fails to execute. This just logs an error in the xmms2 log when an executable script fails to spawn.
  • Daniel Chokola OTHER: set HAVE_WINSOCK2 in C++, too
    • The old code in the playground branch checked for __WIN32__, so it worked in C or C++.
    • This is needed for xmmsclient++.
  • Daniel Chokola BUG(1575): link ices with winsock2 on win32
    • Pretty obvious.
  • Daniel Chokola BUG(1501): enable DAAP plugin on Windows 2000
    • Includes wspiapi.h compatibility header if it's available (which it must be on Win2k)
  • Daniel Chokola BUG(1522): link curl with winsock2 on win32
    • Pretty obvious.
  • Daniel Chokola BUG(1521): link cdda with winmm on win32
    • libcdio uses winmm for CD I/O on Windows.
  • Daniel Chokola BUG(1503): link FLAC plugin with winsock2 on win33
    • Funny commit message.
    • It seems strange that FLAC should link with winsock2, but it needed something like ntohl, IIRC.
    • Since winsock2 is just a DLL it's not a big deal. No extra space wasted.
  • Auke Schrijnen BUG(1502): replace mkdir with portable g_mkdir_with_parents in diskwrite
    • No-brainer. The GLib version issue was worked out in the playground branch stuff below.
  • Daniel Chokola OTHER: link DAAP plugin to winsock on win32
    • Pretty obvious.
  • Daniel Chokola BUG(1496,1501): support Windows 2000 and up (possibly older versions) and do explicit library and header checks
    • This is a much-improved version of two playground commits.
      • The playground commit assumed that wspiapi.h was present on Win2k; this actually checks for its presence and requires it for < Windows XP.
      • The playground commit set _WIN32_WINNT to pretend to be XP or newer; this sets the real version in use.
      • This commit tells you when you are missing wspiapi.h, your build will be unusable on pre-XP Windows.
  • Daniel Chokola OTHER: fix warning from -fPIC on MinGW
    • All code from mingw's compiler is position-independent.
    • Perhaps this is not universal of Windows compilers and should be set for MinGW only?
  • Juho Vähä-Herttua BUG(1190): Make plugin path relative on Windows.
    • Pretty obvious.
  • Juho Vähä-Herttua BUG(1481): Make a separate format_url for win32 to convert paths into urls.
    • Handles Windows' backslashes and formats everything using forward slashes.
  • Juho Vähä-Herttua OTHER: Initialize IO channels better and handle HUP as disconnect. (Windows)
    • See the playground commit.
  • Daniel Chokola BUG(1478): allow mp4 plugin to build on MinGW
  • Daniel Chokola OTHER: disable launcher on win32
    • There's no hope of porting or reason to port this, so it's just disabled.
  • Tim Schumacher BUG(1479): find real terminal width on win32
    • Pretty obvious.
  • Daniel Chokola BUG(1479): split out os-dependent code for find_terminal_width in CLI
    • Pretty obvious.
  • Daniel Chokola BUG(1480): install libxmms2core.dll on win32
    • Pretty obvious.

These are the contents of the xmms2-puzzles playground branch before the release of DrJekyll. Some of these commits have been merged into xmms2-devel and progress is good. However these commits are no longer very relevant and Windows-related commits are now in the win32 and win32-crap branches of xmms2-puzzles.

  • ef6f1440b6665b24e03fb2860e49964cbda3d8a5 BUG(1473): add win32 to the list of platform names
    • allows us to have XMMS_OS_WIN32 defined \o/ definitely a good idea to merge
    • No, XMMS_OS_* define should go. Only very few offenders left. 620. Anders Gustafsson 20:56, 19 May 2007 (CEST)

  • beb86bde97ef4c8ea3cea182e0cc8f03c33261f0 BUG(1474): properly escape directories on win32
    • replaces backslashes with double-backslashes in pathnames in certain header files
    • necessary because #define "\some\path" sees "\s" and "\p" as escape sequences and fails
    • Sounds like a bug in waf to me, which should be fixed in waf not in upper layers. Anders Gustafsson 20:56, 19 May 2007 (CEST)
      • Waf allows you to set defines. Correct me if I'm wrong, but I don't think in this case it has any concept of directories, so it is up to us to escape them. Puzzles Sat May 19 16:36:50 EDT 2007

 say conf.env["FOODIR"] = '/a/b/c'  does it understand that FOODIR is a directory?  no


  • caa9af3e7a199fc9ca5a8500d09e508264034fc4 BUG(1475): remove unused pthread include
  • 76fd1a6fefb34a84420c5a090c6af405c514acd7 BUG(1480): install libxmms2core.dll on win32
    • on windows, xmms2core is a shared lib and needs to be present on the system
    • this is broken - when merging, combine with 444d6163b8457607e7b53110e1b3343cb94e09bc and erase any record of my stupid mistake
  • 1b21fa94a357d900077b1ba0d60d06d117e3a5fb BUG(1479): split out os-dependent code for find_terminal_width in CLI
    • windows command-line is different :P
  • 763311991f28a660cbe1def61b59536d22ebfc1f BUG(1479): find real terminal width on win32
    • 1b21fa94a357d900077b1ba0d60d06d117e3a5fb statically sets the terminal width to 80 columns, whereas it can actually be resized
    • Tim Schumacher
  • 1d3ecdd649f9e42496848c3915f5ae3c41aaae7d OTHER: disable launcher on win32
    • the launcher was not meant to be ported to windows and xAFFE's service monitor is probably a better solution
  • e8f66eb9d5088a2904bebb98cad953dee1f32a09 OTHER: disable ET on win32
    • auke has done some porting work (see 1505) but it's still unrefined and hasn't received much feedback
  • 444d6163b8457607e7b53110e1b3343cb94e09bc OTHER: correct stupid obvious bug
    • commit message says it all. feel free to combine with 76fd1a6fefb34a84420c5a090c6af405c514acd7
  • 9705376c7b5c0db5d938d8802a1a00c509b6375f BUG(1487): set priority for waveout output
    • sets the waveout plugin priority so it gets used instead of null
    • priority set to 3, the same as OSS, for if/when we get a DirectSound output, which will be 4, the same as ALSA
    • in PostJ Anders Gustafsson 20:56, 19 May 2007 (CEST)
  • 342a3a5222edc5ad644aba7530fc0a68ed406d12 BUG(1478): allow mp4 plugin to build on MinGW
    • takes advantage of MinGW's stdint.h to prevent compilation errors
  • 8ac322978cc9b28dcdb78ead453c620c99a9a707 OTHER: Initialize IO channels better and handle HUP as disconnect. (Windows)
    • initializes GIOChannel encoding to binary and buffering to false just to be nice
    • treats a HUP as a disconnect instead of an error
    • Juho Vähä-Herttua
  • f6ba131d1427ae60b9c31870922cddc9d36fc254 BUG(1481): Make a separate format_url for win32 to convert paths into urls.
    • mimics current CLI behavior on local systems (automatic relative -> absolute path conversion)
    • converts backslashes to forward slashes as per normal URLs
    • Juho Vähä-Herttua
  • 184e3e07fc053fd4c3afb1527777c85204adebe5 OTHER: The 'sunos5' of Solaris was forgotten from platform_names.
    • this isn't win32-related, what's this doing in here? (puzzles guessed right, see below)
    • juhovh probably caught this while looking at the fix for 1473
    • Juho Vähä-Herttua
  • 1c11c7760da758739104ba7d9789de2c61037edd OTHER: Move all platform dependent stuff into "compat" subdirectory.
    • self-explanatory and minimally invasive as virtually no source was changed; should be a no-brainer to merge
    • Juho Vähä-Herttua
    • in PostJ Anders Gustafsson 20:56, 19 May 2007 (CEST)
  • 0cabd8697af00dec3e9709696ad5408b96e0d144 BUG(1485): Separate the symlink_file function from main.c for portability.
    • makes a unix and dummy symlink_file function in separate files
    • dummy symlink_file just returns false; not a problem since scripts don't run on windows startup.d anyway
    • Juho Vähä-Herttua
    • in PostJ Anders Gustafsson 20:56, 19 May 2007 (CEST)
  • 6ade3ac1767197e9b41c6f064eb5f02b52d29f85 BUG(1485): Separate checking for root user from main.c for portability.
    • similar to above, only for UID functions
    • windows has no root user, so it uses the dummy, which always returns false
    • Juho Vähä-Herttua
    • in PostJ Anders Gustafsson 20:56, 19 May 2007 (CEST)
  • 507fb64149e80e1685beed2af619391b81d68ddb BUG(1190): Make plugin path relative on Windows.
    • plugins don't really fit into system32 very well as they're not system files and xmms2 doesn't know how to check $PATH anyway
    • ./Plugins is used as it avoids searching $PATH and lends itself well to packaging a binary xmms2 for windows
    • Juho Vähä-Herttua
  • 5295349110524f24a4ba08f8d2be03b738e71ac3 BUG(1496): check Windows version on configure and set _WIN32_WINNT appropriately
    • xmmsc_sockets.h set _WIN32_WINNT to masquerade as WinXP always; Win2K and Vista support were impossible
    • _WIN32_WINNT is defined according to the actual host and it's defined globally
  • c3106fc832a76dfda49ca06886d145d2676a3f27 OTHER: link DAAP plugin to winsock on win32
    • honestly I don't remember if/how this works o_O
  • 629782026c65e92e1885167cc33160fbdbdcd916 BUG(1502): replace mkdir with portable g_mkdir_with_parents in diskwrite
    • two birds with one stone: uses a portable glib function and simplifies the code
    • puzzles: 629782026c65e92e1885167cc33160fbdbdcd916 depends on a newer version of glib than the rest of xmms2d depends on.
      • grep -r g_mkdir_with_parents src/
      • debian stable even has has 2.6.12 whereas g_mkdir_with_parents is 2.8
    • Auke Schrijnen
  • 1544b9616ddf146a6fec23fdfb8e0322e87b8433 BUG(1500): fix Ruby binding build on win32
    • this works by telling ruby.h that we're MSVC, since Ruby doesn't really understand MinGW
      • this badly interacts with xmmsc_stdint.h, which has tazle's old MSVC code
      • after consulting with tazle, I took out the code
      • subsequently, I took out xmmsc_stdint.h altogether as it only served to include inttypes.h
    • should be merged with 85a648b3b7696bb684c9c4d19eb98b553991dfa9
  • afe98fa3667e1819c594c513a08320db476fae80 BUG(1503): link FLAC plugin to ws2_32 on win32
    • it seems odd, but IIRC, FLAC needed something like ntohl() or htons()
  • a5ffbecac3b90cebd2f541e2217d41c88a79cb21 BUG(1521): link cdio against winmm on win32
    • cdio uses winmm for cdrom access on windows (apparently :P)
  • c5c1f10f04f9d8ca352a1a613c3e3ef710711dd2 BUG(1522): link curl to ws2_32 on win32
    • ws2_32 == winsock; this is a no-brainer
  • 9b46e6a4bd58d97d915d32ac6a325725e23b738a BUG(1501): enable building on Windows 2000
    • microsoft was nice enough to make previous versions of windows compatible with newer windows (XP) functions through use of a header
      • header is copyrighted and non-GPL (of course) does #including this pose a GPL violation?
      • header is reverse-compatible and optional for windows XP and above, but necessary for 2000 and prior--great for binaries
    • this really should print out a warning for XP users that their binary will not run on windows 2000 and below if the header is missing, however:
      • WSPiApi.h, the header needed for this needs 2 other headers in order to work
      • this is not a problem except that during waf configuration tests, the test programs all fail because there is no way to check multiple headers 1
    • globally defines WIN2K on Win2k systems, this might be better named as HAS_WSPIAPI once the above problem is resolved
  • 287922477fd8b5c4dc12dd109b03285a96ae15cb BUG(1501): enable building DAAP plugin on Windows 2000
    • just adds #include <WSPiApi.h> if WIN2K is defined.
  • 85a648b3b7696bb684c9c4d19eb98b553991dfa9 BUG(1544): remove xmmsc_stdint.h
    • see 1544b9616ddf146a6fec23fdfb8e0322e87b8433; xmmsc_stdint.h has been replaced with inttypes.h everywhere it occurs
    • Not sure 'bout this. Are we dropping support for m$ compilers? Anders Gustafsson 20:56, 19 May 2007 (CEST)
      • See 1544 and the IRC log in the description. The MSVC support code was not necessary then or now and was only related to python extensions. Puzzles Sat May 19 16:36:50 EDT 2007
      • I'm talking about supporting MSVC compilation for everything. Any reason not to? Anders Gustafsson 23:13, 19 May 2007 (CEST)
      • Is this code actually useful for MSVC compilation? If it is, there is probably a better solution using the buildsystem, as checking _MSC_VER poses a problem for Ruby, at least 2. In my own opinion, I'm averse to supporting free software built on non-free compilers. And I doubt you'll find someone willing to port it for a while, either. Puzzles Sun May 20 10:06:05 EDT 2007
  • 1ac89a563f35f4ee87f262691348dfa36e468d3c BUG(1575): link ices against winsock on win32
    • super-simple one-liner fix here. if any of the above winsock/ws2_32 stuff gets merged, this should be, too.
Clone this wiki locally