[Scummvm-git-logs] scummvm master -> 392b894547f05f3dc4497dd12ac7f21fec9606e3
lephilousophe
noreply at scummvm.org
Fri Jul 14 18:48:29 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
29a02151d1 COMMON: Only apply alignment on supported platforms
392b894547 TONY: Only apply alignment on supported platforms
Commit: 29a02151d1fb4c3838070439fa76e2e82439510c
https://github.com/scummvm/scummvm/commit/29a02151d1fb4c3838070439fa76e2e82439510c
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-07-14T20:48:13+02:00
Commit Message:
COMMON: Only apply alignment on supported platforms
Changed paths:
common/coroutines.h
configure
diff --git a/common/coroutines.h b/common/coroutines.h
index 1861ee53f88..16d75e41df9 100644
--- a/common/coroutines.h
+++ b/common/coroutines.h
@@ -307,7 +307,10 @@ struct PROCESS {
int sleepTime; ///< Number of scheduler cycles to sleep.
uint32 pid; ///< Process ID.
uint32 pidWaiting[CORO_MAX_PID_WAITING]; ///< Process ID(s) that the process is currently waiting on.
- alignas(max_align_t) char param[CORO_PARAM_SIZE]; ///< Process-specific information.
+#ifndef NO_CXX11_ALIGNAS
+ alignas(max_align_t)
+#endif
+ char param[CORO_PARAM_SIZE]; ///< Process-specific information.
};
typedef PROCESS *PPROCESS;
diff --git a/configure b/configure
index 758ce398b7b..9afd6cd3333 100755
--- a/configure
+++ b/configure
@@ -2379,6 +2379,25 @@ else
define_in_config_if_yes yes 'NO_CXX11_NULLPTR_T'
fi
+# Check if alignas and alignof are available
+echo_n "Checking if C++11 alignas and alignof keywords are available... "
+cat > $TMPC << EOF
+#include <stddef.h>
+struct test {
+ char c;
+ alignas(max_align_t) size_t _size;
+};
+static const size_t LENGTH = alignof(max_align_t);
+int main(int argc, char *argv[]) { return 0; }
+EOF
+cc_check
+if test "$TMPR" -eq 0; then
+ echo yes
+else
+ echo no
+ define_in_config_if_yes yes 'NO_CXX11_ALIGNAS'
+fi
+
#
# Determine extra build flags for debug and/or release builds
#
Commit: 392b894547f05f3dc4497dd12ac7f21fec9606e3
https://github.com/scummvm/scummvm/commit/392b894547f05f3dc4497dd12ac7f21fec9606e3
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-07-14T20:48:13+02:00
Commit Message:
TONY: Only apply alignment on supported platforms
Changed paths:
engines/tony/mpal/expr.cpp
engines/tony/mpal/memory.h
diff --git a/engines/tony/mpal/expr.cpp b/engines/tony/mpal/expr.cpp
index 68a1458ebda..2f4ded5c7fc 100644
--- a/engines/tony/mpal/expr.cpp
+++ b/engines/tony/mpal/expr.cpp
@@ -33,7 +33,14 @@ namespace Tony {
namespace MPAL {
-static const size_t EXPR_LENGTH_SIZE = alignof(max_align_t);
+static const size_t EXPR_LENGTH_SIZE =
+#ifndef NO_CXX11_ALIGNAS
+ alignof(max_align_t)
+#else
+ sizeof(byte)
+#endif
+ ;
+
/**
* Duplicate a mathematical expression.
diff --git a/engines/tony/mpal/memory.h b/engines/tony/mpal/memory.h
index ca021637df2..3bdec7e6743 100644
--- a/engines/tony/mpal/memory.h
+++ b/engines/tony/mpal/memory.h
@@ -35,7 +35,10 @@ struct MemoryItem {
uint32 _id;
uint32 _size;
int _lockCount;
- alignas(max_align_t) byte _data[1];
+#ifndef NO_CXX11_ALIGNAS
+ alignas(max_align_t)
+#endif
+ byte _data[1];
// Casting for access to data
operator void *() { return &_data[0]; }
More information about the Scummvm-git-logs
mailing list