Commit graph

212 commits

Author SHA1 Message Date
Sam Lantinga
a999af88e9 Fixed building using MinGW
Our SDL_windows.h needed to be included before anything else so UNICODE is defined.
2013-10-17 23:02:29 -07:00
David Ludwig
6a6cc6b5e8 WinRT: removed some old debugging code from SDL_mutexP and SDL_mutexV 2013-08-20 22:18:48 -04:00
David Ludwig
2e2d2a0bd4 WinRT: made a note that WinRT doesn't appear to support modifying a thread's priority 2013-08-20 22:16:09 -04:00
David Ludwig
3a2e64540b WinRT: made SDL_ThreadID() return the native thread ID, rather than a fake one 2013-08-20 22:04:09 -04:00
David Ludwig
1b1aa5ec4e WinRT: made the C++11-based threading backend only try to catch exceptions that it knows it (the threading APIs) might throw, rather than all exceptions 2013-08-20 21:54:34 -04:00
David Ludwig
ef0a40b704 WinRT: build fixes and additional WinRT-related integrations with SDL 2.0.0 2013-08-13 20:09:52 -04:00
David Ludwig
88461d442a WinRT: merged with SDL 2.0.0 codebase (aka. SDL hg rev d6a8fa507a45)
--HG--
rename : README.iOS => README-ios.txt
2013-08-12 22:29:55 -04:00
Sam Lantinga
9f90ffbc9f Fixed crash if SDL_GetThreadName() is passed a NULL thread. 2013-08-08 12:21:26 -07:00
Sam Lantinga
defb16763d 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
ef291a943f 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
bc019db86e One more compiler warning. 2013-07-20 19:59:31 -04:00
Ryan C. Gordon
30b6bedb57 Fixed some compiler warnings that Visual Studio reported. 2013-07-20 19:51:51 -04:00
Ryan C. Gordon
f48477bea0 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.

--HG--
extra : rebase_source : 2f1b255b44b4a5d9b88d9257eb3e064e485dd760
2013-09-07 13:47:14 -04:00
Sam Lantinga
651f894b69 Fixed time comparison and explicitly delay 1 ms instead of an arbitrary scheduled time. 2013-09-06 20:45:08 -07:00
Sam Lantinga
1fbbf57ee3 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
c4aae28ea4 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
f8c07dc1bd 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
557bbf3fe6 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
086ecc9949 Fixed Haiku build 2013-07-10 02:37:57 -07:00
Sam Lantinga
bfcb08d569 Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet() 2013-07-10 02:32:04 -07:00
Sam Lantinga
cbc0db6e72 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
5aa3492ef8 Fixed SDL building with the minimal configuration 2013-06-13 22:10:10 -07:00
Sam Lantinga
d2a0d0fb58 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
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
David Ludwig
41ce3814e2 WinRT: merged with latest, official, SDL 2.x sources (at rev. bea100d73d13) 2013-04-14 11:42:55 -04:00
Ryan C. Gordon
4f438b70a2 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
3afbe992d5 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
47dac69dc7 Add PSP support 2013-03-17 20:07:02 +08:00
Andreas Schiffler
c51712467d Fix SDL_TryLockMutex compile error when FAKE_RECURSIVE_MUTEX is defined 2013-03-09 09:24:43 -08:00
Sam Lantinga
c6388c87c1 Changed the name of SDL_mutexP() SDL_mutexV() 2013-03-07 20:12:40 -08:00
Edward Rudd
3ab8d4ce1a move variable declaration to beginning of function 2013-03-06 10:37:27 -05:00
Edward Rudd
ac51aff110 Add SDL_TryLockMutex and implementations for all platforms 2013-03-05 18:54:55 -05:00
David Ludwig
776ebe3bda WinRT: merged with latest, official, SDL 2.x code 2013-02-23 20:01:46 -05:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08:00
David Ludwig
2fde6ac33b WinRT: added a functional threading backend using C++11 apis 2012-11-24 11:17:23 -05:00
David Ludwig
7a24dc071b WinRT: made the skeleton C++11 thread implementation use .cpp files, not .c
--HG--
rename : src/thread/stdcpp/SDL_syscond.c => src/thread/stdcpp/SDL_syscond.cpp
rename : src/thread/stdcpp/SDL_sysmutex.c => src/thread/stdcpp/SDL_sysmutex.cpp
rename : src/thread/stdcpp/SDL_systhread.c => src/thread/stdcpp/SDL_systhread.cpp
2012-11-22 23:12:06 -05:00
David Ludwig
e4c6ec5708 WinRT: added a skeleton SDL backend for C++11-based threads 2012-11-22 23:03:56 -05:00
Ryan C. Gordon
732a5d8165 Whoops, let's not redefine the actual symbol. 2012-11-03 12:11:49 -04:00
Ryan C. Gordon
20144052f8 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.

--HG--
extra : rebase_source : 7a7fb4e0f49ba242e69567ed68c0378794845118
2012-11-03 12:06:27 -04:00
Sam Lantinga
3c2c25f6eb Really fixed the Mac build this time. 2012-10-23 23:44:56 -07:00
Sam Lantinga
b9759c0757 Fixed Mac OS X build 2012-10-23 17:46:57 -07:00
Sam Lantinga
84f8b46a46 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
f380ecb137 Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Ryan C. Gordon
5c732d6324 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
8723c73510 Fixes #1422, removes global JNI Env, uses per thread copies, adds thread auto detaching. 2012-07-09 18:08:06 -03:00
Sam Lantinga
099dd8f095 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
6654546b2a Check for sem_timedwait(), which isn't available on some systems (including OpenBSD 2012-01-15 03:34:14 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
ad2a21d404 Lots of fixes importing SDL source wholesale into a new iOS project
--HG--
rename : src/libm/math.h => src/libm/math_libm.h
2011-10-31 05:56:58 -04:00
Ryan C. Gordon
b5692bd236 Don't crash with a NULL thread name. 2011-10-18 00:34:45 -04:00