mirror of
https://github.com/gbdev/rgbds.git
synced 2026-11-22 05:48:39 +00:00
* Opt into POSIX functions with `_POSIX_C_SOURCE` before any system headers are `#include`d * Allow user to override `make develop`'s `WARNFLAGS` and `CXXFLAGS` * Use `make develop` on 32-bit Cygwin with sanitizers disabled * Do not unnecessarily redefine `fseek` and `ftell` * Disable a false-positive `-Wno-null-dereference` on 32-bit Cygwin Co-authored-by: ISSOtm <[email protected]>
35 lines
717 B
C++
35 lines
717 B
C++
// SPDX-License-Identifier: MIT
|
|
|
|
#include "platform.hpp" // strcasecmp
|
|
|
|
#include "backtrace.hpp"
|
|
|
|
#include <optional>
|
|
#include <stdint.h>
|
|
|
|
#include "util.hpp" // parseWholeNumber
|
|
|
|
Tracing tracing;
|
|
|
|
bool trace_ParseTraceDepth(char const *arg) {
|
|
if (!strcasecmp(arg, "collapse")) {
|
|
tracing.collapse = true;
|
|
return true;
|
|
} else if (!strcasecmp(arg, "no-collapse")) {
|
|
tracing.collapse = false;
|
|
return true;
|
|
} else if (!strcasecmp(arg, "all")) {
|
|
tracing.loud = true;
|
|
return true;
|
|
} else if (!strcasecmp(arg, "no-all")) {
|
|
tracing.loud = false;
|
|
return true;
|
|
} else {
|
|
std::optional<uint64_t> depth = parseWholeNumber(arg);
|
|
if (depth) {
|
|
tracing.depth = *depth;
|
|
}
|
|
return depth.has_value();
|
|
}
|
|
}
|