Merge pull request #148 from wheremyfoodat/wheremyfoodat-patch-2
Fix GCC build
This commit is contained in:
@@ -2,14 +2,12 @@
|
||||
#include <cstdarg>
|
||||
#include <fstream>
|
||||
|
||||
#include "compiler_builtins.hpp"
|
||||
|
||||
namespace Log {
|
||||
// Our logger class
|
||||
template <bool enabled>
|
||||
class Logger {
|
||||
public:
|
||||
ALWAYS_INLINE void log(const char* fmt, ...) {
|
||||
void log(const char* fmt, ...) {
|
||||
if constexpr (!enabled) return;
|
||||
|
||||
std::va_list args;
|
||||
@@ -65,14 +63,14 @@ namespace Log {
|
||||
|
||||
#define MAKE_LOG_FUNCTION_USER(functionName, logger) \
|
||||
template <typename... Args> \
|
||||
ALWAYS_INLINE void functionName(const char* fmt, Args&&... args) { \
|
||||
void functionName(const char* fmt, Args&&... args) { \
|
||||
Log::logger.log(fmt, args...); \
|
||||
}
|
||||
|
||||
#ifdef PANDA3DS_USER_BUILD
|
||||
#define MAKE_LOG_FUNCTION(functionName, logger) \
|
||||
template <typename... Args> \
|
||||
ALWAYS_INLINE void functionName(const char* fmt, Args&&... args) {}
|
||||
void functionName(const char* fmt, Args&&... args) {}
|
||||
#else
|
||||
#define MAKE_LOG_FUNCTION(functionName, logger) MAKE_LOG_FUNCTION_USER(functionName, logger)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user