Util: Add PRIz macro for libc versions that don't support %z

This commit is contained in:
Jeffrey Pfau 2016-09-08 19:09:20 -07:00
parent bf8ddafb54
commit e8b7d180bf
4 changed files with 11 additions and 3 deletions

View File

@ -93,6 +93,7 @@ Misc:
- FFmpeg: Full support for libavcodec 56+
- Util: PNG utils should support 16-bit when applicable
- Debugger: Add software breakpoint support to gdb
- Util: Add PRIz macro for libc versions that don't support %z
0.4.1: (2016-07-11)
Bugfixes:

View File

@ -139,7 +139,7 @@ void _proxyThreadRecover(struct GBAVideoThreadProxyRenderer* proxyRenderer) {
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) {

View File

@ -69,6 +69,13 @@ typedef intptr_t ssize_t;
#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); \

View File

@ -71,7 +71,7 @@ static bool _refreshDirectory(struct GUIParams* params, const char* currentPath,
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 @@ static bool _refreshDirectory(struct GUIParams* params, const char* currentPath,
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();