Update sdl 1 threads to sdl 2 threads

Hi All,
I’m trying to update SDL 1 code to SDL 2, however I still need to able to compile against sdl1. I’ve got everything almost compiling now except for threads. I can see now that sdl2 adds an extra parameter. Is there some way to get round this so I can used the same code for sdl1 or 2. Dose sdl2 create some “define” I can use with #ifdef else, or is there some way I can get around the third parameter.
Thanks

I’m trying to update SDL 1 code to SDL 2, however I still need to able
to compile against sdl1. I’ve got everything almost compiling now except
for threads. I can see now that sdl2 adds an extra parameter. Is there
some way to get round this so I can used the same code for sdl1 or 2.
Dose sdl2 create some “define” I can use with #ifdef else, or is there
some way I can get around the third parameter.

(This is the part where I encourage you to drop SDL 1.2 support.)

You should drop SDL 1.2 support.

Okay!

If you absolute must target both, try this:

#if SDL_MAJOR_VERSION < 2
SDL_CreateThread(myfunc, mydata);
#else
SDL_CreateThread(myfunc, “MyThread”, mydata);
#endif

–ryan.

Yea thanks I think your right. I just use sdl2