Minitrace fixes so it compiles again

This commit is contained in:
Jasmine Iwanek
2022-12-18 23:05:43 -05:00
parent 3c46b6becd
commit 137b327471

View File

@@ -95,16 +95,16 @@ void mtr_flush_with_state(int);
// pthread basics // pthread basics
#ifdef _WIN32 #ifdef _WIN32
static int get_cur_thread_id() { static int get_cur_thread_id(void) {
return (int)GetCurrentThreadId(); return (int)GetCurrentThreadId();
} }
static int get_cur_process_id() { static int get_cur_process_id(void) {
return (int)GetCurrentProcessId(); return (int)GetCurrentProcessId();
} }
static uint64_t _frequency = 0; static uint64_t _frequency = 0;
static uint64_t _starttime = 0; static uint64_t _starttime = 0;
double mtr_time_s() { double mtr_time_s(void) {
if (_frequency == 0) { if (_frequency == 0) {
QueryPerformanceFrequency((LARGE_INTEGER*)&_frequency); QueryPerformanceFrequency((LARGE_INTEGER*)&_frequency);
QueryPerformanceCounter((LARGE_INTEGER*)&_starttime); QueryPerformanceCounter((LARGE_INTEGER*)&_starttime);
@@ -124,7 +124,7 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) {
ExitProcess(1); ExitProcess(1);
} }
void mtr_register_sigint_handler() { void mtr_register_sigint_handler(void) {
// For console apps: // For console apps:
SetConsoleCtrlHandler(&CtrlHandler, TRUE); SetConsoleCtrlHandler(&CtrlHandler, TRUE);
} }
@@ -154,10 +154,10 @@ static void join_flushing_thread(void) {
#else #else
static inline int get_cur_thread_id() { static inline int get_cur_thread_id(void) {
return (int)(intptr_t)pthread_self(); return (int)(intptr_t)pthread_self();
} }
static inline int get_cur_process_id() { static inline int get_cur_process_id(void) {
return (int)getpid(); return (int)getpid();
} }
@@ -193,7 +193,7 @@ double mtr_time_s() {
return time.tv_sec + time.tv_nsec / 1.0e9; return time.tv_sec + time.tv_nsec / 1.0e9;
} }
#else #else
double mtr_time_s() { double mtr_time_s(void) {
static time_t start; static time_t start;
struct timeval tv; struct timeval tv;
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
@@ -217,7 +217,7 @@ static void termination_handler(int signum) {
exit(1); exit(1);
} }
void mtr_register_sigint_handler() { void mtr_register_sigint_handler(void) {
#ifndef MTR_ENABLED #ifndef MTR_ENABLED
return; return;
#endif #endif
@@ -251,7 +251,7 @@ void mtr_init(const char *json_file) {
mtr_init_from_stream(fopen(json_file, "wb")); mtr_init_from_stream(fopen(json_file, "wb"));
} }
void mtr_shutdown() { void mtr_shutdown(void) {
int i; int i;
#ifndef MTR_ENABLED #ifndef MTR_ENABLED
return; return;
@@ -289,7 +289,7 @@ const char *mtr_pool_string(const char *str) {
return "string pool full"; return "string pool full";
} }
void mtr_start() { void mtr_start(void) {
#ifndef MTR_ENABLED #ifndef MTR_ENABLED
return; return;
#endif #endif
@@ -304,7 +304,7 @@ void mtr_start() {
init_flushing_thread(); init_flushing_thread();
} }
void mtr_stop() { void mtr_stop(void) {
#ifndef MTR_ENABLED #ifndef MTR_ENABLED
return; return;
#endif #endif
@@ -435,7 +435,7 @@ void mtr_flush_with_state(int is_last) {
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
void mtr_flush() { void mtr_flush(void) {
mtr_flush_with_state(FALSE); mtr_flush_with_state(FALSE);
} }