diff --git a/code/Modules/Core/Creator.h b/code/Modules/Core/Creator.h index 2400f7143..abec04bd8 100644 --- a/code/Modules/Core/Creator.h +++ b/code/Modules/Core/Creator.h @@ -11,17 +11,17 @@ #include "Core/Ptr.h" #include -#if defined(__GNUC__) && !defined(__clang__) +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4) || (__GNUC__ == 8 && __GNUC_MINOR__ <1)) /** WORKAROUND for GCC bug 'lambda argument pack' **/ #define OryolClassCreator(TYPE) \ public:\ -static std::function()> Creator() {\ +static Ptr(*Creator())() {\ return [] { return Create(); };\ }; #else #define OryolClassCreator(TYPE) \ public:\ -template static std::function()> Creator(ARGS... args) {\ +template static Ptr(*Creator(ARGS... args))() {\ return [args...] { return Create(args...); };\ }; #endif