Commit Graph

150 Commits

Author SHA1 Message Date
Ryan C. Gordon
19b1e1f53f Disable thread naming on Win64 for now.
We can't use _try/_except without the C runtime, and we can't use inline
 asm with the Win64 compiler. We'll need to move this to an .asm file or
 something later.
2013-09-07 13:47:14 -04:00
Sam Lantinga
c7f635ec01 Fixed time comparison and explicitly delay 1 ms instead of an arbitrary scheduled time. 2013-09-06 20:45:08 -07:00
Sam Lantinga
0a093f4eea Fixed bug 2076 - OpenGL doesn't work with --disable-threads
stepik-777

Thread local storage is used to store current window and current opengl context. OpenGL worked before this changeset: 7596 (45e5c263c096)
2013-09-05 07:15:26 -07:00
Ryan C. Gordon
314ecabd38 Enabled thread naming on Windows.
This is now done without compiler or C runtime support for __try/__except.

(Granted, it uses Visual Studio-style inline asm, but still...)
2013-08-31 01:36:38 -04:00
Gabriel Jacobo
eefc8fdad1 Fixes bug #2074 - Thanks Sylvain!
SDL_syssem.c:159 comparison of unsigned expression >= 0 is always true
Solved by comparing unsigneds directly

SDL_systimer.c:164: warning: control may reach end of Compile
Solved by returning the default value if all else fails.

SDL_androidgl.c:41:1: warning: type specifier missing, defaults to 'int'
SDL_androidgl.c:47:1: warning: control reaches end of non-void function
Solved by adding void return type to the function implementation
2013-08-29 14:03:44 -03:00
Sam Lantinga
e66f593a02 Fixed crash if SDL_GetThreadName() is passed a NULL thread. 2013-08-08 12:21:26 -07:00
Sam Lantinga
9747d8daf0 Add a timeout to the clipboard code to avoid hangs when using synergy. When a timeout is detected we set the clipboard so that we own it so that future timeouts are avoided. Testing has confirmed that this timeout and setting only occurs when the clipboard contains text from my Windows machine.
That is, if you copy from the Windows clipboard and then launch Dota and then repeatedly paste to a terminal window then the text will disappear when Dota hits the timeout. If you then select on the Linux side you can repeatedly paste. If you select again on Windows then the text will get cleared again.

Note that Dota only looks at the clipboard when it has focus.

CR: Saml
2013-07-23 12:59:29 -07:00
Sam Lantinga
ca9a19ea4c Fixed building with cygwin
Note that building with cygwin gcc results in a DLL that depends on cygwin1.dll
2013-07-21 23:01:01 -07:00
Ryan C. Gordon
89f836cacf One more compiler warning. 2013-07-20 19:59:31 -04:00
Ryan C. Gordon
ee3cbb1fa6 Fixed some compiler warnings that Visual Studio reported. 2013-07-20 19:51:51 -04:00
Sam Lantinga
f5306d72d0 Added release/acquire memory barriers to the atomic API
* Added a destructor to clean up TLS memory at thread shutdown
* Refactored the TLS code to have platform independent code and a small platform dependent core with a fallback to generic code if platform dependent functions fail.
* Fixed recursion issues with SDL_GetErrBuf()
2013-07-10 18:31:17 -07:00
Sam Lantinga
5a15888731 Fixed Haiku build 2013-07-10 02:37:57 -07:00
Sam Lantinga
9c0dea8e15 Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet() 2013-07-10 02:32:04 -07:00
Sam Lantinga
266b3c869f Fixed bug 1936 - Broken URL in generic SDL_syscond.c
cp.ml.x.dev

A comment in 'src/thread/generic/SDL_syscond.c' references the URL 'http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html', which cannot be resolved anymore. An alternative would be 'http://web.archive.org/web/20010914175514/http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html#Workshop'.
2013-07-06 00:28:54 -07:00
Sam Lantinga
d8b6e04ab1 Fixed SDL building with the minimal configuration 2013-06-13 22:10:10 -07:00
Sam Lantinga
35b9ffa392 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.
2013-06-02 01:12:29 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Ryan C. Gordon
16cdc59bab Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Sam Lantinga
f0af9a3e70 Removed Nintendo DS support since nobody has volunteered to maintain it for over a year. 2013-03-17 09:44:58 -07:00
Captain Lex
a18bccd5f3 Add PSP support 2013-03-17 20:07:02 +08:00
Andreas Schiffler
1673a640c3 Fix SDL_TryLockMutex compile error when FAKE_RECURSIVE_MUTEX is defined 2013-03-09 09:24:43 -08:00
Sam Lantinga
2952d9bf48 Changed the name of SDL_mutexP() SDL_mutexV() 2013-03-07 20:12:40 -08:00
Edward Rudd
7c3cb6e7f4 move variable declaration to beginning of function 2013-03-06 10:37:27 -05:00
Edward Rudd
e4d41effe3 Add SDL_TryLockMutex and implementations for all platforms 2013-03-05 18:54:55 -05:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
Ryan C. Gordon
c6b8824839 Whoops, let's not redefine the actual symbol. 2012-11-03 12:11:49 -04:00
Ryan C. Gordon
6969b0e744 Make Linux dynamically look up pthread_setname_np() for older glibc compat.
Cleaned up the lookup code to make Mac OS X use most of the same code.
2012-11-03 12:06:27 -04:00
Sam Lantinga
b89298c92c Really fixed the Mac build this time. 2012-10-23 23:44:56 -07:00
Sam Lantinga
6d3b1f137c Fixed Mac OS X build 2012-10-23 17:46:57 -07:00
Sam Lantinga
08f46b5fa5 Fixed running SDL on older versions of Mac OS X. pthread_setname_np() was introduced in 10.6. 2012-10-23 16:06:06 -07:00
Sam Lantinga
b3d60cfcbb Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Ryan C. Gordon
b3b40aac16 Removed Windows CE support from SDL 2.0.
It's a long-dead platform, and we don't have any way to build for, test, or
maintain it, so there's no sense in doing acrobatics to support it.

If you need Windows CE support, use SDL 1.2. If you need Windows Phone support,
send SDL 2.0 patches for the newer Windows Mobile platform.
2012-09-15 10:59:39 -04:00
Gabriel Jacobo
af5f6d6ddb Fixes #1422, removes global JNI Env, uses per thread copies, adds thread auto detaching. 2012-07-09 18:08:06 -03:00
Sam Lantinga
6ff55c1ca2 Fixed bug 1426 - SDL_SemWaitTimeout returns -1 and sets error instead of SDL_MUTEX_TIMEDOUT on time out
deraj 2012-02-19 19:01:08 PST

Fix to treat ETIMEDOUT as a time out instead of an error (and update the test)
2012-02-20 23:51:53 -05:00
Sam Lantinga
243a72784f Check for sem_timedwait(), which isn't available on some systems (including OpenBSD 2012-01-15 03:34:14 -05:00
Sam Lantinga
e256711bb9 Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
6371c44a9e Lots of fixes importing SDL source wholesale into a new iOS project 2011-10-31 05:56:58 -04:00
Ryan C. Gordon
2014d62292 Don't crash with a NULL thread name. 2011-10-18 00:34:45 -04:00
Ryan C. Gordon
bebad17430 Fixed a whole slew of compiler warnings that -Wall exposed. 2011-10-13 01:08:30 -04:00
Ryan C. Gordon
41f4356ae7 Disable thread naming on Windows for now.
We need the C runtime, which we don't link against, for __try/__except.
2011-10-02 00:59:11 -04:00
Ryan C. Gordon
79077a2d15 Patched to compile on Mac OS X (I think). 2011-10-02 00:49:52 -04:00
Ryan C. Gordon
ce0c9e37fd Further patched to compile on Windows. 2011-10-02 00:43:56 -04:00
Ryan C. Gordon
652f5a7622 Patched to compile on Windows. 2011-10-02 00:36:18 -04:00
Ryan C. Gordon
2ef51927fe 1.3 API CHANGE: Add support for naming threads. 2011-10-02 00:29:16 -04:00
Ryan C. Gordon
7c206c10b5 Don't call pthread_exit(), returning from RunThread() is equivalent. 2011-09-20 17:48:29 -04:00
Ryan C. Gordon
a2878205f5 Simplified Windows RunThread().
Removed checks for things that are always true, free unneeded struct before
 calling thread entry point, instead of after thread completes.
2011-09-20 17:42:58 -04:00
Ryan C. Gordon
fe04e23133 Merged Nathan Heisey's Haiku work into the main SDL 1.3 branch.
This was a Google Summer of Code 2011 project, sponsored by the Haiku project.

We thank Nathan and the other Haiku developers for their support!
2011-09-15 23:51:07 -04:00
Ryan C. Gordon
b84e7104b1 Clean up the win32 compiler warnings for SDL threads, in the 1.3 branch. 2011-09-12 13:36:38 -04:00
Ryan C. Gordon
079d39970c More work on cleaning out compiler warnings. 2011-09-11 04:02:40 -04:00
Nathan Heisey
b71435641b Should compile now (fixed typos(?)) 2011-07-14 17:58:47 +00:00