Skip to content

Commit

Permalink
2.5.1
Browse files Browse the repository at this point in the history
Maintenance update
  • Loading branch information
andrew-gresyk committed May 25, 2024
1 parent 59357a4 commit 74433df
Show file tree
Hide file tree
Showing 36 changed files with 393 additions and 307 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
CC: gcc-12,
CXX: g++-12
}
- {
OS: ubuntu-24.04,
CC: gcc-13,
CXX: g++-13
}
- {
OS: ubuntu-20.04,
CC: clang-6.0,
Expand Down Expand Up @@ -100,11 +105,6 @@ jobs:
CXX: clang++-15,
VERSION: '15'
}
- {
OS: macos-11,
CC: clang,
CXX: clang++
}
- {
OS: macos-12,
CC: clang,
Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,30 @@ on:
pull_request:
branches: [ master ]

env:
SOLUTION_FILE_PATH: projects\premake\ffsm2-vs.sln

jobs:
build:
runs-on: windows-latest
runs-on: ${{ matrix.PLATFORM.OS }}

env:
SOLUTION_FILE_PATH: ${{ matrix.PLATFORM.SOLUTION_FILE_PATH }}
PROJECT_FILE_NAME: ${{ matrix.PLATFORM.PROJECT_FILE_NAME }}

strategy:
matrix:
PLATFORM:
- {
OS: windows-2019,
SOLUTION_FILE_PATH: projects\premake\ffsm2-vs-2019.sln,
PROJECT_FILE_NAME: test-15
}
- {
OS: windows-2022,
SOLUTION_FILE_PATH: projects\premake\ffsm2-vs-2022.sln,
PROJECT_FILE_NAME: test-17
}

BUILD_CONFIG: [ Release, Debug ]
BUILD_PLATFORM: [ 32, 64 ]
BUILD_PLATFORM: [ Win32, x64 ]

steps:
- uses: actions/checkout@v4
Expand All @@ -26,9 +39,8 @@ jobs:

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{matrix.BUILD_CONFIG}} /p:Platform=${{matrix.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}

- name: Test
working-directory: ${{env.GITHUB_WORKSPACE}}
run: "binaries/test-17-${{matrix.BUILD_CONFIG}}-${{matrix.BUILD_PLATFORM}}.exe"
run: "binaries/${{env.PROJECT_FILE_NAME}}-${{matrix.BUILD_CONFIG}}-${{matrix.BUILD_PLATFORM}}.exe"
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
cmake_minimum_required(VERSION 3.5)

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
message(STATUS "Found ccache in ${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()

project(ffsm2_test)

file(GLOB SOURCE_FILES "test/*.cpp" "test/shared/*.cpp")
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ Header-only flat FSM framework in C++11, with fully statically-defined structure

## Compiler Support

- Visual Studio: 2015, **2017, 2019, 2022**
- GCC: 5, 6, 7, **8, 9, 10, 11, 12**
- ARM GCC: **9**
- Clang: 3.9, 4, 5, **6, 7, 8, 9, 10, 11, 12, 13, 14, 15**
- AppleClang: 12, **13, 13**

(Currently CI-tested toolchains in **bold**)
- Visual Studio: **2015, 2017, 2019, 2022**
- GCC: **8, 9, 10, 11, 12, 13**
- GCC (ARM): **9**
- Clang: **6, 7, 8, 9, 10, 11, 12, 13, 14, 15**
- AppleClang: **14**

---

Expand Down
28 changes: 14 additions & 14 deletions development/ffsm2/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ struct G_ final {
using Context = TContext;
using Activation = TActivation;

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

static constexpr Short SUBSTITUTION_LIMIT = NSubstitutionLimit;

#if FFSM2_PLANS_AVAILABLE()
Expand All @@ -34,8 +30,12 @@ struct G_ final {
using Task = TaskT<Payload>;
#endif

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

/// @brief Set Context type
/// @tparam T Context type for data shared between states and/or data interface between FSM and external code
/// @tparam `T` Context type for data shared between states and/or data interface between FSM and external code
template <typename T>
using ContextT = G_<FEATURE_TAG, T , Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

Expand All @@ -46,21 +46,21 @@ struct G_ final {
#endif

/// @brief Set Substitution limit
/// @tparam N Maximum number times 'guard()' methods can substitute their states for others
template <Long N>
/// @tparam `N` Maximum number times 'guard()' methods can substitute their states for others
template <Short N>
using SubstitutionLimitN = G_<FEATURE_TAG, Context, Activation, N FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

#if FFSM2_PLANS_AVAILABLE()

/// @brief Set Task capacity
/// @tparam N Maximum number of tasks across all plans
/// @tparam `N` Maximum number of tasks across all plans
template <Long N>
using TaskCapacityN = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT , N , Payload>;

#endif

/// @brief Set Transition Payload type
/// @tparam T Utility type for 'TUtility State::utility() const' method
/// @tparam `T` Payload type
template <typename T>
using PayloadT = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), T >;
};
Expand Down Expand Up @@ -116,13 +116,13 @@ struct M_<
// COMMON

/// @brief Root
/// @tparam THead Head state
/// @tparam TSubStates Sub-states
/// @tparam `THead` Head state
/// @tparam `TSubStates` Sub-states
template <typename THead, typename... TSubStates>
using Root = RF_<Cfg, CI_<THead, TSubStates...>>;

/// @brief Headless root
/// @tparam TSubStates Sub-states
/// @tparam `TSubStates` Sub-states
template < typename... TSubStates>
using PeerRoot = RF_<Cfg, CI_<void, TSubStates...>>;

Expand All @@ -148,8 +148,8 @@ using Config = detail::G_<
>;

/// @brief 'Template namespace' for FSM classes
/// @tparam TConfig 'ConfigT<>' type configuration for MachineT<>
/// @see ConfigT<>
/// @tparam `TConfig` `ConfigT<>` type configuration for MachineT<>
/// @see `ConfigT<>`
template <typename TConfig = Config>
using MachineT = detail::M_<TConfig>;

Expand Down
10 changes: 6 additions & 4 deletions development/ffsm2/machine_dev.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// FFSM2 (flat state machine for games and interactive applications)
// 2.4.0 (2023-12-25)
// 2.5.1 (2024-05-25)
//
// Created by Andrew Gresyk
//
Expand All @@ -9,7 +9,7 @@
//
// MIT License
//
// Copyright (c) 2023
// Copyright (c) 2024
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -32,11 +32,13 @@
#pragma once

#define FFSM2_VERSION_MAJOR 2
#define FFSM2_VERSION_MINOR 4
#define FFSM2_VERSION_PATCH 0
#define FFSM2_VERSION_MINOR 5
#define FFSM2_VERSION_PATCH 1

#define FFSM2_VERSION (10000 * FFSM2_VERSION_MAJOR + 100 * FFSM2_VERSION_MINOR + FFSM2_VERSION_PATCH)

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

#include <stdint.h> // uint32_t, uint64_t
#include <string.h> // memcpy_s()

Expand Down
36 changes: 18 additions & 18 deletions include/ffsm2/machine.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// FFSM2 (flat state machine for games and interactive applications)
// 2.4.0 (2023-12-25)
// 2.5.1 (2024-05-25)
//
// Created by Andrew Gresyk
//
Expand All @@ -9,7 +9,7 @@
//
// MIT License
//
// Copyright (c) 2023
// Copyright (c) 2024
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -32,8 +32,8 @@
#pragma once

#define FFSM2_VERSION_MAJOR 2
#define FFSM2_VERSION_MINOR 4
#define FFSM2_VERSION_PATCH 0
#define FFSM2_VERSION_MINOR 5
#define FFSM2_VERSION_PATCH 1

#define FFSM2_VERSION (10000 * FFSM2_VERSION_MAJOR + 100 * FFSM2_VERSION_MINOR + FFSM2_VERSION_PATCH)

Expand Down Expand Up @@ -6483,10 +6483,6 @@ struct G_ final {
using Context = TContext;
using Activation = TActivation;

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

static constexpr Short SUBSTITUTION_LIMIT = NSubstitutionLimit;

#if FFSM2_PLANS_AVAILABLE()
Expand All @@ -6500,8 +6496,12 @@ struct G_ final {
using Task = TaskT<Payload>;
#endif

#if FFSM2_LOG_INTERFACE_AVAILABLE()
using LoggerInterface = LoggerInterfaceT<FEATURE_TAG, Context>;
#endif

/// @brief Set Context type
/// @tparam T Context type for data shared between states and/or data interface between FSM and external code
/// @tparam `T` Context type for data shared between states and/or data interface between FSM and external code
template <typename T>
using ContextT = G_<FEATURE_TAG, T , Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

Expand All @@ -6512,21 +6512,21 @@ struct G_ final {
#endif

/// @brief Set Substitution limit
/// @tparam N Maximum number times 'guard()' methods can substitute their states for others
template <Long N>
/// @tparam `N` Maximum number times 'guard()' methods can substitute their states for others
template <Short N>
using SubstitutionLimitN = G_<FEATURE_TAG, Context, Activation, N FFSM2_IF_PLANS(, TASK_CAPACITY), Payload>;

#if FFSM2_PLANS_AVAILABLE()

/// @brief Set Task capacity
/// @tparam N Maximum number of tasks across all plans
/// @tparam `N` Maximum number of tasks across all plans
template <Long N>
using TaskCapacityN = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT , N , Payload>;

#endif

/// @brief Set Transition Payload type
/// @tparam T Utility type for 'TUtility State::utility() const' method
/// @tparam `T` Payload type
template <typename T>
using PayloadT = G_<FEATURE_TAG, Context, Activation, SUBSTITUTION_LIMIT FFSM2_IF_PLANS(, TASK_CAPACITY), T >;
};
Expand Down Expand Up @@ -6577,13 +6577,13 @@ struct M_<
#endif

/// @brief Root
/// @tparam THead Head state
/// @tparam TSubStates Sub-states
/// @tparam `THead` Head state
/// @tparam `TSubStates` Sub-states
template <typename THead, typename... TSubStates>
using Root = RF_<Cfg, CI_<THead, TSubStates...>>;

/// @brief Headless root
/// @tparam TSubStates Sub-states
/// @tparam `TSubStates` Sub-states
template < typename... TSubStates>
using PeerRoot = RF_<Cfg, CI_<void, TSubStates...>>;

Expand All @@ -6604,8 +6604,8 @@ using Config = detail::G_<
>;

/// @brief 'Template namespace' for FSM classes
/// @tparam TConfig 'ConfigT<>' type configuration for MachineT<>
/// @see ConfigT<>
/// @tparam `TConfig` `ConfigT<>` type configuration for MachineT<>
/// @see `ConfigT<>`
template <typename TConfig = Config>
using MachineT = detail::M_<TConfig>;

Expand Down
2 changes: 1 addition & 1 deletion premake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ workspace "ffsm2"
--systemversion "$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))"

targetdir "binaries/"
targetname "$(ProjectName)-$(Configuration)-$(PlatformArchitecture)"
targetname "$(ProjectName)-$(Configuration)-$(Platform)"
warnings "High"

filter "toolset:msc-v140 or msc-v141"
Expand Down
8 changes: 4 additions & 4 deletions projects/premake/basic_audio_player-14.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,28 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x86\Debug\basic_audio_player-14\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x64\Debug\basic_audio_player-14\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x86\Release\basic_audio_player-14\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x64\Release\basic_audio_player-14\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down
8 changes: 4 additions & 4 deletions projects/premake/basic_audio_player-15.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,28 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x86\Debug\basic_audio_player-15\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x64\Debug\basic_audio_player-15\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x86\Release\basic_audio_player-15\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\binaries\</OutDir>
<IntDir>$(BUILD_ROOT)\$(SolutionName)-$(PlatformArchitecture)\$(ProjectName)-$(Configuration)\x64\Release\basic_audio_player-15\</IntDir>
<TargetName>$(ProjectName)-$(Configuration)-$(PlatformArchitecture)</TargetName>
<TargetName>$(ProjectName)-$(Configuration)-$(Platform)</TargetName>
<TargetExt>.exe</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down
Loading

0 comments on commit 74433df

Please sign in to comment.