Commit Graph

29 Commits

Author SHA1 Message Date
Sam Lantinga
7d207a3141 It's now possible to disable the fast atomic operations, at a huge performance penalty. 2011-02-07 22:57:33 -08:00
Sam Lantinga
94cfb29bb1 More fixes for compilation on Visual Studio 2011-01-25 18:02:41 -08:00
Sam Lantinga
3dc1009723 Improvements based on feedback from Anthony Williams 2011-01-25 17:40:06 -08:00
Sam Lantinga
35a4f38472 Only include windows.h on Windows. :) 2011-01-24 21:22:00 -08:00
Sam Lantinga
01fa14dc42 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
I think this also fixes the bug relating to non-latin characters in filenames, since UNICODE wasn't defined in SDL_rwops.c
2011-01-24 21:20:30 -08:00
Sam Lantinga
ec39fffe84 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008 2011-01-24 15:46:11 -08:00
Sam Lantinga
8ca87bec57 Fixed bug #1097
There are problems with including intrin.h in C linkage in C++ compilation,
and further conflicts between intrin.h and winnt.h on Visual Studio 2005.
2011-01-21 23:46:51 -08:00
Sam Lantinga
cabda4aa7c HAVE_GCC_ATOMICS covers the test and set 2011-01-21 21:45:55 -08:00
Sam Lantinga
69dab46757 Separated out the minimum functionality that we need from gcc for our spinlock fallback. 2011-01-21 21:42:04 -08:00
Sam Lantinga
9a91680ace Whoops, good catch from Greg Jandl 2011-01-18 22:10:37 -08:00
Sam Lantinga
b8df61a201 Use compiler intrinsics on Windows 2011-01-17 14:05:43 -08:00
Sam Lantinga
89d48a0f83 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Changed the CAS return value to bool, so it's efficient with OSAtomicCompareAndSwap32Barrier()
Added an atomic test adapted from code by Michael Davidsaver
2011-01-16 15:16:39 -08:00
Sam Lantinga
38e31e4598 Updated the atomic API for better use cases 2011-01-15 12:41:59 -08:00
Sam Lantinga
7052036491 Fixed bug #926
Updated copyright to LGPL version 2.1 and year 2010
2010-01-24 21:10:53 +00:00
Sam Lantinga
db0f3081da Fixed windows.h include 2009-12-13 05:37:06 +00:00
Mike Gorchak
61a236b4a6 Support for the atomic operations for ARM, PPC, MIPS, SH, X86 platforms has been added. 2009-10-10 08:06:18 +00:00
Bob Pendleton
f84f69d047 fixed a spelling error in the documentation. 2009-09-25 19:26:21 +00:00
Bob Pendleton
7a2031a379 This version actaully should work on Windows. 2009-09-25 19:17:16 +00:00
Bob Pendleton
10e2dbb79d oops 2009-09-21 22:25:14 +00:00
Bob Pendleton
ccf0c93d64 Should now compile on 32 bit linux and 64 bit linux 2009-09-21 22:23:41 +00:00
Bob Pendleton
9861510378 The new, cleaner, version of the atomic operations. The dummy code is what you should start working with to port atomic ops.
The linux code appears to be complete and *should* be the base of all Unix and GCC based versions. The macosx and win32 versions
are currently just copies of the dummy code. I will begin working on the windows version as soon as this check in is done. I
need someone to work on the Mac OS X version.

I'm afraid that this check in will break QNX (Sorry!)
2009-09-17 20:35:12 +00:00
Bob Pendleton
e80feea87f I forgot to copy the dummy version to macosx. 2009-08-11 21:15:18 +00:00
Mike Gorchak
84f82b23eb Support for native and emulated atomic operations has been added. 2009-07-19 08:04:59 +00:00
Bob Pendleton
a71b57e1f0 volitile... duh, yeah the variable need to be labeled volitile 2009-07-09 21:31:27 +00:00
Bob Pendleton
1bf9cab1ff This is a cosmetic fix, I found a stupid typo 2009-07-02 21:47:02 +00:00
Bob Pendleton
e53cd95852 I've made so many changes I don't dare continue until I check the current stuff in.
/test/testatomic.c performs absolutely basic tests to show that the function work as expected. Need a second test to do more detailed tests.

/include/SDL_atomic.h provides declarations for all included functions.

/src/atomic/linux/SDL_atomic.c provided all the functions. On a generic built the 64 bit functions work, but they are emulated. On a build for -march=pentium and above the 64 bit functions use native instructions
/src/atomic/dummy/SDL_atomic.c emulates all the operations using SDL_mutex.h.
/src/atomic/win32/SDL_atomic.c is a copy of dummy
/src/atomic/macosx/SDL_atomic.s is a copy of dummy

These versions of SDL_atomic.c provide a frame work for building the library with a mixture of native and emulated functions. This allows the whole library to be provided on all platforms. (I hope.)
I hope this fits with the SDL philosophy of either providing a common subset or emulating when the platform is missing a feature.

I have not added dummy, macosx, or win32 to the build. They are there as place holders for future work.

I have modified congifure.in to compile sources in /src/atomic/linux. (The SDL configure.in file is an amazing piece of work and I hope I didn't mess it up. :-)
2009-06-29 19:54:43 +00:00
Bob Pendleton
9302a68559 Disabling 64 bit atomics operations until I figure out why they do not link. 2009-06-24 22:24:23 +00:00
Bob Pendleton
c0646fda71 First draft of atomic operations code for GCC and linux. 2009-06-24 20:20:57 +00:00
Bob Pendleton
0b5bc4d23b This check in updates SDL_atomic.h to reflect the new set of atomic operations in 32 and 64 bit form.
It also update configure.in to compile the linux version of the library. The three versions are all dummies
implementations that do nothing. They are being checked in as place holders. Mostly, I just wanted to get
place holders and the configure.in checked in.
2009-06-24 20:04:08 +00:00