From 7d69a58c3e2682e06fb6cb96095536c36de1137a Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 27 May 2024 08:06:18 +0100 Subject: [PATCH] Fix IFS build inconsistencies (#2774) This PR addresses a couple of issues which have arisen in testing. **Globally define _POSIX_C_SOURCE** Value set by Sming to 200809L making available functionality from the 2008 edition of the POSIX standard (IEEE Standard 1003.1-2008). See https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html. We should expect those features to be available generally. IFS library no longer needs to define this. **Fix IFS issues** - Fix README links - Build images using environment variables with regular Windows paths require 'fixing', e.g. "/C/dir/path" -> "C:/dir/path" - Remove `TimeStamp::String()` operator completely: it's ambiguous TimeStamp has implicit `time_t` cast, which is appropriate. Calling `String(timestamp)` could yield the numeric value or the string value. Instead, call `toString()` method. For example, when calling `Serial.println(timestamp);` GCC 10.2 calls `TimeStamp::String()`, whereas GCC 14.1 uses `String(time_t)`. --- Sming/Arch/Host/Components/hostlib/include/hostlib/hostlib.h | 4 ---- Sming/Components/IFS | 2 +- Sming/build.mk | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Sming/Arch/Host/Components/hostlib/include/hostlib/hostlib.h b/Sming/Arch/Host/Components/hostlib/include/hostlib/hostlib.h index 8dc8f9d2b3..139e8a661f 100644 --- a/Sming/Arch/Host/Components/hostlib/include/hostlib/hostlib.h +++ b/Sming/Arch/Host/Components/hostlib/include/hostlib/hostlib.h @@ -19,10 +19,6 @@ #pragma once -// Required for sleep(), probably others -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200112L - #ifdef __WIN32 // Prevent early inclusion of winsock.h #include diff --git a/Sming/Components/IFS b/Sming/Components/IFS index 1b4e2f04d4..af9ddbc666 160000 --- a/Sming/Components/IFS +++ b/Sming/Components/IFS @@ -1 +1 @@ -Subproject commit 1b4e2f04d4308f0dc966e4d59ee2d6fe5ffd4c2e +Subproject commit af9ddbc666a29b582cd3f1f4ed40a9848a91fe0a diff --git a/Sming/build.mk b/Sming/build.mk index 4717a21f2a..5dab2d4903 100644 --- a/Sming/build.mk +++ b/Sming/build.mk @@ -158,7 +158,8 @@ CPPFLAGS = \ -Wl,-EL \ -finline-functions \ -fdata-sections \ - -ffunction-sections + -ffunction-sections \ + -D_POSIX_C_SOURCE=200809L # Required to access peripheral registers using structs # e.g. `uint32_t value: 8` sitting at a byte or word boundary will be 'optimised' to