From 02c33271e0f448afef60c4ecdc456e9674f0cc0d Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Mon, 18 Mar 2024 06:57:59 +0100 Subject: [PATCH] lattice,xilinx: new try to fix (again) uint64_t print format --- src/lattice.cpp | 4 +++- src/xilinx.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lattice.cpp b/src/lattice.cpp index 5ca516ea11..ab8a287a5f 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -3,6 +3,8 @@ * Copyright (C) 2019 Gwenhael Goavec-Merou */ +#define __STDC_FORMAT_MACROS +#include #include #include #include @@ -1048,7 +1050,7 @@ void Lattice::displayReadReg(uint64_t dev) uint8_t err; printf("displayReadReg\n"); if (dev & 1<<0) printf("\tTRAN Mode\n"); - printf("\tConfig Target Selection : %llx\n", (dev >> 1) & 0x07); + printf("\tConfig Target Selection : %" PRIx64 "\n", (dev >> 1) & 0x07); if (dev & 1<<4) printf("\tJTAG Active\n"); if (dev & 1<<5) printf("\tPWD Protect\n"); if (dev & 1<<6) printf("\tOTP\n"); diff --git a/src/xilinx.cpp b/src/xilinx.cpp index 7cb6b89db2..448969c2ef 100644 --- a/src/xilinx.cpp +++ b/src/xilinx.cpp @@ -3,6 +3,8 @@ * Copyright (C) 2019 Gwenhael Goavec-Merou */ +#define __STDC_FORMAT_MACROS +#include #include #include @@ -385,7 +387,7 @@ Xilinx::Xilinx(Jtag *jtag, const std::string &filename, if (read_dna) { if (_fpga_family == ARTIX_FAMILY || _fpga_family == KINTEXUS_FAMILY) { uint64_t dna = Xilinx::fuse_dna_read(); - printf("{\"dna\": \"0x%016llx\"}\n", dna); + printf("{\"dna\": \"0x%016" PRIx64 "\"}\n", dna); } else { throw std::runtime_error("Error: read_xadc only supported for Artix 7"); }