diff --git a/tensorflow/lite/micro/examples/hello_world/main_functions.h b/tensorflow/lite/micro/examples/hello_world/main_functions.h index e595cd87c8b..a1ea715c608 100644 --- a/tensorflow/lite/micro/examples/hello_world/main_functions.h +++ b/tensorflow/lite/micro/examples/hello_world/main_functions.h @@ -16,6 +16,11 @@ limitations under the License. #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_MAIN_FUNCTIONS_H_ #define TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_MAIN_FUNCTIONS_H_ +// Expose a C friendly interface for main functions. +#ifdef __cplusplus +extern "C" { +#endif + // Initializes all data needed for the example. The name is important, and needs // to be setup() for Arduino compatibility. void setup(); @@ -25,4 +30,8 @@ void setup(); // compatibility. void loop(); +#ifdef __cplusplus +} +#endif + #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_HELLO_WORLD_MAIN_FUNCTIONS_H_ diff --git a/tensorflow/lite/micro/examples/magic_wand/main_functions.h b/tensorflow/lite/micro/examples/magic_wand/main_functions.h index 18671538c30..d69755b3a58 100644 --- a/tensorflow/lite/micro/examples/magic_wand/main_functions.h +++ b/tensorflow/lite/micro/examples/magic_wand/main_functions.h @@ -16,6 +16,11 @@ limitations under the License. #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_MAGIC_WAND_MAIN_FUNCTIONS_H_ #define TENSORFLOW_LITE_MICRO_EXAMPLES_MAGIC_WAND_MAIN_FUNCTIONS_H_ +// Expose a C friendly interface for main functions. +#ifdef __cplusplus +extern "C" { +#endif + // Initializes all data needed for the example. The name is important, and needs // to be setup() for Arduino compatibility. void setup(); @@ -25,4 +30,8 @@ void setup(); // compatibility. void loop(); +#ifdef __cplusplus +} +#endif + #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_MAGIC_WAND_MAIN_FUNCTIONS_H_ diff --git a/tensorflow/lite/micro/examples/micro_speech/main_functions.h b/tensorflow/lite/micro/examples/micro_speech/main_functions.h index 19599343652..0ac06771056 100644 --- a/tensorflow/lite/micro/examples/micro_speech/main_functions.h +++ b/tensorflow/lite/micro/examples/micro_speech/main_functions.h @@ -16,6 +16,11 @@ limitations under the License. #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MAIN_FUNCTIONS_H_ #define TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MAIN_FUNCTIONS_H_ +// Expose a C friendly interface for main functions. +#ifdef __cplusplus +extern "C" { +#endif + // Initializes all data needed for the example. The name is important, and needs // to be setup() for Arduino compatibility. void setup(); @@ -25,4 +30,8 @@ void setup(); // compatibility. void loop(); +#ifdef __cplusplus +} +#endif + #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MAIN_FUNCTIONS_H_ diff --git a/tensorflow/lite/micro/examples/person_detection/main_functions.h b/tensorflow/lite/micro/examples/person_detection/main_functions.h index 2120ea92ddb..2620097a833 100644 --- a/tensorflow/lite/micro/examples/person_detection/main_functions.h +++ b/tensorflow/lite/micro/examples/person_detection/main_functions.h @@ -16,6 +16,11 @@ limitations under the License. #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ #define TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ +// Expose a C friendly interface for main functions. +#ifdef __cplusplus +extern "C" { +#endif + // Initializes all data needed for the example. The name is important, and needs // to be setup() for Arduino compatibility. void setup(); @@ -25,4 +30,8 @@ void setup(); // compatibility. void loop(); +#ifdef __cplusplus +} +#endif + #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_