Dashboard/Quik.StbImage.redist/quik_stbi.h

31 lines
958 B
C
Raw Normal View History

2023-07-08 12:25:44 +02:00
#ifndef _QUIK_STB_CONFIG_H_
#define _QUIK_STB_CONFIG_H_
#include "stddef.h"
#if __GNUC__ || __MSC_VER
#define __QUIK_FUNCTION__ __FUNCTION__
#define QEXTERN extern
#else
#define __QUIK_FUNCTION__ NULL
#endif
/* TODO: Change this declaration so we can export a DLL properly in windows. */
#define STBIDEF QEXTERN
#define STBI_NO_STDIO 1
typedef void (*quik_failed_assert_cb_t)(const char *expr, const char *file, int line, const char* func);
QEXTERN quik_failed_assert_cb_t quik_stbi_failed_assert;
QEXTERN void quik_stbi_failed_assert_store(quik_failed_assert_cb_t cb);
QEXTERN void quik_stbi_failed_assert_default(const char * expr, const char *file, int line, const char *function);
/* Overwrite cstdlib functions so we can get as close as possible to freestanding environment. */
#define STBI_ASSERT(EXPR) do { \
if (!(EXPR)) \
quik_stbi_failed_assert(#EXPR, __FILE__, __LINE__ - 2, __QUIK_FUNCTION__); \
} while(0)
#endif