Fixed bug 1881 - SDL will not compile with "SDL_THREADS" disabled.
authorSam Lantinga <slouken@libsdl.org>
Sun, 02 Jun 2013 01:12:29 -0700
changeset 7259be3edef98d4b
parent 7258 89d47188c9a4
child 7260 7601833a69ee
Fixed bug 1881 - SDL will not compile with "SDL_THREADS" disabled.

MakoEnergy02

I am attempting to compile SDL on WindowsXP 32-bit, using MinGW. The problem I am having is when I attempt to compile, when it gets to "SDL_systhread.c" it errors:

C:\Repos\Mezzanine\Mezzanine\libincludes\common\sdlsrc\SDL\src\thread\generic\SDL_systhread.c|29|error: conflicting types for 'SDL_SYS_CreateThread'
C:\Repos\Mezzanine\Mezzanine\libincludes\common\sdlsrc\SDL\src\thread\generic\..\SDL_systhread.h|35|note: previous declaration of 'SDL_SYS_CreateThread' was here

I do have SDL_THREADS disabled in my cmake configuration as I do not want or need SDL making threads for me, I have another thread provider. It seems the generic "dummy" implementation does not account for the two extra parameters needed for the "SDL_SYS_CreateThread" method when "SDL_PASSED_BEGINTHREAD_ENDTHREAD" is defined.
src/thread/generic/SDL_systhread.c
     1.1 --- a/src/thread/generic/SDL_systhread.c	Sun Jun 02 01:09:12 2013 -0700
     1.2 +++ b/src/thread/generic/SDL_systhread.c	Sun Jun 02 01:12:29 2013 -0700
     1.3 @@ -25,8 +25,15 @@
     1.4  #include "SDL_thread.h"
     1.5  #include "../SDL_systhread.h"
     1.6  
     1.7 +#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
     1.8 +int
     1.9 +SDL_SYS_CreateThread(SDL_Thread * thread, void *args,
    1.10 +                     pfnSDL_CurrentBeginThread pfnBeginThread,
    1.11 +                     pfnSDL_CurrentEndThread pfnEndThread)
    1.12 +#else
    1.13  int
    1.14  SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
    1.15 +#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */
    1.16  {
    1.17      return SDL_SetError("Threads are not supported on this platform");
    1.18  }