Merge branch 'crashlog_improvements' into jgrpp
Fixes compilation on MSVC
This commit is contained in:
@@ -40,6 +40,8 @@ int WriteScopeLog(char *buf, const char *last)
|
|||||||
return b - buf;
|
return b - buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// helper functions
|
// helper functions
|
||||||
const char *scope_dumper::CompanyInfo(int company_id)
|
const char *scope_dumper::CompanyInfo(int company_id)
|
||||||
{
|
{
|
||||||
@@ -114,5 +116,3 @@ const char *scope_dumper::StationInfo(const BaseStation *st)
|
|||||||
}
|
}
|
||||||
return this->buffer;
|
return this->buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -12,13 +12,14 @@
|
|||||||
#ifndef SCOPE_INFO_H
|
#ifndef SCOPE_INFO_H
|
||||||
#define SCOPE_INFO_H
|
#define SCOPE_INFO_H
|
||||||
|
|
||||||
#ifdef USE_SCOPE_INFO
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
struct Vehicle;
|
struct Vehicle;
|
||||||
struct BaseStation;
|
struct BaseStation;
|
||||||
|
|
||||||
|
#ifdef USE_SCOPE_INFO
|
||||||
|
|
||||||
extern std::vector<std::function<int(char *, const char *)>> _scope_stack;
|
extern std::vector<std::function<int(char *, const char *)>> _scope_stack;
|
||||||
|
|
||||||
struct scope_info_func_obj {
|
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); \
|
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.
|
* 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
|
* 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];
|
char buffer[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* USE_SCOPE_INFO */
|
|
||||||
|
|
||||||
#define SCOPE_INFO_FMT(...) { }
|
|
||||||
|
|
||||||
#endif /* USE_SCOPE_INFO */
|
|
||||||
|
|
||||||
#endif /* SCOPE_INFO_H */
|
#endif /* SCOPE_INFO_H */
|
||||||
|
Reference in New Issue
Block a user