summaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-19 02:11:04 -0700
committerChris Robinson <[email protected]>2014-04-19 02:11:04 -0700
commit59fc9aac0ee41518dba0cbd2f1518decffeaa480 (patch)
treeac9793a8e3015e595b2f679b82b7f11e4472f717 /OpenAL32/Include
parent8badd3740e1a2e13affb4553c69ca44b1649035b (diff)
Use C11 alignas when available
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alAuxEffectSlot.h4
-rw-r--r--OpenAL32/Include/alMain.h17
-rw-r--r--OpenAL32/Include/alu.h10
3 files changed, 15 insertions, 16 deletions
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h
index 264f8f73..75eb87ca 100644
--- a/OpenAL32/Include/alAuxEffectSlot.h
+++ b/OpenAL32/Include/alAuxEffectSlot.h
@@ -4,6 +4,8 @@
#include "alMain.h"
#include "alEffect.h"
+#include "align.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -72,7 +74,7 @@ typedef struct ALeffectslot {
volatile ALenum NeedsUpdate;
ALeffectState *EffectState;
- ALIGN(16) ALfloat WetBuffer[1][BUFFERSIZE];
+ alignas(16) ALfloat WetBuffer[1][BUFFERSIZE];
RefCount ref;
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 3247aa96..ad305c4e 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -31,7 +31,7 @@
#endif
#endif
-
+#include "align.h"
#include "atomic.h"
#include "uintmap.h"
#include "vector.h"
@@ -271,11 +271,6 @@ ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname,
/* KDevelop's parser doesn't recognize the C99-standard restrict keyword, but
* recent versions (at least 4.5.1) do recognize GCC's __restrict. */
#define restrict __restrict
-/* KDevelop won't see the ALIGN macro from config.h when viewing files that
- * don't include it directly (e.g. headers). */
-#ifndef ALIGN
-#define ALIGN(x)
-#endif
#endif
@@ -682,11 +677,11 @@ struct ALCdevice_struct
ALuint SamplesDone;
/* Temp storage used for mixing. */
- ALIGN(16) ALfloat SampleData1[BUFFERSIZE];
- ALIGN(16) ALfloat SampleData2[BUFFERSIZE];
+ alignas(16) ALfloat SampleData1[BUFFERSIZE];
+ alignas(16) ALfloat SampleData2[BUFFERSIZE];
// Dry path buffer mix
- ALIGN(16) ALfloat DryBuffer[MaxChannels][BUFFERSIZE];
+ alignas(16) ALfloat DryBuffer[MaxChannels][BUFFERSIZE];
/* Running count of the mixer invocations, in 31.1 fixed point. This
* actually increments *twice* when mixing, first at the start and then at
@@ -708,7 +703,7 @@ struct ALCdevice_struct
ALCdevice *volatile next;
/* Memory space used by the default slot (Playback devices only) */
- ALIGN(16) ALCbyte _slot_mem[];
+ alignas(16) ALCbyte _slot_mem[];
};
// Frequency was requested by the app or config file
@@ -779,7 +774,7 @@ struct ALCcontext_struct
ALCcontext *volatile next;
/* Memory space used by the listener */
- ALIGN(16) ALCbyte _listener_mem[];
+ alignas(16) ALCbyte _listener_mem[];
};
ALCcontext *GetContextRef(void);
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index c1aa143d..f931b737 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -13,7 +13,9 @@
#include "alMain.h"
#include "alBuffer.h"
#include "alFilter.h"
+
#include "hrtf.h"
+#include "align.h"
#define F_PI (3.14159265358979323846f)
@@ -38,15 +40,15 @@ extern "C" {
#endif
typedef struct HrtfState {
- ALIGN(16) ALfloat History[MAX_INPUT_CHANNELS][SRC_HISTORY_LENGTH];
- ALIGN(16) ALfloat Values[MAX_INPUT_CHANNELS][HRIR_LENGTH][2];
+ alignas(16) ALfloat History[MAX_INPUT_CHANNELS][SRC_HISTORY_LENGTH];
+ alignas(16) ALfloat Values[MAX_INPUT_CHANNELS][HRIR_LENGTH][2];
} HrtfState;
typedef struct HrtfParams {
ALfloat Gain;
ALfloat Dir[3];
- ALIGN(16) ALfloat Coeffs[MAX_INPUT_CHANNELS][HRIR_LENGTH][2];
- ALIGN(16) ALfloat CoeffStep[MAX_INPUT_CHANNELS][HRIR_LENGTH][2];
+ alignas(16) ALfloat Coeffs[MAX_INPUT_CHANNELS][HRIR_LENGTH][2];
+ alignas(16) ALfloat CoeffStep[MAX_INPUT_CHANNELS][HRIR_LENGTH][2];
ALuint Delay[MAX_INPUT_CHANNELS][2];
ALint DelayStep[MAX_INPUT_CHANNELS][2];
ALuint IrSize;