Makefile fix to easily make linux, windows, web; DBG flag set correctly
This commit is contained in:
@@ -31,7 +31,7 @@ char consolelog[CONSOLE_BUF+1] = {'\0'};
|
||||
|
||||
void mYughLog(int category, int priority, int line, const char *file, const char *message, ...)
|
||||
{
|
||||
#ifdef DBG
|
||||
#ifndef NDEBUG
|
||||
if (priority >= logLevel) {
|
||||
time_t now = time(0);
|
||||
struct tm *tinfo = localtime(&now);
|
||||
@@ -51,9 +51,6 @@ void mYughLog(int category, int priority, int line, const char *file, const char
|
||||
snprintf(buffer, ERROR_BUFFER, "%s:%d: %s, %s: %s\n", file, line, logstr[priority], catstr[category], msgbuffer);
|
||||
|
||||
log_print(buffer);
|
||||
|
||||
// if (category != LOG_SCRIPT && priority >= 2)
|
||||
// js_stacktrace();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ extern char lastlog[];
|
||||
extern char consolelog[];
|
||||
extern int logLevel;
|
||||
|
||||
#ifdef DBG
|
||||
#ifndef NDEBUG
|
||||
#define YughLog(cat, pri, msg, ...) mYughLog(cat, pri, __LINE__, __FILE__, msg, ##__VA_ARGS__)
|
||||
#define YughInfo(msg, ...) mYughLog(0, 0, __LINE__, __FILE__, msg, ##__VA_ARGS__);
|
||||
#define YughWarn(msg, ...) mYughLog(0, 1, __LINE__, __FILE__, msg, ##__VA_ARGS__);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
JSContext *js = NULL;
|
||||
JSRuntime *rt = NULL;
|
||||
|
||||
#ifdef DBG
|
||||
#ifndef NDEBUG
|
||||
#define JS_EVAL_FLAGS JS_EVAL_FLAG_STRICT
|
||||
#else
|
||||
#define JS_EVAL_FLAGS JS_EVAL_FLAG_STRICT | JS_EVAL_FLAG_STRIP
|
||||
@@ -47,7 +47,7 @@ void script_startup() {
|
||||
JSValue num_cache[100] = {0};
|
||||
|
||||
int js_print_exception(JSValue v) {
|
||||
#ifdef DBG
|
||||
#ifndef NDEBUG
|
||||
if (JS_IsException(v)) {
|
||||
JSValue exception = JS_GetException(js);
|
||||
|
||||
@@ -124,7 +124,7 @@ time_t file_mod_secs(const char *file) {
|
||||
}
|
||||
|
||||
void js_stacktrace() {
|
||||
#ifdef DBG
|
||||
#ifndef NDEBUG
|
||||
call_callee(&stacktrace_callee);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "time.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
||||
#include "samplerate.h"
|
||||
|
||||
#include "stb_ds.h"
|
||||
|
||||
@@ -88,9 +88,9 @@ struct Texture *texture_pullfromfile(const char *path) {
|
||||
|
||||
unsigned char *data;
|
||||
|
||||
char *ext = strrchr(path, '.')+1;
|
||||
char *ext = strrchr(path, '.');
|
||||
|
||||
if (!strcmp(ext, "qoi")) {
|
||||
if (ext && !strcmp(ext, ".qoi")) {
|
||||
qoi_desc qoi;
|
||||
data = qoi_read(path, &qoi, 4);
|
||||
tex->width = qoi.width;
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
#include <immintrin.h>
|
||||
#endif
|
||||
|
||||
/* Uncomment to enable specific converters */
|
||||
//#define ENABLE_SINC_BEST_CONVERTER
|
||||
//#define ENABLE_SINC_FAST_CONVERTER
|
||||
//#define ENABLE_SINC_MEDIUM_CONVERTER
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_VISIBILITY
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
#define CPU_IS_LITTLE_ENDIAN 1
|
||||
|
||||
/* Enable sinc best converter. */
|
||||
#define ENABLE_SINC_BEST_CONVERTER 1
|
||||
#define ENABLE_SINC_BEST_CONVERTER 0
|
||||
|
||||
/* Enable sinc fast converter. */
|
||||
#define ENABLE_SINC_FAST_CONVERTER 1
|
||||
#define ENABLE_SINC_FAST_CONVERTER 0
|
||||
|
||||
/* Enable sinc balanced converter. */
|
||||
#define ENABLE_SINC_MEDIUM_CONVERTER 1
|
||||
#define ENABLE_SINC_MEDIUM_CONVERTER 0
|
||||
|
||||
/* Define to 1 if you have the `alarm' function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "2dphysics.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
@@ -34,13 +34,9 @@
|
||||
#include "string.h"
|
||||
|
||||
#define SOKOL_TRACE_HOOKS
|
||||
#ifdef DBG
|
||||
#define SOKOL_DEBUG
|
||||
#endif
|
||||
|
||||
#define SOKOL_IMPL
|
||||
|
||||
#if defined __linux__
|
||||
#if defined __GLIBC__
|
||||
#define SOKOL_GLCORE33
|
||||
#elif __EMSCRIPTEN__
|
||||
#define SOKOL_GLES3
|
||||
@@ -121,7 +117,7 @@ int backtrace(void **buffer, int size) {
|
||||
#endif
|
||||
|
||||
void print_stacktrace() {
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
void *ents[512];
|
||||
size_t size = backtrace(ents, 512);
|
||||
|
||||
@@ -138,7 +134,7 @@ void print_stacktrace() {
|
||||
}
|
||||
|
||||
void seghandle(int sig) {
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
if (strsignal(sig))
|
||||
YughCritical("CRASH! Signal: %s.", strsignal(sig));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user