diff --git a/src/openrct2/common.h b/src/openrct2/common.h index 15ffd8f000..e0bdd02cdb 100644 --- a/src/openrct2/common.h +++ b/src/openrct2/common.h @@ -37,8 +37,6 @@ #include #include -#include "diagnostic.h" - typedef int8_t sint8; typedef int16_t sint16; typedef int32_t sint32; @@ -48,6 +46,8 @@ typedef uint16_t uint16; typedef uint32_t uint32; typedef uint64_t uint64; +#include "diagnostic.h" + typedef char utf8; typedef utf8* utf8string; typedef const utf8* const_utf8string; diff --git a/src/openrct2/diagnostic.c b/src/openrct2/diagnostic.c index 0166235e23..ebb34b8029 100644 --- a/src/openrct2/diagnostic.c +++ b/src/openrct2/diagnostic.c @@ -19,8 +19,8 @@ #include #include "diagnostic.h" -int _log_levels[DIAGNOSTIC_LEVEL_COUNT] = { 1, 1, 1, 0, 1 }; -int _log_location_enabled = 1; +sint32 _log_levels[DIAGNOSTIC_LEVEL_COUNT] = { 1, 1, 1, 0, 1 }; +sint32 _log_location_enabled = 1; const char * _level_strings[] = { "FATAL", @@ -30,7 +30,7 @@ const char * _level_strings[] = { "INFO" }; -void diagnostic_log(int diagnosticLevel, const char *format, ...) +void diagnostic_log(sint32 diagnosticLevel, const char *format, ...) { FILE *stream; va_list args; @@ -52,7 +52,7 @@ void diagnostic_log(int diagnosticLevel, const char *format, ...) fprintf(stream, "\n"); } -void diagnostic_log_with_location(int diagnosticLevel, const char *file, const char *function, int line, const char *format, ...) +void diagnostic_log_with_location(sint32 diagnosticLevel, const char *file, const char *function, sint32 line, const char *format, ...) { FILE *stream; va_list args; diff --git a/src/openrct2/diagnostic.h b/src/openrct2/diagnostic.h index f862a9a278..0368b6236e 100644 --- a/src/openrct2/diagnostic.h +++ b/src/openrct2/diagnostic.h @@ -48,6 +48,8 @@ enum { * only checking whether the define is present or not. */ +#include "common.h" + #if defined(DEBUG) #if DEBUG > 0 #define DEBUG_LEVEL_1 1 @@ -73,14 +75,14 @@ enum { #define DEBUG_LEVEL_1 0 #endif // defined(DEBUG) -extern int _log_levels[DIAGNOSTIC_LEVEL_COUNT]; +extern sint32 _log_levels[DIAGNOSTIC_LEVEL_COUNT]; #ifdef __cplusplus extern "C" { #endif // __cplusplus -void diagnostic_log(int diagnosticLevel, const char *format, ...); -void diagnostic_log_with_location(int diagnosticLevel, const char *file, const char *function, int line, const char *format, ...); +void diagnostic_log(sint32 diagnosticLevel, const char *format, ...); +void diagnostic_log_with_location(sint32 diagnosticLevel, const char *file, const char *function, sint32 line, const char *format, ...); #ifdef __cplusplus }