Allow lambda on platforms which support it, can be forced with HAS_FUNCTIONAL 0/1

This commit is contained in:
etrinh 2020-06-30 22:40:19 +02:00
parent f0fcfe3b86
commit 4cf3dab9a6

View File

@ -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 (<functional>)
# define HAS_FUNCTIONAL 1
# else
# define HAS_FUNCTIONAL 0
# endif
# else
# define HAS_FUNCTIONAL 0
# endif
#endif
#if HAS_FUNCTIONAL
#include <functional>
typedef std::function<void(GroupObject&)> GroupObjectUpdatedHandler;
#else