Util: Add PRIz macro for libc versions that don't support %z
Jeffrey Pfau jeffrey@endrift.com
Thu, 08 Sep 2016 19:09:20 -0700
4 files changed,
11 insertions(+),
3 deletions(-)
M
src/gba/renderers/thread-proxy.c
→
src/gba/renderers/thread-proxy.c
@@ -139,7 +139,7 @@ }
static bool _writeData(struct GBAVideoThreadProxyRenderer* proxyRenderer, void* data, size_t length) { while (!RingFIFOWrite(&proxyRenderer->dirtyQueue, data, length)) { - mLOG(GBA_VIDEO, WARN, "Can't write %zu bytes. Proxy thread asleep?", length); + mLOG(GBA_VIDEO, WARN, "Can't write %"PRIz"u bytes. Proxy thread asleep?", length); mLOG(GBA_VIDEO, DEBUG, "Queue status: read: %p, write: %p", proxyRenderer->dirtyQueue.readPtr, proxyRenderer->dirtyQueue.writePtr); MutexLock(&proxyRenderer->mutex); if (proxyRenderer->threadState == PROXY_THREAD_STOPPED) {
M
src/util/common.h
→
src/util/common.h
@@ -69,6 +69,13 @@ #define ATOMIC_AND(DST, OP) DST &= OP
#define ATOMIC_CMPXCHG(DST, EXPECTED, OP) ((DST == EXPECTED) ? ((DST = OP), true) : false) #endif +#if defined(_3DS) || defined(GEKKO) || defined(PSP2) +// newlib doesn't support %z properly +#define PRIz "" +#else +#define PRIz "z" +#endif + #if defined(__PPC__) || defined(__POWERPC__) #define LOAD_32LE(DEST, ADDR, ARR) { \ uint32_t _addr = (ADDR); \
M
src/util/gui/file-select.c
→
src/util/gui/file-select.c
@@ -71,7 +71,7 @@ params->drawStart();
if (params->guiPrepare) { params->guiPrepare(); } - GUIFontPrintf(params->font, 0, GUIFontHeight(params->font), GUI_ALIGN_LEFT, 0xFFFFFFFF, "(scanning for items: %zu)", i); + GUIFontPrintf(params->font, 0, GUIFontHeight(params->font), GUI_ALIGN_LEFT, 0xFFFFFFFF, "(scanning for items: %"PRIz"u)", i); GUIFontPrintf(params->font, 0, GUIFontHeight(params->font) * 2, GUI_ALIGN_LEFT, 0xFFFFFFFF, "%s", currentPath); if (params->guiFinish) { params->guiFinish();@@ -109,7 +109,7 @@ params->drawStart();
if (params->guiPrepare) { params->guiPrepare(); } - GUIFontPrintf(params->font, 0, GUIFontHeight(params->font), GUI_ALIGN_LEFT, 0xFFFFFFFF, "(scanning item %zu of %zu)", i, items); + GUIFontPrintf(params->font, 0, GUIFontHeight(params->font), GUI_ALIGN_LEFT, 0xFFFFFFFF, "(scanning item %"PRIz"u of %"PRIz"u)", i, items); GUIFontPrintf(params->font, 0, GUIFontHeight(params->font) * 2, GUI_ALIGN_LEFT, 0xFFFFFFFF, "%s", currentPath); if (params->guiFinish) { params->guiFinish();