Skip to content
Myr

stb_sprintf: fix 32 vs 64-bit sizes for format widts j/z/t

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent 6e7e5c5 · Browse files · 1 file+7 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−2 removed

  • other:+7 added−2 removed

1 file+7 added−2 removed

modified:stb_sprintf.h+7 added-2 removed
13 unmodified lines
14// Jari Komppa (SI suffixes)15// Rohit Nirmal16// Marcin Wojdyr17// Leonard Ritter18// Stefano Zanotti19//20// LICENSE:21//22// See end of file for license information.
136 unmodified lines
159#endif160#endif161162#include <stdarg.h> // for va_list()163#include <stddef.h> // size_t, ptrdiff_t164165#ifndef STB_SPRINTF_MIN166#define STB_SPRINTF_MIN 512 // how many characters per callback167#endif
290 unmodified lines
458 }459 break;460 // are we 64-bit on intmax? (c99)461 case 'j':460 fl |= STBSP__INTMAX;462 fl |= (sizeof(size_t) == 8) ? STBSP__INTMAX : 0;463 ++f;464 break;465 // are we 64-bit on size_t or ptrdiff_t? (c99)466 case 'z':467 fl |= (sizeof(ptrdiff_t) == 8) ? STBSP__INTMAX : 0;468 ++f;469 break;470 case 't':466 fl |= ((sizeof(char *) == 8) ? STBSP__INTMAX : 0);471 fl |= (sizeof(ptrdiff_t) == 8) ? STBSP__INTMAX : 0;472 ++f;473 break;474 // are we 64-bit (msft style)475 case 'I':
1375 unmodified lines