From 449f8c4c1188a3f4a198b7c79a7ceb4da95a98ee Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 11 Apr 2023 00:31:45 +0400 Subject: [PATCH 1/2] Add forgotten CheckAtomic.cmake file --- cmake/CheckAtomic.cmake | 87 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 cmake/CheckAtomic.cmake diff --git a/cmake/CheckAtomic.cmake b/cmake/CheckAtomic.cmake new file mode 100644 index 0000000000..52d93f4f5b --- /dev/null +++ b/cmake/CheckAtomic.cmake @@ -0,0 +1,87 @@ +# atomic builtins are required for threading support. + +INCLUDE(CheckCXXSourceCompiles) +INCLUDE(CheckLibraryExists) + +# Sometimes linking against libatomic is required for atomic ops, if +# the platform doesn't support lock-free atomics. + +function(check_working_cxx_atomics varname) + set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++17") + check_cxx_source_compiles(" +#include +std::atomic x; +std::atomic y; +std::atomic z; +int main() { + ++z; + ++y; + return ++x; +} +" ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +endfunction(check_working_cxx_atomics) + +function(check_working_cxx_atomics64 varname) + set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "-std=c++17 ${CMAKE_REQUIRED_FLAGS}") + check_cxx_source_compiles(" +#include +#include +std::atomic x (0); +int main() { + uint64_t i = x.load(std::memory_order_relaxed); + (void)i; + return 0; +} +" ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +endfunction(check_working_cxx_atomics64) + + +# Check for (non-64-bit) atomic operations. +if(MSVC) + set(HAVE_CXX_ATOMICS_WITHOUT_LIB True) +else() + # First check if atomics work without the library. + check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB) + # If not, check if the library exists, and atomics work with it. + if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) + check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC) + if(HAVE_LIBATOMIC) + list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") + check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB) + if (NOT HAVE_CXX_ATOMICS_WITH_LIB) + message(FATAL_ERROR "Host compiler must support std::atomic!") + endif() + else() + message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.") + endif() + endif() +endif() + +# Check for 64 bit atomic operations. +if(MSVC) + set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True) +else() + # First check if atomics work without the library. + check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB) + # If not, check if the library exists, and atomics work with it. + if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) + check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64) + if(HAVE_CXX_LIBATOMICS64) + list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") + check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB) + if (NOT HAVE_CXX_ATOMICS64_WITH_LIB) + message(FATAL_ERROR "Host compiler must support 64-bit std::atomic!") + endif() + else() + message(FATAL_ERROR "Host compiler appears to require libatomic for 64-bit operations, but cannot find it.") + endif() + endif() +endif() + +if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) + target_link_libraries(openttd atomic) +endif() From afd62e21e2471e82fd878fc64651e5c0aa04bee4 Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 11 Apr 2023 00:36:08 +0400 Subject: [PATCH 2/2] Update to 13.1 (release package) --- .changelog | 214 +++------------------------- .github/workflows/ci-build.yml | 9 ++ .github/workflows/release-macos.yml | 5 +- .ottdrev | 2 +- .release_date | 2 +- .version | 2 +- cmake/CheckAtomic.cmake | 87 +++++++++++ src/rev.cpp.in | 14 +- 8 files changed, 127 insertions(+), 208 deletions(-) create mode 100644 cmake/CheckAtomic.cmake diff --git a/.changelog b/.changelog index 2a5d2826d5..ed660c9395 100644 --- a/.changelog +++ b/.changelog @@ -1,200 +1,20 @@ -13.0 (2023-02-05) +13.1 (2023-04-10) ------------------------------------------------------------------------ -Change #10077: Make maximum loan a positive multiple of the loan interval (#10355) -Fix #10361: [Script] Don't try to give saved data to a dead script (#10433) -Fix #10419: Water infrastructure accounting when building ship depots and docks (#10432) - - -13.0-RC2 (2023-01-28) ------------------------------------------------------------------------- -Feature: Press Ctrl to build a diagonal area of trees (#10342) -Feature: Set a custom number of industries in map generation window (#10340) -Change: Display font status as aa/noaa instead of true/false (#10352) -Fix: [Script] Improved API documentation for scripts (#10413, #10412) -Fix #10255: Reduce basic thickness of linkgraph GUI lines (#10410) -Fix #10220: Don't select unselectable engine as default (#10404) -Fix #10395: When loading old saves, don't forcibly bar level crossings (#10400) -Fix #10377: Bad sorting of rail vehicles when primary variant is missing (#10378) -Fix #10368: Server restarting game caused clients to hit assertion (#10369) -Fix #10362: NewGRF bridges without speed limits (#10365) -Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic (#10364) -Fix: [Script] Switch to OWNER_TOWN prevented OWNER_DEITY test during industry prospecting (#10360) -Fix #10009: Bad overflow protection when taking out loans (#10359) -Fix #9865: Removing files with the console always failed (#10357) -Fix #10057: FallbackParagraphLayout fails to properly wrap (#10356) -Fix #10177: Company list password padlock showed after switching to single player (#10354) -Fix: Various Wide River issues (#10348) -Fix: Link variants to parents when finalising engines (#10346) -Fix #10333: Only show industry prospecting errors to local company (#10338) -Fix #10335: Set initial scrollbar count for object GUI (#10336) -Fix #10331: Starting new company during load must happen after AI start (#10332) -Fix #10309: [SDL] Uninitialized width and height when turning off full screen (#10328) -Fix #10032: Capacities of articulated vehicles in build window (#10326) -Fix: Improve handling of corrupt NewGRF or image files (#10321, #10316) -Fix: [NewGRF] Don't assume engclass 2 should be elrail (#10315) -Fix: [Script] AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227) -Fix #10304: [Scripts] Don't start GS in intro game (#10305) -Fix: [Script] Copy compat files for version 13 (#10303) - - -13.0-RC1 (2023-01-01) ------------------------------------------------------------------------- -Feature: 'font' console command to configure fonts within game (#10278) -Feature: Ctrl-click to bulk edit timetable speeds/waiting times (#10265) -Feature: [NewGRF] Vehicle variants in expandable purchase list (#10220) -Feature: Expand all towns in the scenario editor (#10215) -Add: [NewGRF] Slope-aware and roadtype-specific one-way sprites (#10282) -Change: Display text files in black (#10291) -Change: Make vehicle list dropdown buttons resize to fit strings (#10286) -Change: [NewGRF] Support flipping shorter engines without explicit support (#10262) -Change: Separate ground sprite from foundation sprite offsets (#10256) -Change: Vertically centre sprite font relative to TrueType font (#10254) -Change: [macOS] Set minimum macOS version to 10.13 (#10253) -Change: Use lowered not disabled widget for current vehicle details tab (#10252) -Change: Various improvements to NewGRF sprite aligner (#10249) -Change: reset_engines console command now rerandomises introduction dates and reliability (#10220) -Change: Show error message on failed industry prospecting (#10202) -Fix: Local authority window rating list height ignored icon sizes (#10285) -Fix #10150: Town signs could be truncated when using custom fonts (#10283) -Fix #8971: Resize QueryStrings with interface scale change (#10281) -Fix #10274: Crash when rescanning scripts with GS selected (#10276) -Fix #10151: Use smaller padding for signs (#10272) -Fix #10263: [Script] Restore tile validation for commands (#10269) -Fix: Missing scrollbar for rail/roadtype dropdowns (#10264) -Fix #10260: Incorrect rect height drawing image in vehicle details (#10261) -Fix #10257: Incorrect catenary position on sloped bridge heads (#10258) -Fix: Vertically centre chat prompt (#10250) -Fix #10214: League and graph buttons in toolbar did not have a default action (#10246) -Fix #10242: Allow a space for text shadow when clipping text (#10243) -Fix #10206: Fully disable scripts in intro game (#10241) -Fix #10218: Don't try to create river tiles along incorrect slopes (#10235) -Fix #10208: [NewGRF] Allow using a specific underlay for road/tram tunnels (#10233) -Fix #10224: Don't change fast-forward mode while saving (#10230) -Fix #10147: Sound effect volume slider no longer set volume (#10228) -Fix #10223: Crash when vehicle cloning fails on order cloning (#10225) -Fix: Maximum space for engine preview image was never scaled (#10219) -Fix #10216: Crash when upgrading savegame with crashed vehicles (#10217) -Fix #10212: [Script] Nested ScriptAccounting scopes not restored properly (#10213) -Fix #10114: Incorrect drag-highlight position with non-power-of-2 scaling (#10211) -Fix #10198: Rearrange Intro GUI to make button rows narrower (#10203) -Fix: Missing extra padding when drawing tooltip text (#10201) -Fix: Bad alignment of button icons when using the original baseset (#10200) -Fix: Signal icons incorrectly positioned in UI (#10199) -Fix #10021: Object GUI resized when switching between different objects (#10196) -Fix #9720: Delay start of GS/AI to after loading of savegame (#9745) - - -13.0-beta2 (2022-11-27) ------------------------------------------------------------------------- -Feature: Allow AI/GS to be fully modified in scenario editor (#10152) -Feature: Display power-to-weight ratio in ground vehicle details GUI (#10123) -Feature: Variable interface scaling (with chunky bevels!) (#10114) -Feature: Hotkey to honk a vehicle's horn (#10110) -Feature: Split AI/Game Script configuration windows and add them to world gen window (#10058) -Feature: [GS] Scriptable league tables (#10001) -Feature: Multi-track level crossings (#9931) -Feature: Improved local authority action window (#9928) -Feature: Automatic console command screenshot numbering with a filename ending in '#' (#9781) -Feature: Add buttons to toggle music in the Game Options menu (#9727) -Feature: Contextual actions for vehicles grouped by shared orders (#8425) -Feature: Add cargo filter support to vehicle list (#8308) -Feature: Show the cargoes the vehicles can carry in the vehicle list window (#8304) -Change: Allow building canal by area outside editor (#10173) -Change: Minor improvements to the new Finance GUI (#10168) -Change: Let AI developers edit non-editable AI/Game Script Parameters (#8895) -Change: Allow building docks on clearable watered object tiles (#8514) -Fix #8770: Center vehicle status bar icon (#10178) -Fix: Crash if error message window is too wide for screen. (#10172) -Fix #10155: Network games not syncing company settings properly (#10158) -Fix #10154: Network game desync related to setting a random company face (#10157) -Fix #10011: Incorrect infrastructure totals when overbuilding bay road stop (#10143) -Fix #10117: Object burst limit allowed one fewer object than the setting (#10120) -Fix #10023: Allow negative input in text fields when needed (#10112) -Fix #9908: Fix crash which could occur when a company was deleted when a depot window was open (#9912) - - -13.0-beta1 (2022-10-31) ------------------------------------------------------------------------- -Feature: Airport construction GUI displays infrastructure cost (#10094) -Feature: Purchase land multiple tiles at a time (#10027) -Feature: Add sticky pin & shade widgets to Object Selection UI panel (#10019, #10020) -Feature: Improved handling of HiDPI and mixed-DPI screens (#9994, #9996, #9997, #10064) -Feature: Alternative linkgraph colour schemes (#9866) -Feature: Allow Shift+Insert as paste in edit box (#9836) -Feature: Setting to make the local town authority rubber-stamp all actions (#9833) -Feature: Add/extend console commands to enable screenshot automation (#9771) -Feature: [Linkgraph] Show a tooltip with statistics when hovering a link (#9760) -Feature: Build objects by area (#9709) -Feature: Add setting to hide news about competitors vehicle crash (#9653) -Feature: Ctrl-click to remove fully autoreplaced vehicles from list (#9639) -Feature: Wide rivers on map generation (#9628) -Add: [Script] ScriptCargo::GetWeight to get cargo weights (#9930) -Add: Command line option to skip NewGRF scanning (#9879) -Add: Show video driver name in Game Options window (#9872) -Add: [NewGRF] Map seed as global variable (#9834) -Add: [Script] IndustryType::ResolveNewGRFID to resolve industry id from grf_local_id and grfid (#9798) -Add: [Script] ObjectType::ResolveNewGRFID to resolve object id from grfid and grf_local_id (#9795) -Update: To all the friends we have lost and those we have gained (#10000) -Change: Use the Simulation subcategory to openttd.desktop (#10015) -Change: Constantly update destination of 'any depot' orders (#9959) -Change: Use an indent, not a dash, to list train capacity (#9887) -Change: [NewGRF] Increase vehicle sprite stack from 4 layers to 8 (#9863) -Change: Don't pay Property Maintenance on stations when Infrastructure Maintenance is disabled (#9828) -Change: Improved layout of the finance window (#9827) -Change: [Admin] Bump admin port protocol due to command changes (#9754) -Change: Suppress vehicle age warnings for stopped vehicles (#9718) -Change: Make pf.yapf.rail_firstred_twoway_eol on by default (#9544) -Change: Deliver cargo to the closest industry first (#9536) -Fix: Lots of fixes to how windows handle resizing (#10040, #10042, #10046, #10051, #10056, #10068, #10070, #10098) -Fix: Console commands list_ai output was truncated with a suitably large number of AIs (#10075) -Fix #9876: MacBook Touch Bar crash / render issues w/ 32bpp graphics (#10060) -Fix: Reduce framerate overhead in Train::Tick (#10055) -Fix: Only open scenario editor date query once (#10050) -Fix #10048: Don't relocate company HQ on the same exact location (#10049) -Fix #10038: Missing upper bounds check when loading custom playlists (#10039) -Fix: Wrong string used to determine size of zoomed out station sign (#10036) -Fix: Disable "turn around" button for other companies' road vehicles (#10033) -Fix: Online Players list mouse hover behaviour (#10031) -Fix: [NewGRF] Weirdness of new stations (#10017) -Fix #9854: DrawStringMultiLine() could draw beyond its bounding box (#10014) -Fix: Incorrect player name in online players window (#10013) -Fix #8099: News window zoom level fixes (#10005) -Fix: [NewGRF] Upper 16 random bits should be the same for all station tiles in callback 140 (#9992) -Fix #9989: £0 Net Profit is neither negative nor positive (#9991) -Fix #9804: Only apply sprite_zoom_min setting when sprites available (#9988) -Fix #9972: Add missing fill/resize flags on Framerate window widgets (#9982) -Fix #9935: Use more selectivity when building SSE specific code (#9980) -Fix #9940: Print debuglevel parse errors to console when changed from console (#9979) -Fix #9977: Clearing the console with a large number of lines could cause a crash (#9978) -Fix #9974: Console command getsysdate did not work due to off-by-one error (#9975) -Fix: [NewGRF] Default value of RailVehicleInfo::railveh_type was inconsistent with other default properties (#9967) -Fix #8584: Vehicles with shared orders getting invalid or unexpected start dates (#9955) -Fix #9951: [NewGRF] Scenario editor random industries button broke NewGRF persistent storage (#9952) -Fix: Validation of various internal command parameters that could have allowed a rogue client to crash servers (#9942, #9943, #9944, #9945, #9946, #9947, #9948, #9950) -Fix #9937: Station industries_near incorrect after removing part moved sign (#9938) -Fix: [Script] ScriptRoad::HasRoadType really check for RoadType (#9934) -Fix #9363: Rebuild client list on reinit event (#9929) -Fix #9925: Industry tile layout validation for layouts of only one tile (#9926) -Fix #9918: Reset industy last production year on scenario start (#9920) -Fix #9914: Prevent more useless pathfinder run for blocked vehicles (#9917) -Fix: List a max of four share owners instead of three (#9905) -Fix: [NewGRF] Industry layouts with zero regular tiles should be invalid (#9902) -Fix #9869: Remove docking tile when doing a clear square (#9898) -Fix: New player companies use favorite manager face, if saved (#9895) -Fix: Towns don't build parallel, redundant bridges (#9891) -Fix #9712: Cap town bridge length at original 11-tile limit (#9890) -Fix #9883: Show cost/income float over end tile of rail or road construction (#9889) -Fix #9870: Don't update infrastructure totals when overbuilding object on canal (#9888) -Fix #9877: GS could trigger 'Cost: £0' cost message (#9878) -Fix 44f2ef1: [strgen] Allow gender for {CARGO_SHORT} (#9873) -Fix #9867: Industry::stations_near not filled at industry creation (#9868) -Fix #9853: Incorrect merge of guiflags and flags for osk_activation (#9855) -Fix #6544: Don't join AI company when loading network game in singleplayer (#9794) -Fix: Company values do not properly account for shares (#9770) -Fix #9546: Crash when no industries are present in game (#9726) -Fix #9708: [Linkgraph] Don't assume vehicles have a non-zero max speed (#9693) -Fix #9665: [Linkgraph] Fix travel times of non-direct journeys (#9693) -Fix #8797: Use logical rail length when placing signals (#9652) -Cleanup: [NewGRF] Remove unused flag sprites (#10052) +Add: [NewGRF] Engine name callback for nested variants. (#10399) +Fix: Improve main toolbar tooltips (#10616) +Fix: [NewGRF] Additional validation for Action3 (+others) (#10601) +Fix: Clear button for editbox didn't take account of padding (#10583) +Fix: [Script] Access to enum/consts defined outside of main.nut (#10573) +Fix #10568: Bogus warning when loading a save with a NewGRFs on dedicated servers (#10572) +Fix #10554: Crash when scrolling in the autoreplace window with collapsed variants (#10555) +Fix: Network server highlight invisible with RTL languages. (#10551) +Fix: Client name was not being used as company manager name (#10535) +Fix: Prevent road vehicles on crossing from crashing into the side of a train (#10496) +Fix #10477: [macOS] Calculation for window sizes when using custom fonts was being rounded incorrectly (#10489) +Fix #10486: Crash in debug window when GS started before AIs (#10487) +Fix #10469: [Script] Negative numbers in League Table window were sorted incorrectly (#10471) +Fix #10465: Crash on timeout if user never enters a password for server (#10466) +Fix #10280, #10461: Crash on opening town windows as a spectator (#10462) +Fix #10059: Script config values stored in the config file could cause crashes (#10444) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 4d83725045..ee37284456 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -168,6 +168,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Install dependencies + env: + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + run: | + brew install \ + pkg-config \ + # EOF + - name: Prepare cache key id: key run: | diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index 50df24c7ca..5fe1cb8747 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -26,7 +26,10 @@ jobs: HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1 run: | - brew install pandoc + brew install \ + pandoc \ + pkg-config \ + # EOF - name: Prepare cache key id: key diff --git a/.ottdrev b/.ottdrev index 969dd5c5df..41503e7fdb 100644 --- a/.ottdrev +++ b/.ottdrev @@ -1 +1 @@ -13.0 20230205 0 2ebc601d97aa431e5d8aebfe4a7bbfdabf29dc75 1 1 2023 +13.1 20230410 0 7f987c8d3aaa0dc1648d1351f3bcc7188d2be3a7 1 1 2023 diff --git a/.release_date b/.release_date index c6d8adf23c..337617bda6 100644 --- a/.release_date +++ b/.release_date @@ -1 +1 @@ -2023-02-05 17:19 UTC +2023-04-10 19:45 UTC diff --git a/.version b/.version index f0750610b3..cdb4ac4096 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -13.0 +13.1 diff --git a/cmake/CheckAtomic.cmake b/cmake/CheckAtomic.cmake new file mode 100644 index 0000000000..52d93f4f5b --- /dev/null +++ b/cmake/CheckAtomic.cmake @@ -0,0 +1,87 @@ +# atomic builtins are required for threading support. + +INCLUDE(CheckCXXSourceCompiles) +INCLUDE(CheckLibraryExists) + +# Sometimes linking against libatomic is required for atomic ops, if +# the platform doesn't support lock-free atomics. + +function(check_working_cxx_atomics varname) + set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++17") + check_cxx_source_compiles(" +#include +std::atomic x; +std::atomic y; +std::atomic z; +int main() { + ++z; + ++y; + return ++x; +} +" ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +endfunction(check_working_cxx_atomics) + +function(check_working_cxx_atomics64 varname) + set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_FLAGS "-std=c++17 ${CMAKE_REQUIRED_FLAGS}") + check_cxx_source_compiles(" +#include +#include +std::atomic x (0); +int main() { + uint64_t i = x.load(std::memory_order_relaxed); + (void)i; + return 0; +} +" ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) +endfunction(check_working_cxx_atomics64) + + +# Check for (non-64-bit) atomic operations. +if(MSVC) + set(HAVE_CXX_ATOMICS_WITHOUT_LIB True) +else() + # First check if atomics work without the library. + check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB) + # If not, check if the library exists, and atomics work with it. + if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) + check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC) + if(HAVE_LIBATOMIC) + list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") + check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB) + if (NOT HAVE_CXX_ATOMICS_WITH_LIB) + message(FATAL_ERROR "Host compiler must support std::atomic!") + endif() + else() + message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.") + endif() + endif() +endif() + +# Check for 64 bit atomic operations. +if(MSVC) + set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True) +else() + # First check if atomics work without the library. + check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB) + # If not, check if the library exists, and atomics work with it. + if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) + check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64) + if(HAVE_CXX_LIBATOMICS64) + list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") + check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB) + if (NOT HAVE_CXX_ATOMICS64_WITH_LIB) + message(FATAL_ERROR "Host compiler must support 64-bit std::atomic!") + endif() + else() + message(FATAL_ERROR "Host compiler appears to require libatomic for 64-bit operations, but cannot find it.") + endif() + endif() +endif() + +if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB) + target_link_libraries(openttd atomic) +endif() diff --git a/src/rev.cpp.in b/src/rev.cpp.in index 3b8e68f955..4ad137cd10 100644 --- a/src/rev.cpp.in +++ b/src/rev.cpp.in @@ -35,7 +35,7 @@ bool IsReleasedVersion() * * shows a "M", if the binary is made from modified source code. */ -const char _openttd_revision[] = "${REV_VERSION}"; +const char _openttd_revision[] = "13.1"; /** * The text version of OpenTTD's build date. @@ -48,12 +48,12 @@ const char _openttd_build_date[] = __DATE__ " " __TIME__; /** * The git revision hash of this version. */ -const char _openttd_revision_hash[] = "${REV_HASH}"; +const char _openttd_revision_hash[] = "7f987c8d3aaa0dc1648d1351f3bcc7188d2be3a7"; /** * The year of this version. */ -const char _openttd_revision_year[] = "${REV_YEAR}"; +const char _openttd_revision_year[] = "2023"; /** * Let us know if current build was modified. This detection @@ -63,21 +63,21 @@ const char _openttd_revision_year[] = "${REV_YEAR}"; * (compiling from sources without any version control software) * and 2 is for modified revision. */ -const byte _openttd_revision_modified = ${REV_MODIFIED}; +const byte _openttd_revision_modified = 0; /** * Indicate whether this is a tagged version. * If this is non-0, then _openttd_revision is the name of the tag, * and the version is likely a beta, release candidate, or real release. */ -const byte _openttd_revision_tagged = ${REV_ISTAG}; +const byte _openttd_revision_tagged = 1; /** * To check compatibility of BaNaNaS content, this version string is used. * It should never contain things like "beta", but only the release version * we are compatible with. */ -const char _openttd_content_version[] = "${REV_MAJOR}.${REV_MINOR}"; +const char _openttd_content_version[] = "13.1"; /** * The NewGRF revision of OTTD: @@ -95,4 +95,4 @@ const char _openttd_content_version[] = "${REV_MAJOR}.${REV_MINOR}"; * the "patch" part of the version. To make sure "1.11.0" is smaller than "12.0", we * have to adjust the major by 16. */ -const uint32 _openttd_newgrf_version = (${REV_MAJOR} + 16) << 24 | ${REV_MINOR} << 20 | ${REV_ISSTABLETAG} << 19 | 28004; +const uint32 _openttd_newgrf_version = (13 + 16) << 24 | 1 << 20 | 1 << 19 | 28004;