Wed, 31 Jul 2019 20:55:02 +0300updated Watcom-Win32.zip: SDL-1.2
Ozkan Sezer <sezeroz@gmail.com> [Wed, 31 Jul 2019 20:55:02 +0300] rev 12975
updated Watcom-Win32.zip:

- Adjusted the dll-exported functions (calling convention / _cdecl
symbol decoration mess), so that the applications linked against
mingw- or msvc-built SDL.dll can run with the watcom-built dll.
- Builds current SDL-1.2 branch, tested by cross-compiling on Linux.
- The makefile builds the dll by default, and links statically to
watcom C libraries instead of their dll versions (dropped '-br').
- Included the needed directx headers (ddraw.h, dinput.h, dsound.h)
based on Wine project (LGPL). (Can still override using DXDIR=xx
on the wmake cmdline..)

Wed, 31 Jul 2019 12:20:55 -0400hidapi: Add SDL_hidapi.c, allows support for multiple hidapi backends.
Ethan Lee <flibitijibibo@flibitijibibo.com> [Wed, 31 Jul 2019 12:20:55 -0400] rev 12974
hidapi: Add SDL_hidapi.c, allows support for multiple hidapi backends.

This is currently supported on Linux and macOS. iOS and Android are not
supported at all, Windows support could be added with some changes to the libusb
backend. The Visual Studio and Xcode projects do not use this feature.

Based on Valve Software's hid.cpp, written in collaboration with Andrew Eikum.

Wed, 31 Jul 2019 10:20:37 -0700Make sure HIDAPI is initialized whenever we call HIDAPI_IsDevicePresent()
Sam Lantinga <slouken@libsdl.org> [Wed, 31 Jul 2019 10:20:37 -0700] rev 12973
Make sure HIDAPI is initialized whenever we call HIDAPI_IsDevicePresent()

Wed, 31 Jul 2019 11:14:48 -0500joystick: Ensure HIDAPI is initialized before calling it
Andrew Eikum <aeikum@codeweavers.com> [Wed, 31 Jul 2019 11:14:48 -0500] rev 12972
joystick: Ensure HIDAPI is initialized before calling it

Wed, 31 Jul 2019 11:34:00 -0500cmake: Fix locating libusb header at configure-time
Andrew Eikum <aeikum@codeweavers.com> [Wed, 31 Jul 2019 11:34:00 -0500] rev 12971
cmake: Fix locating libusb header at configure-time

Removing the CheckUSBHID call is necessary to avoid caching the failed header
check result before we find libusb via pkg-config.

Wed, 31 Jul 2019 19:40:50 +0300minor whitespace tidy-up.
Ozkan Sezer <sezeroz@gmail.com> [Wed, 31 Jul 2019 19:40:50 +0300] rev 12970
minor whitespace tidy-up.

Wed, 31 Jul 2019 09:11:20 -0700Fixed bug 4692 - Command line parsing
Sam Lantinga <slouken@libsdl.org> [Wed, 31 Jul 2019 09:11:20 -0700] rev 12969
Fixed bug 4692 - Command line parsing

Galadrim

As I have seen, SDL implements its own command line parser for Windows in SDL_windows_main.c. Unfortunately, it doesn't seem to allow command line arguments with trailing backslashes if quoting is required.

Usually, when you write an application that gets command line arguments passed as argc and argv, the parsing is done by parse_cmdline. The Windows API also provides the function CommandLineToArgvW, so an application can parse itself if only the command line string is provided. Both functions behave almost identically according to their documentation. If the argument "\\" (including the quotes) is passed, they both turn it into a single backslash.

The SDL command line parser on the other hand doesn't recognize the second quote character as the closing character in this example and therefore includes it in the parsed argument. The parser does not count the number of backslashes preceding a quote. It always treats a quote as escaped if a backslash is in front of it. Therefore, it should be impossible to quote and escape an argument correctly, if it has a trailing backslash and contains characters that require quoting.

Of course, each application is allowed to implement its own parsing rules, so SDL is free to do so. But the problem I see is that there are arguments, that are impossible to be passed to the parser correctly, as I described above. Is there a reason, why SDL does not simply use CommandLineToArgvW instead of implementing its own parser?

Here are some links that show that correct argument parsing, as it is usually done in Windows, is quite complicated:

https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-commandlinetoargvw

http://www.windowsinspired.com/how-a-windows-programs-splits-its-command-line-into-individual-arguments/

Wed, 31 Jul 2019 05:11:40 +0300use SDL_zeroa at more places where the argument is an array.
Ozkan Sezer <sezeroz@gmail.com> [Wed, 31 Jul 2019 05:11:40 +0300] rev 12968
use SDL_zeroa at more places where the argument is an array.

Wed, 31 Jul 2019 03:02:28 +0300minor build fixes. SDL-1.2
Ozkan Sezer <sezeroz@gmail.com> [Wed, 31 Jul 2019 03:02:28 +0300] rev 12967
minor build fixes.

Wed, 31 Jul 2019 01:22:02 +0300Fix bug 4746 - introduce SDL_zeroa macro.
Ozkan Sezer <sezeroz@gmail.com> [Wed, 31 Jul 2019 01:22:02 +0300] rev 12966
Fix bug 4746 - introduce SDL_zeroa macro.