aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h6
-rw-r--r--OpenAL32/Include/alSource.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 1c1d9d90..e93d3db4 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -54,12 +54,6 @@ constexpr inline size_t countof(const T(&)[N]) noexcept
#endif
#endif
-/* Calculates the size of a struct with N elements of a flexible array member.
- * GCC and Clang allow offsetof(Type, fam[N]) for this, but MSVC seems to have
- * trouble, so a bit more verbose workaround is needed.
- */
-#define FAM_SIZE(T, M, N) (offsetof(T, M) + sizeof(((T*)NULL)->M[0])*(N))
-
using ALint64 = ALint64SOFT;
using ALuint64 = ALuint64SOFT;
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index d02dbd5b..0343a943 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -21,6 +21,12 @@ struct ALbufferlistitem {
ALsizei max_samples;
ALsizei num_buffers;
ALbuffer *buffers[];
+
+ static constexpr size_t Sizeof(size_t num_buffers) noexcept
+ {
+ return maxz(offsetof(ALbufferlistitem, buffers) + sizeof(ALbuffer*)*num_buffers,
+ sizeof(ALbufferlistitem));
+ }
};