From 43b9691078654d25151b9f3c1fb572dcd554a537 Mon Sep 17 00:00:00 2001 From: David Korth Date: Tue, 17 Jun 2025 00:22:33 -0400 Subject: [PATCH] [cmake] 64BitTimeSupportFcntl.cpp: This file was missing... Copied it from rom-properties. This broke the Launchpad Ubuntu 20.04 armhf build. Not going to resubmit it, because I don't think anyone will be using rvthtool on that OS and platform... (cherry picked from commit d9f4ec96f125bec06d5f7056ab244782907fcb34) --- cmake/macros/64BitTimeSupportFcntl.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cmake/macros/64BitTimeSupportFcntl.cpp diff --git a/cmake/macros/64BitTimeSupportFcntl.cpp b/cmake/macros/64BitTimeSupportFcntl.cpp new file mode 100644 index 0000000..9421fa6 --- /dev/null +++ b/cmake/macros/64BitTimeSupportFcntl.cpp @@ -0,0 +1,19 @@ +/** + * 64-bit time_t test code, with fcntl.h. + * Reference: https://github.com/Benjamin-Dobell/Heimdall/blob/master/cmake/LargeFiles.c + */ + +#include +#include +#include + +/** static_assert() macro copied from c++11-compat.h **/ +#define static_assert(expr, msg) switch (0) { case 0: case (expr): ; } + +int main(int argc, char *argv[]) +{ + static_assert(sizeof(time_t) == sizeof(int64_t), "time_t is the wrong size"); + int64_t tm64; + time_t tm = time(&tm64); + return 0; +}