aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-22 07:40:22 -0700
committerChris Robinson <[email protected]>2014-05-22 07:40:22 -0700
commit100c059157a67345546b256500ed08b146dab2c1 (patch)
tree1c03de0e4e0891790d781090ad3a7f26a85b8598
parentecdfcdbfa579f07cd91f6796ee8579a470aa68b3 (diff)
Mark some functions as const
-rw-r--r--OpenAL32/Include/alMain.h12
1 files changed, 7 insertions, 5 deletions
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;