Skip to content

Commit

Permalink
openrct2: Fix building on systems without alloca.h
Browse files Browse the repository at this point in the history
  • Loading branch information
alarixnia committed Apr 29, 2024
1 parent e3058b3 commit e7a7cd5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion games/openrct2/distinfo
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
$NetBSD: distinfo,v 1.28 2024/04/25 19:25:11 triaxx Exp $
$NetBSD: distinfo,v 1.29 2024/04/29 13:43:46 nia Exp $

BLAKE2s (openrct2-0.4.10.tar.gz) = 20559c09e6db6302253fa3f9895fa3e715ce60322047eae5d245164046a2c13e
SHA512 (openrct2-0.4.10.tar.gz) = 5ed9a6c790d5603fd1605669294a56908f493f347517d4c3bc8403df91b3678996d76980a42e9e3076b02fba598ee0bd33f2ad080762898cee7c40a865eed89d
Size (openrct2-0.4.10.tar.gz) = 21854907 bytes
SHA1 (patch-src_openrct2-ui_title_TitleSequencePlayer.cpp) = 35a4ee2a47fe6f5bfd536e199a369361cb1b12fa
SHA1 (patch-src_openrct2_core_String.cpp) = ddbf7d88545f260b820879aa178888b60de18cd3
SHA1 (patch-src_openrct2_platform_Platform.Posix.cpp) = 9c052c55489cd2bb4e0f50a71c7cd48f29d3887b
SHA1 (patch-src_openrct2_platform_Platform.h) = bfac1159b28a0ba37b2cb1a5f1be8729aba03cb8
SHA1 (patch-src_openrct2_platform_Platform.macOS.mm) = 63d05c611909b6db778a9feeaaac16ac9bb450b7
Expand Down
18 changes: 18 additions & 0 deletions games/openrct2/patches/patch-src_openrct2_core_String.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$NetBSD: patch-src_openrct2_core_String.cpp,v 1.3 2024/04/29 13:43:46 nia Exp $

All BSD-like platforms have alloca in stdlib.h.

--- src/openrct2/core/String.cpp.orig 2024-04-29 10:11:22.368024600 +0000
+++ src/openrct2/core/String.cpp
@@ -15,8 +15,10 @@
#include <stdexcept>
#include <vector>
#ifndef _WIN32
-# ifndef __FreeBSD__
+# if defined(__linux__) || defined(__sun)
# include <alloca.h>
+# else
+# include <stdlib.h>
# endif
# include <unicode/ucnv.h>
# include <unicode/unistr.h>

0 comments on commit e7a7cd5

Please sign in to comment.