From ab54a2e8cf99164c5dd1f0be141802a72699d8e6 Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Thu, 22 Feb 2024 22:39:31 -0800 Subject: [PATCH 1/5] Do not try to use C11 on Windows If you are using a Windows C toolchain (MSVC) then you should not expect it to keep up with the standard. --- core/platform/lf_windows_support.c | 5 ----- include/core/platform/lf_windows_support.h | 4 ---- lingua-franca-ref.txt | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/core/platform/lf_windows_support.c b/core/platform/lf_windows_support.c index 86e8a8271..8c829bfb7 100644 --- a/core/platform/lf_windows_support.c +++ b/core/platform/lf_windows_support.c @@ -167,8 +167,6 @@ int lf_available_cores() { return sysinfo.dwNumberOfProcessors; } -#if __STDC_VERSION__ < 201112L || defined (__STDC_NO_THREADS__) // (Not C++11 or later) or no threads support - int lf_thread_create(lf_thread_t* thread, void *(*lf_thread) (void *), void* arguments) { uintptr_t handle = _beginthreadex(NULL, 0, lf_thread, arguments, 0, NULL); *thread = (HANDLE)handle; @@ -297,9 +295,6 @@ int _lf_cond_timedwait(lf_cond_t* cond, instant_t wakeup_time) { // Success return 0; } -#else // If there is C11 support -#include "lf_C11_threads_support.c" -#endif #endif diff --git a/include/core/platform/lf_windows_support.h b/include/core/platform/lf_windows_support.h index 0ffed63ec..b45420936 100644 --- a/include/core/platform/lf_windows_support.h +++ b/include/core/platform/lf_windows_support.h @@ -44,7 +44,6 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #if !defined LF_SINGLE_THREADED - #if __STDC_VERSION__ < 201112L || defined (__STDC_NO_THREADS__) /** * On Windows, one could use both a mutex or * a critical section for the same purpose. However, @@ -62,9 +61,6 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. CONDITION_VARIABLE condition; } lf_cond_t; typedef HANDLE lf_thread_t; - #else - #include "lf_C11_threads_support.h" - #endif #endif // Use 64-bit times and 32-bit unsigned microsteps diff --git a/lingua-franca-ref.txt b/lingua-franca-ref.txt index 791fce4ce..1f7391f92 100644 --- a/lingua-franca-ref.txt +++ b/lingua-franca-ref.txt @@ -1 +1 @@ -further-cleanup +master From 4de5838b76afdc5b1d370c1a8517e95819ce0e2f Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Thu, 22 Feb 2024 19:44:03 -0800 Subject: [PATCH 2/5] Try to fix check_diff.sh The Arduino and Zephyr tests should be running --- .github/scripts/check-diff.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/check-diff.sh b/.github/scripts/check-diff.sh index 649b955a0..3a346535b 100755 --- a/.github/scripts/check-diff.sh +++ b/.github/scripts/check-diff.sh @@ -4,8 +4,8 @@ changes() { git diff --name-only HEAD $(git merge-base HEAD origin/main) } -if changes | grep "$2" | grep -q -v "^.*md\|txt$"; then - echo "changed_$3=1" >> $GITHUB_OUTPUT +if changes | grep "$1" | grep -q -v "^.*md\|txt$"; then + echo "changed_$2=1" >> $GITHUB_OUTPUT else - echo "changed_$3=0" >> $GITHUB_OUTPUT -fi \ No newline at end of file + echo "changed_$2=0" >> $GITHUB_OUTPUT +fi From 9fa0077ff060f6095753c59dad471703b937ce0d Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Thu, 22 Feb 2024 22:51:44 -0800 Subject: [PATCH 3/5] Another fix in check_diff mechanism --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca05e5e94..26795c446 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: with: runtime-ref: ${{ github.ref }} compiler-ref: ${{ needs.fetch-lf.outputs.ref }} - all-platforms: ${{ needs.check-diff.outputs.run_macos == 'true' || needs.check-diff.outputs.run_macos == 'true' }} + all-platforms: ${{ needs.check-diff.outputs.run_macos == 'true' || needs.check-diff.outputs.run_windows == 'true' }} lf-python: needs: [fetch-lf, check-diff] @@ -72,7 +72,7 @@ jobs: runtime-ref: ${{ github.ref }} compiler-ref: ${{ needs.fetch-lf.outputs.ref }} scheduler: GEDF_NP - all-platforms: ${{ needs.check-diff.outputs.run_macos == 'true' || needs.check-diff.outputs.run_macos == 'true' }} + all-platforms: ${{ needs.check-diff.outputs.run_macos == 'true' || needs.check-diff.outputs.run_windows == 'true' }} lf-adaptive: needs: [fetch-lf, check-diff] @@ -81,4 +81,4 @@ jobs: runtime-ref: ${{ github.ref }} compiler-ref: ${{ needs.fetch-lf.outputs.ref }} scheduler: ADAPTIVE - all-platforms: ${{ needs.check-diff.outputs.run_macos == 'true' || needs.check-diff.outputs.run_macos == 'true' }} + all-platforms: ${{ needs.check-diff.outputs.run_macos == 'true' || needs.check-diff.outputs.run_windows == 'true' }} From 8082698f1b55c335044bf089f594c5fa0b6c9539 Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Thu, 22 Feb 2024 23:27:20 -0800 Subject: [PATCH 4/5] Update lingua-franca-ref.txt --- lingua-franca-ref.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lingua-franca-ref.txt b/lingua-franca-ref.txt index 1f7391f92..e7dda3def 100644 --- a/lingua-franca-ref.txt +++ b/lingua-franca-ref.txt @@ -1 +1 @@ -master +windows-c11 From 7b3ce0da2e22e3685d276d46d3d9da4834a2d036 Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Fri, 23 Feb 2024 00:03:14 -0800 Subject: [PATCH 5/5] Try to make AppleClang happy --- core/modal_models/modes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/modal_models/modes.c b/core/modal_models/modes.c index eda031755..7e1c2493b 100644 --- a/core/modal_models/modes.c +++ b/core/modal_models/modes.c @@ -44,6 +44,7 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "modes.h" #include "reactor.h" #include "reactor_common.h" +#include "api/schedule.h" // Bit masks for the internally used flags on modes #define _LF_MODE_FLAG_MASK_ACTIVE (1 << 0)