aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-19 09:42:03 -0700
committerChris Robinson <[email protected]>2014-04-19 09:42:03 -0700
commitbb969c3cccae159049adc20b2e13a17556331aae (patch)
tree04195592561e9e0acb19cf48bfaa42b0c05234d4
parent043e25b6024119c28eb8d6d4f057ab01847a3b95 (diff)
Add a SZFMT macro for a size_t string formatter
-rw-r--r--Alc/alcConfig.c4
-rw-r--r--OpenAL32/Include/alMain.h9
2 files changed, 11 insertions, 2 deletions
diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c
index 34cf4d8f..1cdd65b7 100644
--- a/Alc/alcConfig.c
+++ b/Alc/alcConfig.c
@@ -89,7 +89,7 @@ static int readline(FILE *f, char **output, size_t *maxlen)
temp = realloc(*output, newmax);
if(!temp)
{
- ERR("Failed to realloc %lu bytes from %lu!\n", newmax, *maxlen);
+ ERR("Failed to realloc "SZFMT" bytes from "SZFMT"!\n", newmax, *maxlen);
return 0;
}
@@ -162,7 +162,7 @@ static char *expdup(const char *str)
temp = realloc(output, newmax);
if(!temp)
{
- ERR("Failed to realloc %lu bytes from %lu!\n", newmax, maxlen);
+ ERR("Failed to realloc "SZFMT" bytes from "SZFMT"!\n", newmax, maxlen);
return output;
}
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 8b66e4e7..44e36625 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -31,6 +31,15 @@
#endif
#endif
+#if defined(_WIN64)
+#define SZFMT "%I64u"
+#elif defined(_WIN32)
+#define SZFMT "%d"
+#else
+#define SZFMT "%zu"
+#endif
+
+
#include "align.h"
#include "atomic.h"
#include "uintmap.h"