From 4cf3dab9a693c9ee0ab3b41ed2002407f4c35e4c Mon Sep 17 00:00:00 2001 From: etrinh Date: Tue, 30 Jun 2020 22:40:19 +0200 Subject: [PATCH] Allow lambda on platforms which support it, can be forced with HAS_FUNCTIONAL 0/1 --- src/knx/group_object.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/knx/group_object.h b/src/knx/group_object.h index 0e71b96..a4227be 100644 --- a/src/knx/group_object.h +++ b/src/knx/group_object.h @@ -19,7 +19,21 @@ enum ComFlag class GroupObject; -#ifdef __linux__ +#ifndef HAS_FUNCTIONAL +# if defined(__linux__) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_STM32) +# define HAS_FUNCTIONAL 1 +# elif defined(__has_include) +# if __has_include () +# define HAS_FUNCTIONAL 1 +# else +# define HAS_FUNCTIONAL 0 +# endif +# else +# define HAS_FUNCTIONAL 0 +# endif +#endif + +#if HAS_FUNCTIONAL #include typedef std::function GroupObjectUpdatedHandler; #else