From 100c059157a67345546b256500ed08b146dab2c1 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 22 May 2014 07:40:22 -0700 Subject: Mark some functions as const --- OpenAL32/Include/alMain.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'OpenAL32/Include') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 63787251..6bbcfadb 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -306,9 +306,11 @@ typedef ptrdiff_t ALsizeiptrEXT; #endif #endif -#ifdef HAVE_GCC_FORMAT +#ifdef __GNUC__ +#define CONST_FUNC __attribute__((const)) #define PRINTF_STYLE(x, y) __attribute__((format(printf, (x), (y)))) #else +#define CONST_FUNC #define PRINTF_STYLE(x, y) #endif @@ -577,8 +579,8 @@ enum DevFmtChannels { DevFmtChannelsDefault = DevFmtStereo }; -ALuint BytesFromDevFmt(enum DevFmtType type); -ALuint ChannelsFromDevFmt(enum DevFmtChannels chans); +ALuint BytesFromDevFmt(enum DevFmtType type) CONST_FUNC; +ALuint ChannelsFromDevFmt(enum DevFmtChannels chans) CONST_FUNC; inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type) { return ChannelsFromDevFmt(chans) * BytesFromDevFmt(type); @@ -841,8 +843,8 @@ void SetRTPriority(void); void SetDefaultChannelOrder(ALCdevice *device); void SetDefaultWFXChannelOrder(ALCdevice *device); -const ALCchar *DevFmtTypeString(enum DevFmtType type); -const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans); +const ALCchar *DevFmtTypeString(enum DevFmtType type) CONST_FUNC; +const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans) CONST_FUNC; extern FILE *LogFile; -- cgit v1.2.3