From dfab521a71eb83087a29383216f9cb0f56766dbd Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 12 Dec 2019 17:51:41 -0800 Subject: [PATCH] specify __thiscall According to https://docs.microsoft.com/en-us/cpp/cpp/thiscall?view=vs-2019, "on ARM and x64 machines, __thiscall is accepted and ignored by the compiler.". So it should be OK to specify this for all win32 --- library/modules/Units.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index 5a50d4069..b16d8e4bd 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -541,7 +541,13 @@ string Units::getRaceName(df::unit* unit) return getRaceNameById(unit->race); } -typedef void (*df_unit_physical_description_fn)(df::unit*, string*); +#ifdef _WIN32 +#define THISCALL __thiscall +#else +#define THISCALL +#endif + +typedef void (THISCALL *df_unit_physical_description_fn)(df::unit*, string*); void df_unit_physical_description(df::unit* unit, string* out_str) { static df_unit_physical_description_fn fn =