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 <rosenp@gmail.com>
pull/329/head
Rosen Penev 2022-01-02 15:21:50 -08:00
parent fd1d61490c
commit c4bf71e2d5
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@
* as published by the Free Software Foundation * as published by the Free Software Foundation
*/ */
#define __SANE_USERSPACE_TYPES__ // needed for some platforms to get proper 64-bit types
#include <sys/socket.h> #include <sys/socket.h>
#include <linux/can.h> #include <linux/can.h>
#include <linux/can/j1939.h> #include <linux/can/j1939.h>

View File

@ -295,7 +295,7 @@ int main(int argc, char *argv[])
int i; int i;
if (todo_names && peername.can_addr.j1939.name) 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, printf("%02x %05x:", peername.can_addr.j1939.addr,
peername.can_addr.j1939.pgn); peername.can_addr.j1939.pgn);
for (i = 0, j = 0; i < ret; ++i, j++) { for (i = 0, j = 0; i < ret; ++i, j++) {