aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/PluggableUSB.h
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/PluggableUSB.h')
-rw-r--r--cores/arduino/PluggableUSB.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/cores/arduino/PluggableUSB.h b/cores/arduino/PluggableUSB.h
index 824440a..b0668f4 100644
--- a/cores/arduino/PluggableUSB.h
+++ b/cores/arduino/PluggableUSB.h
@@ -66,7 +66,10 @@ private:
PUSBListNode* rootNode;
};
-extern PluggableUSB_ PluggableUSB;
+// Replacement for global singleton.
+// This function prevents static-initialization-order-fiasco
+// https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
+PluggableUSB_& PluggableUSB();
#endif