We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1983 - SDL_thread.h broken under MinGW crosscompiling environment
Summary: SDL_thread.h broken under MinGW crosscompiling environment
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: thread (show other bugs)
Version: HG 2.0
Hardware: x86 Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-22 17:24 UTC by q66
Modified: 2013-07-27 06:44 UTC (History)
0 users

See Also:


Attachments
mingw compile fix (488 bytes, application/octet-stream)
2013-07-22 17:24 UTC, q66
Details
fixed patch (490 bytes, patch)
2013-07-22 21:02 UTC, q66
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description q66 2013-07-22 17:24:07 UTC
Created attachment 1248 [details]
mingw compile fix

Hi,

after updating SDL2 to the latest RC I'm unable to build my game engine under mingw crosscompiling environment for Windows (32bit, hosted on freebsd 64bit).

The error is in SDL_thread.h with messages like this: http://codepad.org/jEQXd3Yq

The problem is, while _beginthreadex return type is correctly mapped to uintptr_t (as specified by Microsoft), the return type under mingw is unsigned long int (same size, different signature), resulting in the error above.

The reason it didn't error before is this: http://codepad.org/8FAbKAxz

You can see the _beginthreadex case is only used without HAVE_LIBC defined; at one point though, SDL_config_windows.h was changed like this:

-/* Enabled for SDL 1.2 (binary compatibility) */
-#define HAVE_LIBC     1
+/* This is disabled by default to avoid C runtime dependencies and manifest requirements */

resulting in these errors.

I attached a patch that fixes the error.

Thanks!

DK
Comment 1 q66 2013-07-22 21:02:30 UTC
Created attachment 1250 [details]
fixed patch

i forgot a linebreak :(
Comment 2 Sam Lantinga 2013-07-27 06:44:40 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/1890a896802f