Commit graph

117 commits

Author SHA1 Message Date
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
91e0a1d094 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Sam Lantinga
d53007ae0e Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h
Ryan C. Gordon

We still include iconv.h in SDL_stdinc.h, probably because this header might have referenced the native iconv functions and types directly. Since these are hidden behind a stable ABI now and never just a #define for the system iconv, we shouldn't need this header included from a public SDL header anymore, slowing down external apps compiles and pulling tons of stuff into the namespace.
2016-10-07 16:44:42 -07:00
Sam Lantinga
b26da9ce71 Fixed bug 3336 - Failure to build with MinGW-w64
Kai Sterker
There are already patches available from mingw64 that fix the issue

https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-SDL2

With those applied, I could compile SDL2 without problems. But of course, it would be preferable if SDL built cleanly from source.
2016-10-01 10:28:00 -07:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
14d69c7f05 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
12d065e7e1 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.

--HG--
extra : rebase_source : 573ae86baa2648ab2b84479f2d8058e2c6dec009
2015-03-02 21:36:45 -05:00
Ryan C. Gordon
db239776a8 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
5f2e37555d ugh.. stray character 2014-12-03 12:47:39 -05:00
Edward Rudd
8ddea9cb66 fix SDL_PRIs64 on windows compilers.. (should end in d) 2014-12-03 12:45:04 -05:00
Edward Rudd
f39c6e8a6f switch to use SDL_PRI* macros for long long formatting everywhere. 2014-12-03 12:23:17 -05:00
Sam Lantinga
b3e4782510 Removed SDL_round() because the license wasn't compatible with zlib 2014-08-17 13:11:55 -07:00
Sam Lantinga
5acb7c63d1 Added SDL_round(), contributed by Benoit Pierre - thanks! 2014-08-16 23:23:15 -07:00
Sam Lantinga
29eae011c5 Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings 2014-06-23 11:06:50 -07:00
Sam Lantinga
9e25cdad8c 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
d09a0ff3a6 Fixed typo in source comment. 2014-06-08 12:51:02 +02:00
Sam Lantinga
276b7efecd Added SDL_sqrtf(), SDL_tan(), SDL_tanf() 2014-06-07 18:20:01 -07:00
Sam Lantinga
53d9d2c232 Added annotations to help code analysis tools
CR: Bruce Dawson
2014-06-04 10:56:56 -07:00
Sam Lantinga
a7d2ebb8d6 Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
David Ludwig
ebfac58560 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
3003efb88d Added SDL_vsscanf().
--HG--
extra : rebase_source : 088d093790a7ed95d73c307523587e95c8356f4b
2013-11-24 23:35:38 -05:00
Sam Lantinga
e29d5bd5db 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.

--HG--
extra : rebase_source : 3c92b648c11366af38fac18df85eb7d5da6fe292
2013-11-16 18:56:02 -08:00
Sam Lantinga
0606843ed8 Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning 2013-11-03 09:42:23 -08:00
David Ludwig
59df93166d WinRT: merged with SDL 2.0.1 codebase 2013-10-27 21:26:46 -04:00
David Ludwig
76880e2b8b WinRT: more "Windows RT" to "WinRT" renaming 2013-08-27 12:20:35 -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
Gabriel Jacobo
298ce1c1a7 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
271e0d67c4 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Sam Lantinga
9c43b29ef9 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
98053e8a85 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
287d2529bd 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
cfd541e89c 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
6971a5dd1c 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
5aa3492ef8 Fixed SDL building with the minimal configuration 2013-06-13 22:10:10 -07:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
David Ludwig
6a01cdf7f3 WinRT: merged with latest, official, SDL 2.x sources 2013-04-21 12:38:44 -04:00
Ryan C. Gordon
8069b5a7f3 Cleaned up the const_cast mess a little.
--HG--
extra : rebase_source : d3ca36c9e2438c114afe339d1cbf704d318b6185
2013-04-16 01:38:08 -04: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
8d0b0c59bf More const_cast fixes for C++ apps using the public headers (thanks, Martin!). 2013-04-08 18:37:50 -04:00
Ryan C. Gordon
45592bbbee 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
8c6b9f4743 Corrected function signature on SDL_strtod_inline() (thanks, Axel!).
Fixes Bugzilla #1774.
2013-03-29 21:29:57 -04:00
Sam Lantinga
db141a68e8 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
3afbe992d5 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
f227d45db9 Fixed more const issues with C++ 2013-03-16 11:00:04 -07:00
Sam Lantinga
77815e31db 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
6ea7a3490d Clarified inline function documentation, removed obsolete Metrowerks compiler directive. 2013-03-14 23:10:51 -07:00
Ryan C. Gordon
7e934f8f75 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