Commit Graph
192 Commits
Author SHA1 Message Date
Filippos Karapetis e36f24ad69 COMMON: Define int64 and uint64 if HAVE_CONFIG_H isn't set
This fixes compilation of sword25's pluto with Visual Studio. The issue
has been revealed with commit 34169a81. The other data types are
defined in scummsys.h, thus only the missing int64 and uint64 defines
are set.
2013-11-06 18:04:09 +02:00
Eugene Sandulenko e11da51202 COMMON: Make Coverity 6.6.1 happier
Apparently their tools do not include __has_feature clang extension.
I've submitted the bugreport to them but in the meantime let's have this
define in the system.
2013-09-27 11:06:22 +03:00
Johannes Schickel 4790a4abd5 COMMON: Define all Unix98/BSD math constants in scummsys.h.
This should fix compilation on mingw64 with --enable-c++11 and also make sure
the constants are present on other systems for the uncommon case they might be
missing.
2013-08-02 20:02:02 +02:00
D G Turner 17ccd18ed3 COMMON: Add comment explaining reason for defining math constants. 2013-08-02 06:23:52 +01:00
D G Turner 26a9b528da COMMON: Move definition of math constants to scummsys header.
This should have no effect on common/math.h as scummsys is included at
the top anyway, but this will fix compilation on some toolchains when
strict ANSI language compliance is enabled i.e. -std=c++11, rather than
-std=gnu11.

This causes an issue as a side effect is to set a guard which disables
various non-standard defines in the system headers i.e. the M_PI and
M_SQRT1_2 constant definitions in the MinGW x86_64 toolchain on
buildbot.

By moving this into scummsys.h after the point of system math.h
inclusion, we can ensure that M_PI etc. are always present.
2013-07-31 06:18:58 +01:00
Willem Jan Palenstijn 2d1fd3b554 ALL: Fix typo (existant->existent) 2013-02-23 22:07:32 +01:00
Johannes Schickel 178365f5e9 COMMON: Add a header for C++11 keywords for pre-C++11 compilers.
This currently adds defines for nullptr and override, so we can use them in
pre-C++11 compilers, while taking advantage of them with C++11 compilers.
2013-01-09 07:53:41 +01:00
Johannes Schickel 223794fb38 ALL: Make use of defined() for the preprocessor consistent.
This does not change the use of defined for some NDS source files, since they
seem to be (based on?) third party code.
2012-03-17 22:02:44 +01:00
Johannes Schickel 2c0bd426fc COMMON: Use defined() instead of defined in preprocessor macros.
Thanks to clone2727 for noticing this.
2012-03-17 21:23:42 +01:00
Christoph Mallon a64b5e2a77 ALL: Use GCC_ATLEAST(). 2012-03-17 20:09:49 +01:00
Christoph Mallon 757fa01a28 COMMON: Add GCC_ATLEAST(major, minor) to simplify testing for versions of GCC. 2012-03-17 20:09:45 +01:00
Alyssa Milburn 5647637ea2 COMMON: Move <new> include into scummsys.h.
The header contains forbidden symbols on some platforms, and the
simplest solution seems to be to include it here. This also includes
it from all the portdefs.h files, except the Symbian one. Probably
the FIXME and the #if can be removed once it's known to work.
2011-11-17 12:46:44 +01:00
anotherguest 8475d7f142 Symbian: Must define scumm_va_copy also for Symbian 2011-10-11 09:10:21 +02:00
Max Horn e792adb1b8 COMMON: Add vformat() function (Common::String analog to vsprintf) 2011-06-18 01:36:15 +02:00
Johannes Schickel d2a8e8023e COMMON: Implement two simple workaround wrappers for _vsnprintf and _snprintf for MSVC.
This should assure vsnprintf and snprintf will now also always null
terminate the result even for MSVC.

Currently the functions are placed in scummsys.h, but that causes us
to include two standard C library headers there (for MSVC at least).
This is not particulary nice, so we should think of a better solution
here.
2011-06-01 22:18:28 +02:00
Johannes Schickel 007a33515f COMMON: Add note about us defining vsnprintf as _vsnprintf for older MSVC versions. 2011-06-01 17:31:33 +02:00
Johannes Schickel 2f8e9b954e COMMON: Add comment about MSVC's _snprintf.
This includes a FIXME, since _snprintf behaves differently to snprintf.
Not only in the return value (which is a minor difference, since we usually
do not use it), but also since it does not always include a terminating null.
2011-06-01 17:28:59 +02:00
Max Horn a4d105c902 COMMON: Move SDL endian check a bit down 2011-06-01 10:43:02 +02:00
Max Horn c86a6c466f COMMON: Include SDL_endian.h instead of SDL_byteorder.h 2011-05-31 18:08:25 +02:00
Max Horn 811b257014 COMMON: Simplify OverlayColor definition
This typedef still should be moved somewhere else. Maybe a header file
of its own?
2011-05-31 14:22:19 +02:00
Max Horn e06ca6560f COMMON: Move scumm_str(n)icmp declaration to str.h 2011-05-31 14:19:25 +02:00
Max Horn 1c198cec1b COMMON: Move some weird WinCE/MSVC snprintf-#define around 2011-05-31 14:06:47 +02:00
Max Horn 8654e846e4 COMMON: Shorten endianess / mem align guessing logic in scummsys.h 2011-05-31 14:05:37 +02:00
Max Horn 2d6be5d077 COMMON: Move more stuff from scummsys.h to portdefs.h 2011-05-31 13:56:28 +02:00
Max Horn 9c3e2e43bd COMMON: Move some code from scummsys.h to relevant portdefs.h files 2011-05-31 13:48:03 +02:00
Max Horn 8e3aafd30d COMMON: Provide our own implementations for scumm_str(n)icmp
This takes up a tiny little bit of extra binary size, but gets
rid of some awful #ifdef hackery.
2011-05-23 19:12:25 +02:00
Oystein Eftevaag 305c13a4aa IPHONE/OSX: Updated xcode project 2011-05-16 22:26:58 -04:00
Max Horn 0bbb412249 COMMON: RemoveAvoid redundant typedefs if config.h is present 2011-05-14 10:41:17 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn 8754c86686 COMMON: Refactor typedefs a bit 2011-05-10 11:02:08 +02:00
Max Horn 76780268f2 COMMON: Refactor scummsys.h 2011-05-09 16:23:22 +02:00
Max Horn 3920cfe69e COMMON: Do not #undef _MSC_VER 2011-05-09 16:23:22 +02:00
Max Horn 49ab6d0289 COMMON: If config.h is present, don't use hardcoded settings from scummsys.h 2011-05-09 16:23:22 +02:00
Max Horn dfff22e56b COMMON: Unify definition of scumm_str(n)icmp 2011-05-09 16:23:22 +02:00
Max Horn db82d282ea N64: Remove (u)int64 typedefs from common/scummsys.h 2011-05-09 16:23:21 +02:00
Max Horn 59e77ed667 ALL: Mark printf and various other symbols as forbidden
Right now, a few places in the frontend code still use printf and
consorts. We mark the affected files with a FIXME for now, and
add a dedicated exception for each. To be fixed!

Also tweak FORBIDDEN_SYMBOL_REPLACEMENT to hopefully really always
enforce a compiler error
2011-05-02 16:31:31 +02:00
Max Horn a8b3501252 COMMON: Drop totally obsolete & outdated DEC C++ 'support' 2011-04-12 16:41:36 +02:00
md5 23aabc950a COMMON: Removed custom PI define (M_PI should be used instead) 2011-03-19 02:39:38 +02:00
md5 3924fc0bad COMMON: Enable math constants under Visual Studio 2011-03-19 01:56:10 +02:00
Johannes Schickel 9f6dc040ff CONFIGURE: Add basic support for ICC.
svn-id: r55862
2011-02-10 01:05:48 +00:00
Lars Persson 714263d5e9 COMMON: Use user include instead of system include to remove lots of compiler warnings for symbian
svn-id: r54371
2010-11-19 12:47:52 +00:00
Max Horn 44393b2dc8 ALL: Add code to help stop people from accidentally using "bad" APIs
A new header file common/forbidden.h is included by scummsys.h and it
re-#defines numerous symbols like fopen(), fread(), system(), etc. with
garbage, in order to provoke compile errors in any code using them.

If a .cpp file really *must* use any of these (e.g. because it is a
backend file), then these redefinitions can be disabled by #defining
FORBIDDEN_SYMBOL_ALLOW_ALL as the first thing in the .cpp file. Whenever
this is done, an explanatory comment should be added.

Note that this system cannot catch all "bad" usages (notably the Lua
code in the sword25 engine), as it can only work if scummsys.h is
included.

svn-id: r53961
2010-10-30 21:27:42 +00:00
Jordi Vilalta Prat 8388e0dfea JANITORAL: Clean trailing whitespaces.
svn-id: r53160
2010-10-12 02:18:11 +00:00
Yotam Barnoy f7f743ac31 PSP: switch from wrapping memcpy to defining our own memcpy
The advantage is that we get to do inlining and even use lwl and lwr instructions where appropriate. We have to do it ourselves because the PSP doesn't tolerate built-in instructions, but also we have a more efficient memcpy than the lib's.

svn-id: r52817
2010-09-20 14:10:44 +00:00
Eugene Sandulenko 26dc4c2425 DINGOO: new port. Patch #3039277
svn-id: r52210
2010-08-19 12:43:37 +00:00
Max Horn 0b48a71c99 Remove PalmOS port
svn-id: r50964
2010-07-17 18:41:38 +00:00
Fabio Battaglia a108df30a7 Add Nintendo 64 port to trunk.
svn-id: r46773
2009-12-30 21:11:38 +00:00
Max Horn 5b562407c1 COMMON: Replace NORETURN by NORETURN_PRE & NORETURN_POST
svn-id: r46205
2009-11-29 21:56:10 +00:00
Max Horn 016f343ca7 Remove SCUMMVM_USE_LONG_INT
svn-id: r46103
2009-11-23 22:27:52 +00:00
Max Horn c3905f60ee Move definition of stdint types to the only file that needs them (mpeg_player.h)
svn-id: r45820
2009-11-10 22:18:41 +00:00