Commit Graph

201 Commits

Author SHA1 Message Date
Charles Pigott 52f3abba6e Cleanup: Remove unnecessary assert_tcompile macro 2020-12-27 10:30:55 +00:00
TechGeekNZ 716c883737 Fix: Globally apply preprocessor directive coding style
Global; except for the 32-bit SSE blitter, which has some #DEFINEs
in not-very-nice places.
2020-07-03 09:08:46 +02:00
Niels Martin Hansen 9895ced6af Fix: Silence some warnings when building with clang-cl on VS 2019
Clang-cl presents as both _MSC_VER and __clang__ in the preprocessor which makes some things confusing.
2020-06-18 08:56:27 +01:00
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Joe Stringer 66c32533ec Fix: [Cygwin] Fix missing definitions in stdafx
Fix the following compile errors:

In file included from openttd/src/debug.h:15:0,
                 from openttd/src/string.cpp:13:
openttd/src/cpu.h:35:19: error: 'uint' was not declared in this scope
 bool HasCPUIDFlag(uint type, uint index, uint bit);

openttd/src/string.cpp: In function 'char* strcasestr(const char*, const char*)':
openttd/src/string.cpp:548:7: error: 'strncasecmp' was not declared in this scope
   if (strncasecmp(haystack, needle, needle_len) == 0) return const_cast<char *>(haystack);

openttd/src/strgen/strgen_base.cpp: In function 'void EmitPlural(Buffer*, char*, int)':
openttd/src/core/alloc_func.hpp:136:6: error: 'alloca' was not declared in this scope
  (T*)alloca((num_elements) * sizeof(T)))

Signed-off-by: Joe Stringer <joe@wand.net.nz>
2019-10-07 21:36:00 +02:00
glx22 846fc8fe09
Fix: vcpkg used to patch lzma.h to define LZMA_API_STATIC for static builds (#7614) 2019-06-03 00:18:28 +02:00
glx22 cef9a76c3f
Fix #7553: check bounds when loading strings (#7554) 2019-05-01 19:12:37 +02:00
Michael Lutz baf9229931 Codechange: Replace AutoDeleteSmallVector with direct std::vector use in text layout code. 2019-04-09 22:45:15 +02:00
Patric Stout 72c5f2b3ee Remove: DOS support
In 10 years there was no active development on DOS. Although it
turned out to still work, the FPS was very bad. There is little
interest in the current community to look into this.

Further more, we like to switch to c++11 functions for threads,
which are not implemented by DJGPP, the only current compiler
for DOS.

Additionally, DOS is the only platform which does not support
networking. It is the reason we have tons of #ifdefs to support
disabling networking.

By removing DOS support, we can both use c++11 functions for threads,
and remove all the code related to disabling network. Sadly, this
means we have to see DOS go.

Of course, if you feel up for the task, simply revert this commit,
and implement stub c++11 functions for threads and stub functions
for networking. We are more than happy to accept such Pull Request.
2019-03-19 23:22:51 +01:00
Patric Stout 1c5ea33099 Fix: warnings when compiling for a recent version of Haiku
This might break older Haiku versions, but it is hard to tell.
2019-03-05 22:22:00 +01:00
Patric Stout f58db44ff2 Remove: BeOS support (deprecated by Haiku)
In 10 years there is no commit to change how BeOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), BeOS is no longer
support. SDL2 suggests to use Haiku instead of BeOS.
2019-03-05 22:03:00 +01:00
Patric Stout ad30d04b5e Codechange: removed some left-behind __NDS__ references 2019-03-05 22:03:00 +01:00
Patric Stout 7784d77713 Remove: MorphOS / AmigaOS support
In 10 years there is no commit to change how MorphOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), MorphOS is no longer
support. There is an SDL2 port for MorphOS, but it is not maintained
by upstream SDL2, and nobody can currently test it out.

If anyone wants to re-add MorphOS, please do (revert this patch,
fix the problems, and create a Pull Request). If you need any help
doing so, let us know! It is not that we don't like MorphOS, it is
that we don't have anyone fixing the problems :(
2019-03-05 22:03:00 +01:00
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 2018-12-27 18:09:16 +01:00
glx 3be6ab555c Change: use vcpkg integration in Visual Studio
Removes the need for us to provide OpenTTD-useful package
2018-12-26 17:29:11 +01:00
Charles Pigott 63898f61b0 Codechange: Rearrange struct packing defines and make MinGW use _Pragma pack style 2018-07-19 20:24:17 +02:00
Patric Stout aef69443e7 Remove: WinCE support 2018-04-29 15:32:16 +02:00
Patric Stout 85adde7485 Remove: PSP support 2018-04-29 15:32:16 +02:00
Charles Pigott dd6b82d6b2 Codechange: Simplify C++11 check for assert_compile 2018-04-11 18:24:19 +02:00
frosch 24a1b82840 (svn r27916) -Codechange: Enable usage of static_assert for MSVC 2017-09-24 13:35:27 +00:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
michi_cc 35b77450f8 (svn r27380) -Fix: [Win32] Compilation with MSVC2015. 2015-08-10 20:21:29 +00:00
rubidium 889780adce (svn r27109) -Fix (r27102): MinGW compilation 2015-01-02 19:50:43 +00:00
rubidium 730773f5f1 (svn r27102) -Fix [FS#6194]: money values would end up wrong in strings when outside of the bounds of a 32 bits integer 2015-01-01 20:50:43 +00:00
fonsinchen 28bd8a3d83 (svn r27040) -Fix: Don't use GCC diagnostic push/pop if unsupported 2014-10-25 12:32:42 +00:00
frosch 9d209829eb (svn r26922) -Fix: Include strings.h on HAIKU for strcasecmp. Some platforms do not have a strings.h at all, most define the functions in string.h as well. 2014-09-25 20:45:25 +00:00
rubidium 7c4e9dd71d (svn r26771) -Cleanup: remove OTTD2SQ and SQ2OTTD 2014-09-06 17:30:33 +00:00
rubidium 7a00d2e849 (svn r26769) -Codechange [Squirrel]: remove the difference between some platforms having wchar for SQChar and others just char; always use char (and UTF-8) like in the rest of (internal) OpenTTD 2014-09-06 17:20:45 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium 99452c51ce (svn r26500) -Cleanup: remove unused snprintf implementation 2014-04-24 18:40:16 +00:00
zuu 998049a618 (svn r26226) -Fix (r26212): Compilation in visual studio 2008 failed 2014-01-05 10:15:57 +00:00
planetmaker 7b20da8a0a (svn r26223) -Codechange: Silence some compile warnings about unititialized variables in the SSE blitters (MJP) 2014-01-03 18:43:10 +00:00
michi_cc b96ef5c758 (svn r25677) -Codechange: [Win32] There are no 64-bit Windows versions below XP and we can safely assume it as the target platform. 2013-08-05 20:36:58 +00:00
michi_cc e3648455aa (svn r25674) -Fix: [Win32] The console code page for non-Unicode builds is not the normal ANSI code page and definitely not UTF-8 either. 2013-08-05 20:36:47 +00:00
michi_cc 8ce21bb1c0 (svn r25128) -Codechange: [Win32] MSVC 2010 comes with stdint.h. 2013-03-30 13:50:46 +00:00
frosch f73e43818c (svn r24926) -Fix [FS#5373]: Check integer min/max macros individually, and define them if missing. 2013-01-20 15:02:28 +00:00
michi_cc 2caa80f751 (svn r24782) -Codechange: [Win32] Disable MSVC warning about using 'this' in a base member initializer list as we don't use it in any problematic way. 2012-12-03 22:08:03 +00:00
michi_cc 1792c186c7 (svn r24416) -Fix [FS#5231]: [Win32] Unbreak NewGRF MD5 sum calculation. Macros and side effects don't mix, especially if there's some obscure '#define min' in a windows header that nobody thinks of. 2012-07-19 19:06:27 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
smatz 33d283fdb1 (svn r23588) -Codechange: use the 'final' keyword so compiler can optimise out some indirect calls 2011-12-18 17:17:18 +00:00
rubidium 7fd1e1df81 (svn r23198) -Codechange: introduce a free that takes const pointers so we don't need to cast to void/non-const before being able to free 2011-11-12 13:00:29 +00:00
frosch 5ccd091fd1 (svn r22881) -Fix (r22875): GCC warnings on 64bit systems. 2011-09-03 12:45:45 +00:00
michi_cc f227e90c24 (svn r22875) -Codechange: Add some asserts and checks to better prevent overflow of the argument to malloc. (monoid) 2011-09-02 20:54:51 +00:00
alberth 98d5302c63 (svn r22171) -Add: Add settings generator program. 2011-03-03 20:59:59 +00:00
smatz fbfb0ffbf2 (svn r22041) -Codechange: add a check that we called PoolItem::CanAllocateItem() before actually allocating it 2011-02-09 18:55:51 +00:00
glx aa7a587ca3 (svn r21680) -Fix (r21656): of course MSVC complains 2010-12-31 16:13:34 +00:00
rubidium 2de9e2d16b (svn r19853) -Fix [FS#3840]: revert r19781 and apply a more sensible version with the same effect 2010-05-18 21:17:25 +00:00
glx 26bf9a13de (svn r19787) -Fix: compilation with MinGW GCC 4.5.0 and UNICODE 2010-05-11 20:44:58 +00:00
rubidium a8fa3dd3ce (svn r19781) -Fix [FS#3809]: compilation on NetBSD failed (Krille) 2010-05-10 17:11:24 +00:00
rubidium 369dedca89 (svn r19778) -Change: use the value from PATH_MAX (POSIX) for MAX_PATH (Windows/OpenTTD) if it exists 2010-05-10 09:43:49 +00:00
rubidium f642c01fb4 (svn r19698) -Add: macros to get the size/length of a variable within a class 2010-04-23 14:56:14 +00:00
smatz 0ef33548c2 (svn r19614) -Codechange: "it's" => "its" where appropriate 2010-04-12 14:12:47 +00:00
frosch 03c609f019 (svn r19604) -Codechange: Reintroduce assert_tcompile(). 2010-04-11 15:43:54 +00:00
yexo 705955b1e6 (svn r19570) -Add: [NewGRF] support for extended text code 0x9A 11, print qword 2010-04-06 23:45:10 +00:00
yexo 0baa5ff944 (svn r19352) -Fix (r19332): MSVC doesn't have M_PI in math.h 2010-03-06 15:30:40 +00:00
rubidium 77214378ca (svn r19248) -Fix: DOS 'port' did not compile anymore 2010-02-25 13:06:00 +00:00
rubidium e2adecd927 (svn r19177) -Codechange: introduce INT8_MIN/MAX and UINT8_MAX for MSVC. 2010-02-20 22:58:25 +00:00
rubidium b1bd106703 (svn r18862) -Fix [FS#3544]: don't pass AI strings through iconv 2010-01-18 15:41:38 +00:00
smatz 8d95e16ff1 (svn r18057) -Codechange: replace assert_compile() by new one which works with gcc3.3 and removes the need of assert_tcompile() 2009-11-13 15:53:51 +00:00
rubidium 485b5a9c2f (svn r18045) -Fix: GCC 4.5@HEAD not compiling OpenTTD anymore because of a "non-placement deallocation function [is] selected for placement delete", or in other words delete(void *, size_t) is 'magic'.
We implemented these delete(void *, size_t) operator functions because MSVC warned that "no matching operator delete found; memory will not be freed if initialization throws an exception" for new(size_t, size_t).
This disables MSVC warning about this because we do not use exceptions in the (constructors that use the) overridden allocation functions, as such they will never be called; delete(void *) remains necessary though.
2009-11-11 21:15:58 +00:00
frosch b8f8c60839 (svn r17810) -Codechange/Fix: Add assert_tcompile() and use it.
OTTD's traditional assert_compile() does not work inside templates for gcc compilers, static_assert() does though.
  The new assert_tcompile() resolves into static_assert() if present, or into a runtime assert() else.
2009-10-18 20:26:29 +00:00
michi_cc 5f67762a7f (svn r17706) -Codechange: [OSX] Rework the crash handling to use the common CrashLog infrastructure. 2009-10-04 21:08:30 +00:00
rubidium 01ab1c6001 (svn r17606) -Add: initial support for Haiku; a dedicated server with zlib and libpng compiles and links (for me). Something's fishy with the network so it doesn't actually work (yet) 2009-09-21 18:36:33 +00:00
smatz 2e2d00bee7 (svn r17465) -Codechange: use builtin static_assert() for assert_compile() if available 2009-09-07 21:02:10 +00:00
rubidium d916400521 (svn r17453) -Add: crash logger for all Unixy OSes; should work for all, but I don't have all exotic machines so it might break compilation on the more exotic configurations 2009-09-07 12:14:45 +00:00
rubidium 2b144e2ea6 (svn r17450) -Codechange: refactor the windows crash logger so parts of it can be reused by other crash logger implementations 2009-09-07 11:10:49 +00:00
rubidium c9a1f33418 (svn r17410) -Codechange: use the same define for determining whether windows does crash reports instead of using several that aren't necessarily equal 2009-09-03 22:32:08 +00:00
smatz 94988a79f3 (svn r17358) -Fix: compilation was broken for gcc older than 3.4 2009-09-01 20:59:44 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
yexo 94198e09ce (svn r17219) -Cleanup: remove a lot of unused string code 2009-08-19 13:13:32 +00:00
rubidium 6f0d8acf55 (svn r16828) -Codechange: attempt at making OSX compile with the 10.6 SDK too; no guarantees ofcourse... 2009-07-14 17:16:32 +00:00
smatz 93c5300fc5 (svn r16715) -Codechange: add attribute to assert_compile(), so it doesn't warn when used inside function 2009-07-01 21:29:03 +00:00
smatz c03ce4b1c7 (svn r16492) -Remove: support for gcc2. It hasn't been able to compile OTTD for months. All attempts to do another workaround failed. 2009-06-01 11:49:46 +00:00
smatz f5316c5cbd (svn r16269) -Codechange: use gcc's ability to check parameters sent to printf-like functions
-Fix: wrong number of parameters or wrong parameter types sent to printf-like functions at several places
2009-05-10 17:27:25 +00:00
rubidium 8293be426c (svn r15892) -Codechange: [OSX] some type fixes so OpenTTD likes more of the 3.1.x Xcodes. 2009-03-29 19:55:08 +00:00
glx 1692ce8312 (svn r15710) -Fix (r15706): for non MSVC io.h needs to be included before defining unlink. Also remove redundant tchar.h includes as it is already in stdafx.h. 2009-03-14 15:42:53 +00:00
michi_cc b1479bec02 (svn r15706) -Fix: Make sure the filename passed to unlink() is always in file system encoding. 2009-03-14 00:25:59 +00:00
smatz df79660531 (svn r15296) -Cleanup: remove redundant _MSC_VER >= 1400 checks, older versions aren't supported anymore. One check in stdafx.h is enough 2009-01-30 17:54:48 +00:00
rubidium 450b9b7900 (svn r15275) -Fix: SDL adds _GNU_SOURCE to the defined macros even when the compiler doesn't provide the functions promised when that define exists... 2009-01-25 22:51:59 +00:00
rubidium 11da45ee55 (svn r14949) -Cleanup: pointer coding style 2009-01-10 00:31:47 +00:00
rubidium a614dd7174 (svn r14636) -Add: DOS port of OpenTTD, without network support though. 2008-11-26 13:12:45 +00:00
rubidium bb25748a9d (svn r14635) -Change: use S_ISDIR/S_ISREG as x & S_IFREG always results false on platforms when S_IFREG is 0x0000. 2008-11-26 01:07:49 +00:00
skidd13 6043b4574e (svn r14553) -Doc: Add some doxygen comments 2008-11-02 11:05:26 +00:00
glx 2ddb86eea5 (svn r14154) -Fix (r14153): strndup is a GNU extension, so it doesn't exist on all platforms 2008-08-24 17:02:21 +00:00
glx ee256e770a (svn r13390) -Codechange: introduce usererror() for fatal but not openttd related errors. Now all error() will 'crash' openttd after showing the message in win32 releases (MSVC), creating a crash.log and crash.dmp (like the '!' hack used before). On the other hand, usererror() will just close the game. So use error() only when it can be helpful to debugging, else use usererror(). 2008-06-05 20:54:52 +00:00
rubidium 5c5ee7eb57 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings. 2008-05-27 21:41:00 +00:00
glx 5ea41a57b8 (svn r13122) -Fix: WIN32_LEAN_AND_MEAN define is needed for all WIN32 compilers 2008-05-16 17:53:19 +00:00
rubidium 402a1e24ba (svn r12977) -Codechange: remove quite some redundant (duplicate) function declarations. 2008-05-06 22:17:12 +00:00
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 2008-05-06 15:11:33 +00:00
rubidium 4097d81323 (svn r12930) -Add: build support for NetBSD and HP-UX. Patch by ahoka. 2008-04-30 07:39:46 +00:00
smatz f32ecbcadb (svn r12777) -Codechange: rename fatal() and error() in strgen, so it can always have the NORETURN attribute 2008-04-18 21:33:21 +00:00
rubidium 9d8fa486af (svn r12761) -Codechange: lots of minor whitespace coding style fixes around operators. 2008-04-18 04:37:06 +00:00
smatz fb379b522d (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp 2008-04-04 20:34:09 +00:00
rubidium c5814a72ce (svn r12571) -Fix: MorphOS misses INT16_MAX/INT16_MIN. 2008-04-04 19:10:45 +00:00
skidd13 442efcffb0 (svn r12344) -Codechange: Check uint64 bitsize on compiletime too. 2008-03-05 18:51:26 +00:00
rubidium bbdc5a9314 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble. 2008-01-24 18:47:05 +00:00
rubidium 9444eb4484 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik. 2008-01-21 23:55:57 +00:00
glx af59eb2543 (svn r11856) -Revert (r11772): since FS#1335 is solved, we do not need the extra checking and such anymore. 2008-01-15 00:11:28 +00:00
glx 119b03ea70 (svn r11772) -Change: add some extra checking in the hope to find the cause of FS#1335 2008-01-07 00:43:03 +00:00