Friday, 9 August 2013

Why can't I pass typedef or enum in Arduino?

Why can't I pass typedef or enum in Arduino?

The following sketch to fails to compile in the Arduino environment.
Given that typedefs can be used within Arduino software, is Automatic
Prototype Generation the underlying mechanism that causes the failure? If
so, what is it and why isn't Arduino providing a lightweight wrapper
around C++?
#define PRODUCE_WACKY_COMPILETIME_ERROR
typedef int MyMeaningfulType;
#ifndef PRODUCE_WACKY_COMPILETIME_ERROR
void myFunc(MyMeaningfulType myParam);

No comments:

Post a Comment