Commit graph

25 commits

Author SHA1 Message Date
r-a-sattarov
6ed10c1dac Workaround for MCST-LCC compiler < 1.28 version
mcst-lcc < 1.28 does not support __builtin_alloca_with_align()
Ref: http://mcst.ru/lcc
2024-02-06 17:20:05 +01:00
Daniel Gibson
6f35ce045d _alloca16(): Use __builtin_alloca_with_align() on GCC
we're already using it with MinGW, no reason not to use it with
"normal" GCC on Unix (and clang, which also defines __GNUC__) as well.
2023-03-28 19:14:29 +02:00
Daniel Gibson
dee76dbb21 Increase stack size on Windows to 8MB, so huge models work
The HD version of the "Birdman" Hellknight model crashed the game,
because on Linux it triggered the 600KB _alloca() assertion and on
Windows (that didn't have such an assertion up to this commit) it
overflowed the stack.
Thde default stacksize on Windows is 1MB, increasing that to 8MB fixes the
problem (in Doom3 1.3.1 it was 4MB).
I also implemented the _alloca() size check assertion for Windows, and
increased the allowed size to 2MB (so it can be safely called multiple
times per function)
Model: https://www.moddb.com/mods/birdman-doom3/downloads/birdman-doom3-v11
2023-01-21 19:26:11 +01:00
Daniel Gibson
6940d7f678 Fix build with Visual Studio's builtin CMake support
For some reason MSVCs integrated CMake doesn't set CMAKE_GENERATOR_PLATFORM
so my CPU arch detection magic in CMakeLists.txt didn't work in that case..
Now (when using MSVC) the CPU architecture (D3_ARCH) is set in
neo/sys/platform.h instead.
2022-12-31 02:01:52 +01:00
Daniel Gibson
4f74c15afe Make sure MAX_OSPATH has sane size; fix some typos 2022-01-16 06:02:40 +01:00
SiliconExarch
4f0c54f63f Fix compatibility with Mac OSX 10.4 and 10.5
- Fix build with SDL <=2.0.3
  SDL_GetGlobalMouseState was introduced in 2.0.4
  (which doesn't support OSX 10.5 or older)
- Don't include execinfo.h on Mac OS X 10.4
  This file isn't included in the 10.4 SDK
- Use custom typedef for PFNGLSTENCILOPSEPARATEPROC on OSX 10.4/10.5
  because the system OpenGL headers for those versions don't have it
2021-10-12 19:07:41 +02:00
Daniel Gibson
b4a029c234 Fix ID_MAYBE_INLINE on non-Windows platforms 2020-01-16 20:43:38 +01:00
Daniel Gibson
b756276b54 ID_MAYBE_INLINE for not-forced inlining
On Windows, ID_INLINE does __forceinline, which is bad if the function
calls alloca() and is called in a loop..
So use just __inline there so the compiler can choose not to inline
(if called in a loop).
This didn't cause actual stack overflows as far as I know, but it could
(and MSVC warns about it).
2020-01-11 16:15:34 +01:00
Daniel Gibson
aca8c24c3a Assertions in _alloca() and _alloca16() for too big stack allocations
not on Windows though, for some reason MSVC doesn't like my ugly
hack to add an assert() to the _alloca16() macro :-/
2020-01-11 16:14:43 +01:00
Kalamatee
46279bf11f import AROS changes 2017-04-02 00:42:28 +01:00
dhewg
0b08240e02 Remove all OS specific gamepak code
Useless since there are no gamepaks.
2012-07-04 02:18:48 +02:00
dhewg
db4aca78d6 Get rid of CPU_EASYARGS
Never use the event callbacks with mismatching prototypes.
2012-01-14 15:19:38 +01:00
dhewg
b7ce0ef149 CMake: Use config.h for BUILD_OS and BUILD_CPU
This fixes, among others, FreeBSD 64bit builds where the build
system used a "amd64" suffix and runtime "x86_64".
2012-01-14 15:19:12 +01:00
dhewg
545d98fc08 CMake: Create config.h
Use config.h for configure time settings.
2012-01-14 15:09:27 +01:00
dhewg
4927299cb9 Include malloc.h for alloca for MinGW
Newer versions of MinGW do not seem to require this, but older
ones do.
2012-01-07 15:40:22 +01:00
spiral
1507a657d4 Add ID_GAME_API for dllexport/attribute(visibility)
Delete obsolete Game.def exports files
2011-12-23 13:24:47 +01:00
spiral
13bab7a7e5 Remove MWERKS stuff 2011-12-23 13:04:21 +01:00
spiral
7e5795dd56 Add missing includes for MSVC
- MSVC doesn't provide C99 headers
- Default to min. req. 64Mb video mem if no COM present
- Move misplaced __attribute__((packed)) from MSVC to MinGW
2011-12-22 11:07:01 +01:00
dhewg
e7482b4957 Port all thread related functions to SDL
Setting thread priorities has been dropped (it is not portable).
The background download thread now exits gracefully.
g_threads is not public anymore.
2011-12-22 10:38:37 +01:00
dhewg
0f3c2ebf52 Use SDL for everything endian 2011-12-21 17:40:38 +01:00
dhewg
966a380793 Move BuildDefines.h include to platform.h 2011-12-19 20:33:09 +01:00
dhewg
5d8d3b726e Include cstddef for ptrdiff_t in platform.h 2011-12-19 20:33:09 +01:00
dhewg
90a53d0977 Move idlib typedefs to platform.h 2011-12-19 20:33:03 +01:00
dhewg
cf57db42e9 Move common includes from precompiled.h to platform.h 2011-12-19 20:31:32 +01:00
dhewg
96ef0754e2 Split platform specific code from precompiled.h
New header sys/platform.h.
2011-12-19 20:31:28 +01:00