port to platformio

This commit is contained in:
2021-03-29 01:10:55 -07:00
parent 9a3bf84214
commit a6534bcb20
131 changed files with 1537 additions and 1148 deletions

16
src/Static.h Normal file
View File

@@ -0,0 +1,16 @@
#pragma once
// Utility class mostly for when certain inputs need singleton callback handlers
template<typename T> class Static {
public:
static T* instance() {
return s_instance;
}
private:
static T* s_instance;
};
#define NAMED_STATIC_ALLOC(Cls, StaticName) static Cls _staticAlloc__ ## StaticName;\
template<> Cls* Static<Cls>::s_instance=&_staticAlloc__ ## StaticName;
#define STATIC_ALLOC(Cls) NAMED_STATIC_ALLOC(Cls, Cls)