Giter Club home page Giter Club logo

Comments (3)

lewissbaker avatar lewissbaker commented on August 20, 2024

There should already be a fallback for pre-Windows 8 versions implemented for the lightweight_manual_reset_event class. It uses Win32 manual reset event kernel objects instead.

You need to define _WIN32_WINNT=0x0600 (or whatever your minimum API level is) before building/using cppcoro. If not defined then it will default to assuming Windows 10.

See

#elif CPPCORO_OS_WINNT >= 0x0602
// Windows 8 or newer we can use WaitOnAddress()
std::atomic<std::uint8_t> m_value;
#elif CPPCORO_OS_WINNT
// Before Windows 8 we need to use a WIN32 manual reset event.
cppcoro::detail::win32::handle_t m_eventHandle;
#else

See also

/// \def CPPCORO_OS_WINNT
/// Defined to non-zero if the target platform is a WindowsNT variant.
/// 0x0500 - Windows 2000
/// 0x0501 - Windows XP/Server 2003
/// 0x0502 - Windows XP SP2/Server 2003 SP1
/// 0x0600 - Windows Vista/Server 2008
/// 0x0601 - Windows 7
/// 0x0602 - Windows 8
/// 0x0603 - Windows 8.1
/// 0x0A00 - Windows 10
#if defined(_WIN32_WINNT) || defined(_WIN32)
# if !defined(_WIN32_WINNT)
// Default to targeting Windows 10 if not defined.
# define _WIN32_WINNT 0x0A00
# endif
# define CPPCORO_OS_WINNT _WIN32_WINNT
#else
# define CPPCORO_OS_WINNT 0
#endif

from cppcoro.

lewissbaker avatar lewissbaker commented on August 20, 2024

I do eventually want to support detecting Windows 8 at runtime rather than at compile time.
eg. using GetProcAddress("WaitOnAddress") and using that if available and then falling back to CreateEvent() if needed.

from cppcoro.

akoolenbourke avatar akoolenbourke commented on August 20, 2024

Ahh OK, thanks Lewis. I would have sworn we set that. Will check.

from cppcoro.

Related Issues (20)

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.