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 1649 - src/thread/generic/SDL_systhread.c does not support SDL_PASSED_BEGINTHREAD_ENDTHREAD
Summary: src/thread/generic/SDL_systhread.c does not support SDL_PASSED_BEGINTHREAD_EN...
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: thread (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-27 21:13 UTC by John Chadwick
Modified: 2013-04-16 15:13 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Chadwick 2012-11-27 21:13:45 UTC
If SDL_PASSED_BEGINTHREAD_ENDTHREAD is defined, generic/SDL_systhread.c will fail to compile, because it implements them incorrectly.
Comment 1 Andreas Schiffler 2013-03-13 11:57:20 UTC
Slightly different repro around SDL_PASSED_BEGINTHREAD_ENDTHREAD (Win7/cygwin):

$ ../configure CFLAGS=-DSDL_PASSED_BEGINTHREAD_ENDTHREAD
$ make
...
/bin/sh ./libtool --mode=compile gcc -DSDL_PASSED_BEGINTHREAD_ENDTHREAD  -DUSING_GENERATED_CONFIG_H -Iinclude -I../include -I/usr/include/mingw -mno-cygwin -mmmx -msse -mpreferred-stack-boundary=2 -Wall -MMD -MT build/SDL_thread.lo -c ../src/thread/SDL_thread.c -o build/SDL_thread.lo
libtool: compile:  gcc -DSDL_PASSED_BEGINTHREAD_ENDTHREAD -DUSING_GENERATED_CONFIG_H -Iinclude -I../include -I/usr/include/mingw -mno-cygwin -mmmx -msse -mpreferred-stack-boundary=2 -Wall -MMD -MT build/SDL_thread.lo -c ../src/thread/SDL_thread.c  -DDLL_EXPORT -DPIC -o build/.libs/SDL_thread.o
In file included from ../src/thread/SDL_thread.c:28:
../src/thread/SDL_systhread.h:36: error: parse error before "pfnSDL_CurrentBeginThread"
../src/thread/SDL_thread.c:217: error: parse error before "pfnSDL_CurrentBeginThread"
../src/thread/SDL_thread.c: In function `SDL_CreateThread':
../src/thread/SDL_thread.c:224: error: number of arguments doesn't match prototype
../include/SDL_thread.h:133: error: prototype declaration
../src/thread/SDL_thread.c:239: error: `name' undeclared (first use in this function)
../src/thread/SDL_thread.c:239: error: (Each undeclared identifier is reported only once
../src/thread/SDL_thread.c:239: error: for each function it appears in.)
../src/thread/SDL_thread.c:256: error: `fn' undeclared (first use in this function)
../src/thread/SDL_thread.c:257: error: `data' undeclared (first use in this function)
../src/thread/SDL_thread.c:272: error: `pfnBeginThread' undeclared (first use in this function)
../src/thread/SDL_thread.c:272: error: `pfnEndThread' undeclared (first use in this function)
Makefile:442: recipe for target `build/SDL_thread.lo' failed
make: *** [build/SDL_thread.lo] Error 1
Comment 2 Ben Swick 2013-04-16 14:22:39 UTC
It appears that SDL_PASSED_BEGINTHREAD_ENDTHREAD is not intended to be defined manually like that. SDL_thread.h defines it on Windows when configured to not use the C library (HAVE_LIBC is undefined).

Is there some reason you are trying to force the definition of it?
Comment 3 John Chadwick 2013-04-16 15:13:07 UTC
Actually, this wasn't a bug. It was a mistake on my part, when trying to build SDL without it's own build system, iirc. I forgot to close this when I discovered that.