Coder Social home page Coder Social logo

andrew-gresyk / ffsm2 Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 4.0 828 KB

High-Performance Flat Finite State Machine Framework

Home Page: https://flat.hfsm.dev

License: MIT License

CMake 0.16% C++ 98.65% Python 0.29% SCSS 0.04% Batchfile 0.01% Lua 0.85%
cpp cpp11 embedded embedded-systems fsm fsm-library game-dev game-development header-only mit-license modern-cpp state-machine template-metaprogramming

ffsm2's People

Contributors

andrew-gresyk avatar dependabot[bot] avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ffsm2's Issues

16-bit architectures support

FFSM2 single-header library does not compile on 16-bits architectures.

Description

FFSM2 cannot be compiled on a 16-bits architecture because the following code generates a compile-time error:

#if INTPTR_MAX == INT64_MAX
    #define FFSM2_ARCHITECTURE_64()    true
    #define FFSM2_ARCHITECTURE_32()    false

    #define FFSM2_64BIT_OR_32BIT(p64, p32)    p64
#elif INTPTR_MAX == INT32_MAX
    #define FFSM2_ARCHITECTURE_64()    false
    #define FFSM2_ARCHITECTURE_32()    true

    #define FFSM2_64BIT_OR_32BIT(p64, p32)    p32
#else
    #error
#endif

The case for INTPTR_MAX == INT16_MAX is missing.

Possible Fix

Doing a simple find in the code, neither FFSM2_64BIT_OR_32BIT nor FFSM2_ARCHITECTURE_32/64 defines seems to be used.
Commenting out those defines the code seems to compile just fine. Are they really needed?

Steps to Reproduce

Unfortunately, the compiler I'm using is not publicly available right now. You could reproduce the error by redefining INTPTR_MAX as INT16_MAX.

Environment

  • Version used (clang --version): clang version 14.0.4
  • Operating System and version: not relevant

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.