Commit Graph

112 Commits

Author SHA1 Message Date
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
a19e127cda Make SDL_stdinc.h work when compiling with -Wundef (thanks, Ben!).
Fixes Bugzilla #2664.
2015-04-08 01:42:47 -04:00
Ryan C. Gordon
a1b258c0a5 Fixed SDL_PRI?64 for 64-bit Linux.
64-bit Linux uses a "long" instead of "long long" for 64-bit ints.

Added a special-case this so SDL_PRI?64 doesn't trigger compiler warnings
when used with SDL's 64-bit datatypes on 64-bit Linux.
2015-03-02 21:36:45 -05:00
Ryan C. Gordon
bf02bb2582 Clang static analysis builds should use C runtime directly.
This is a little macro magic to use malloc() directly instead of SDL_malloc(),
 etc, so static analysis tests that know about the C runtime can function
 properly, and understand that we are dealing with heap allocations, etc.

This changed our static analysis report from 5 outstanding bugs to 30.

5x as many bugs were hidden by SDL_malloc() not being recognized as malloc()
 by the static analyzer!
2015-01-05 01:41:42 -05:00
Edward Rudd
3d55ed1b82 ugh.. stray character 2014-12-03 12:47:39 -05:00
Edward Rudd
079f42cb3d fix SDL_PRIs64 on windows compilers.. (should end in d) 2014-12-03 12:45:04 -05:00
Edward Rudd
73fc93717d switch to use SDL_PRI* macros for long long formatting everywhere. 2014-12-03 12:23:17 -05:00
Sam Lantinga
47f40262b5 Removed SDL_round() because the license wasn't compatible with zlib 2014-08-17 13:11:55 -07:00
Sam Lantinga
18fc7db9e2 Added SDL_round(), contributed by Benoit Pierre - thanks! 2014-08-16 23:23:15 -07:00
Sam Lantinga
2582c3aa59 Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings 2014-06-23 11:06:50 -07:00
Sam Lantinga
fee876047b commit 9e211e646f9d51dc1372c9f3c8f47a78caf4f2a5
Author: Sam Clegg <sbc@chromium.org>
Date:   Fri Jun 20 12:52:11 2014

    Fix win32 build which was failing due to missing PRIs64.

    This change adds definitions for the C99 PRIs16 and PRIu64
    which are missing from <stdint.h> on at last win32 and
    possibly other platforms.

    These already existed in testgesture.c so I removed them
    from there also.
2014-06-21 11:24:06 -07:00
Philipp Wiesemann
38942661e7 Fixed typo in source comment. 2014-06-08 12:51:02 +02:00
Sam Lantinga
e1683fad67 Added SDL_sqrtf(), SDL_tan(), SDL_tanf() 2014-06-07 18:20:01 -07:00
Sam Lantinga
667b15f3c8 Added annotations to help code analysis tools
CR: Bruce Dawson
2014-06-04 10:56:56 -07:00
Sam Lantinga
0ae88759fb Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
David Ludwig
c96c4f3dc4 WinRT: merged with latest SDL 2.x/HG code
SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library.  The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
2013-11-28 22:09:21 -05:00
Ryan C. Gordon
df9f367941 Added SDL_vsscanf(). 2013-11-24 23:35:38 -05:00
Sam Lantinga
f040fbe866 Fixed bug 2245 - add SDL_acos and SDL_asin
Sylvain

Here's some code to add arc cosine, and arc sin functions to SDL_stdlib.c
There are plainly written using SDL_atan.
2013-11-16 18:56:02 -08:00
Sam Lantinga
ce9a47ddee Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning 2013-11-03 09:42:23 -08:00
David Ludwig
529fcd3ee3 WinRT: merged with SDL 2.0.1 codebase 2013-10-27 21:26:46 -04:00
David Ludwig
f34ae4e23f WinRT: more "Windows RT" to "WinRT" renaming 2013-08-27 12:20:35 -04:00
David Ludwig
1ae5d8dea3 WinRT: build fixes and additional WinRT-related integrations with SDL 2.0.0 2013-08-13 20:09:52 -04:00
David Ludwig
373ffd0dac WinRT: merged with SDL 2.0.0 codebase (aka. SDL hg rev d6a8fa507a45) 2013-08-12 22:29:55 -04:00
Gabriel Jacobo
8515791f86 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
871473e032 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Sam Lantinga
7be0e70524 Made the SDL_memset4() comment even clearer so we don't accidentally replace it with memset() in the future. 2013-07-09 08:01:40 -07:00
Sam Lantinga
09997d0e9f Backed out commit 898992405fa7 because memset() does a byte fill and SDL_memset4() does a uint32 fill and this change breaks SDL_FillRect() 2013-07-09 07:13:58 -07:00
Ryan C. Gordon
fca053548a Replaced SDL_memset4() implementation with a call to SDL_memset().
The implementation was slower than the C runtime on Mac OS X, Linux, and
 Windows...quite a bit slower when using the C fallback instead of the inline
 asm, too.

Fixes Bugzilla #1755.
2013-07-08 23:22:36 -04:00
Sam Lantinga
69bede6d35 Removed the inline functions from SDL_stdinc.h
Having the SDL functions inline is causing build issues, and in the case of malloc(), etc. causing malloc/free mismatches, if the application build environment differs from the SDL build environment.

In the interest of safety and consistency, the functions will always be in the SDL library and will only be redirected to the C library there, if they are available.

See the following threads on the SDL mailing list for the gruesome details:
* SDL_stdinc.h inlines problematic when application not compiled in exact same feature environment
* Error compiling program against SDL2 with -std=c++11 g++ flag
2013-07-05 23:57:19 -07:00
Sam Lantinga
f35af890ee Allow users to define SDL_STDINC_NO_INLINES if they don't want the inline functions defined.
This is useful, for example, if the standard config defines HAVE_SETENV but you're building with C99 that doesn't include that feature.
2013-06-13 22:30:02 -07:00
Sam Lantinga
d8b6e04ab1 Fixed SDL building with the minimal configuration 2013-06-13 22:10:10 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
David Ludwig
6bf31495f9 WinRT: merged with latest, official, SDL 2.x sources 2013-04-21 12:38:44 -04:00
Ryan C. Gordon
7cdcd5bebb Cleaned up the const_cast mess a little. 2013-04-16 01:38:08 -04:00
David Ludwig
49820874a9 WinRT: merged with latest, official, SDL 2.x sources (at rev. bea100d73d13) 2013-04-14 11:42:55 -04:00
Ryan C. Gordon
f77b979436 More const_cast fixes for C++ apps using the public headers (thanks, Martin!). 2013-04-08 18:37:50 -04:00
Ryan C. Gordon
76435d933b Corrected some stdinc inline functions (thanks, Martin!).
qsort() returns void, so remove the "return" keyword, plus some C++
 const_casting magic.

 Fixes Bugzilla #1785.
2013-04-04 11:35:22 -04:00
Ryan C. Gordon
171ad2ddcd Corrected function signature on SDL_strtod_inline() (thanks, Axel!).
Fixes Bugzilla #1774.
2013-03-29 21:29:57 -04:00
Sam Lantinga
20218f7e77 Fixed bug 1764 - Integer Precision Loss During Compilation
Phil Sampson

/Library/Frameworks/SDL2.framework/Headers/SDL_stdinc.h:345:28: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int'
2013-03-19 22:02:34 -07: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
Sam Lantinga
562dfede27 Fixed more const issues with C++ 2013-03-16 11:00:04 -07:00
Sam Lantinga
561c6ca3d6 Fixed const correctness issue with C++, and fixed building SDL_memcpy4 with 32-bit gcc. 2013-03-15 11:56:28 -07:00
Sam Lantinga
ad801e12f4 Clarified inline function documentation, removed obsolete Metrowerks compiler directive. 2013-03-14 23:10:51 -07:00
Ryan C. Gordon
1fa34e72be Improvements to stdlib.
All SDL_* functions are always available as real symbols, so you can always
link against them as a stable ABI. By default, however, all the things that
might have dithered down to macros in your application are now force-inlined,
to give you the same effect as before and theoretically better performance,
but still solve the classic macro problems.

Elsewhere, we provide real functions for these things that simply wrap the
inline functions, in case one needs to have a real function available.

Also: this exposed bugs: SDL_abs() does something different if you had the
macro vs the libc function, SDL_memcpy() returns a void* in the function
but not the macro, etc.
2013-03-15 01:01:20 -04:00
David Ludwig
db53df0697 WinRT: merged with latest, official, SDL 2.x code 2013-02-23 20:01:46 -05:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
DavidLudwig
3114de8407 Merge with latest, official SDL code 2012-11-04 09:46:59 -05:00
Sam Lantinga
017bece619 We might actually have PI 2012-11-01 00:12:57 -07:00
Sam Lantinga
35feaaaf51 It turns out that UCS2 and UCS4 are defined as big-endian encodings 2012-10-28 13:03:45 -07:00