Skip to content

Commit

Permalink
fix win build
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Du <[email protected]>
  • Loading branch information
frankdjx committed Nov 10, 2023
1 parent c092ad9 commit 3684830
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@ enum st_args_cmd {
ST_ARG_MAX,
};

static void log_prefix_time_ms(char* buf, size_t sz) {
struct timespec ts;
struct tm tm;
char time_s_buf[64];

clock_gettime(CLOCK_REALTIME, &ts);
localtime_r(&ts.tv_sec, &tm);
strftime(time_s_buf, sizeof(time_s_buf), "%Y-%m-%d %H:%M:%S", &tm);
snprintf(buf, sz, "%s.%" PRIu64 ", ", time_s_buf, ts.tv_nsec / NS_PER_MS);
}

/*
struct option {
const char *name;
Expand Down Expand Up @@ -347,6 +336,17 @@ static int app_args_json(struct st_app_context* ctx, struct mtl_init_params* p,
return 0;
}

static void log_prefix_time_ms(char* buf, size_t sz) {
struct timespec ts;
struct tm tm;
char time_s_buf[64];

clock_gettime(CLOCK_REALTIME, &ts);
localtime_r(&ts.tv_sec, &tm);
strftime(time_s_buf, sizeof(time_s_buf), "%Y-%m-%d %H:%M:%S", &tm);
snprintf(buf, sz, "%s.%u, ", time_s_buf, (uint32_t)(ts.tv_nsec / NS_PER_MS));
}

int st_app_parse_args(struct st_app_context* ctx, struct mtl_init_params* p, int argc,
char** argv) {
int cmd = -1, optIdx = 0;
Expand Down

0 comments on commit 3684830

Please sign in to comment.