diff --git a/simio/simio_tracer.c b/simio/simio_tracer.c index fcbaac1..e235cac 100644 --- a/simio/simio_tracer.c +++ b/simio/simio_tracer.c @@ -71,7 +71,7 @@ static void event_print(const struct event *e) char name[128]; print_address(e->addr, name, sizeof(name)); - printc(" %10lld: ", e->when); + printc(" %10" LLFMT ": ", e->when); switch (e->what) { case EVENT_WRITE_16: @@ -234,10 +234,10 @@ static int tracer_info(struct simio_device *dev) struct tracer *tr = (struct tracer *)dev; int i; - printc("Instruction count: %lld\n", tr->inscount); - printc("MCLK: %lld\n", tr->cycles[SIMIO_MCLK]); - printc("SMCLK %lld\n", tr->cycles[SIMIO_SMCLK]); - printc("ACLK: %lld\n", tr->cycles[SIMIO_ACLK]); + printc("Instruction count: %" LLFMT "\n", tr->inscount); + printc("MCLK: %" LLFMT "\n", tr->cycles[SIMIO_MCLK]); + printc("SMCLK %" LLFMT "\n", tr->cycles[SIMIO_SMCLK]); + printc("ACLK: %" LLFMT "\n", tr->cycles[SIMIO_ACLK]); if (tr->irq_request >= 0) printc("IRQ pending: %d\n", tr->irq_request); diff --git a/util/util.h b/util/util.h index a12ac9f..9ecdd89 100644 --- a/util/util.h +++ b/util/util.h @@ -73,4 +73,11 @@ char *expand_tilde(const char *path); int delay_s(unsigned int s); int delay_ms(unsigned int s); +/* printf format for long long args */ +#ifdef __MINGW32__ +#define LLFMT "I64d" +#else +#define LLFMT "lld" +#endif + #endif