Merge branch 'work2' into working
This commit is contained in:
commit
15ae70a371
@ -899,11 +899,13 @@ STBIDEF const char *stbi_failure_reason(void)
|
|||||||
return stbi__g_failure_reason;
|
return stbi__g_failure_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef STBI_NO_FAILURE_STRINGS
|
||||||
static int stbi__err(const char *str)
|
static int stbi__err(const char *str)
|
||||||
{
|
{
|
||||||
stbi__g_failure_reason = str;
|
stbi__g_failure_reason = str;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void *stbi__malloc(size_t size)
|
static void *stbi__malloc(size_t size)
|
||||||
{
|
{
|
||||||
|
@ -247,17 +247,17 @@ STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean);
|
|||||||
#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
|
#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
|
||||||
|
|
||||||
#ifdef STB_IMAGE_WRITE_STATIC
|
#ifdef STB_IMAGE_WRITE_STATIC
|
||||||
static int stbi__flip_vertically_on_write=0;
|
|
||||||
static int stbi_write_png_compression_level = 8;
|
static int stbi_write_png_compression_level = 8;
|
||||||
static int stbi_write_tga_with_rle = 1;
|
static int stbi_write_tga_with_rle = 1;
|
||||||
static int stbi_write_force_png_filter = -1;
|
static int stbi_write_force_png_filter = -1;
|
||||||
#else
|
#else
|
||||||
int stbi_write_png_compression_level = 8;
|
int stbi_write_png_compression_level = 8;
|
||||||
int stbi__flip_vertically_on_write=0;
|
|
||||||
int stbi_write_tga_with_rle = 1;
|
int stbi_write_tga_with_rle = 1;
|
||||||
int stbi_write_force_png_filter = -1;
|
int stbi_write_force_png_filter = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int stbi__flip_vertically_on_write = 0;
|
||||||
|
|
||||||
STBIWDEF void stbi_flip_vertically_on_write(int flag)
|
STBIWDEF void stbi_flip_vertically_on_write(int flag)
|
||||||
{
|
{
|
||||||
stbi__flip_vertically_on_write = flag;
|
stbi__flip_vertically_on_write = flag;
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
#undef realloc
|
#undef realloc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef STB_LEAKCHECK_OUTPUT_PIPE
|
||||||
|
#define STB_LEAKCHECK_OUTPUT_PIPE stdout
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -97,16 +101,16 @@ static void stblkck_internal_print(const char *reason, stb_leakcheck_malloc_info
|
|||||||
// without "long long" don't support 64-bit targets either, so here's the
|
// without "long long" don't support 64-bit targets either, so here's the
|
||||||
// compromise:
|
// compromise:
|
||||||
#if _MSC_VER < 1400 // before VS 2005
|
#if _MSC_VER < 1400 // before VS 2005
|
||||||
printf("%s: %s (%4d): %8d bytes at %p\n", reason, mi->file, mi->line, (int)mi->size, (void*)(mi+1));
|
fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %8d bytes at %p\n", reason, mi->file, mi->line, (int)mi->size, (void*)(mi+1));
|
||||||
#else
|
#else
|
||||||
printf("%s: %s (%4d): %16lld bytes at %p\n", reason, mi->file, mi->line, (long long)mi->size, (void*)(mi+1));
|
fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %16lld bytes at %p\n", reason, mi->file, mi->line, (long long)mi->size, (void*)(mi+1));
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
// Assume we have %zd on other targets.
|
// Assume we have %zd on other targets.
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
__mingw_printf("%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1));
|
__mingw_fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1));
|
||||||
#else
|
#else
|
||||||
printf("%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1));
|
fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user