mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Enable use of scope_dumper without scope info logging enabled
This commit is contained in:
parent
bb8c18b017
commit
e2a4e51725
@ -40,6 +40,8 @@ int WriteScopeLog(char *buf, const char *last)
|
||||
return b - buf;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// helper functions
|
||||
const char *scope_dumper::CompanyInfo(int company_id)
|
||||
{
|
||||
@ -106,5 +108,3 @@ const char *scope_dumper::StationInfo(const BaseStation *st)
|
||||
}
|
||||
return this->buffer;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -12,13 +12,14 @@
|
||||
#ifndef SCOPE_INFO_H
|
||||
#define SCOPE_INFO_H
|
||||
|
||||
#ifdef USE_SCOPE_INFO
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
struct Vehicle;
|
||||
struct BaseStation;
|
||||
|
||||
#ifdef USE_SCOPE_INFO
|
||||
|
||||
extern std::vector<std::function<int(char *, const char *)>> _scope_stack;
|
||||
|
||||
struct scope_info_func_obj {
|
||||
@ -52,6 +53,12 @@ int WriteScopeLog(char *buf, const char *last);
|
||||
return SCOPE_INFO_PASTE(_sc_lm_, __LINE__) (buf, last); \
|
||||
});
|
||||
|
||||
#else /* USE_SCOPE_INFO */
|
||||
|
||||
#define SCOPE_INFO_FMT(...) { }
|
||||
|
||||
#endif /* USE_SCOPE_INFO */
|
||||
|
||||
/**
|
||||
* This is a set of helper functions to print useful info from within a SCOPE_INFO_FMT statement.
|
||||
* The use of a struct is so that when used as an argument to SCOPE_INFO_FMT/seprintf/etc, the buffer lives
|
||||
@ -68,10 +75,4 @@ private:
|
||||
char buffer[256];
|
||||
};
|
||||
|
||||
#else /* USE_SCOPE_INFO */
|
||||
|
||||
#define SCOPE_INFO_FMT(...) { }
|
||||
|
||||
#endif /* USE_SCOPE_INFO */
|
||||
|
||||
#endif /* SCOPE_INFO_H */
|
||||
|
Loading…
Reference in New Issue
Block a user