From e6e3937fa9d1d192bc26b900438b45c0e6eb5be2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 20 Mar 2014 14:49:46 -0700 Subject: Use flexible array members to pad the device and context structs This helps avoid the convoluted math otherwise required to ensure the default slot and listener, respectively, are aligned. --- OpenAL32/Include/alMain.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index b62ad9c7..a00f2d4c 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -686,6 +686,9 @@ struct ALCdevice_struct void *ExtraData; // For the backend's use ALCdevice *volatile next; + + /* Memory space used by the default slot (Playback devices only) */ + ALIGN(16) ALCbyte _slot_mem[]; }; // Frequency was requested by the app or config file @@ -752,6 +755,9 @@ struct ALCcontext_struct const ALCchar *ExtensionList; ALCcontext *volatile next; + + /* Memory space used by the listener */ + ALIGN(16) ALCbyte _listener_mem[]; }; ALCcontext *GetContextRef(void); -- cgit v1.2.3