From c4bf71e2d52964da1a4d7d14b265868c74857fca Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 2 Jan 2022 15:21:50 -0800 Subject: [PATCH] testj1939: fix 64-bit types for some platforms Reverted previous commit and added define to get the same types on all platforms. Signed-off-by: Rosen Penev --- libj1939.h | 2 ++ testj1939.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libj1939.h b/libj1939.h index 500a922..da85462 100644 --- a/libj1939.h +++ b/libj1939.h @@ -10,6 +10,8 @@ * as published by the Free Software Foundation */ +#define __SANE_USERSPACE_TYPES__ // needed for some platforms to get proper 64-bit types + #include #include #include diff --git a/testj1939.c b/testj1939.c index 787af04..951fe53 100644 --- a/testj1939.c +++ b/testj1939.c @@ -295,7 +295,7 @@ int main(int argc, char *argv[]) int i; if (todo_names && peername.can_addr.j1939.name) - printf("%016" PRIx64 " ", peername.can_addr.j1939.name); + printf("%016llx ", peername.can_addr.j1939.name); printf("%02x %05x:", peername.can_addr.j1939.addr, peername.can_addr.j1939.pgn); for (i = 0, j = 0; i < ret; ++i, j++) {