Remove remaining C++ from kelvin.h, include in hello_world - Remove the inclusion of <algorithm> from kelvin.h, so that there is no C++ remaining and we can include it from C. - Include the header in hello_world, so that there is a canary for any modifications to kelvin.h that would be incompatible. Change-Id: I1d147395cd85c8f9ff6edae3593d5a68f1fed177
diff --git a/crt/kelvin.h b/crt/kelvin.h index cd7be88..9a16617 100644 --- a/crt/kelvin.h +++ b/crt/kelvin.h
@@ -11,8 +11,6 @@ #include <stdint.h> #include <string.h> -#include <algorithm> - #define __volatile_always__ volatile // Helper macros for Intrinsics definitions.
diff --git a/examples/hello_world/hello_world.c b/examples/hello_world/hello_world.c index aa96624..25f114b 100644 --- a/examples/hello_world/hello_world.c +++ b/examples/hello_world/hello_world.c
@@ -16,6 +16,10 @@ #include <stddef.h> #include <stdint.h> +// This header is included to ensure that it can +// be referenced from a C file. +#include "crt/kelvin.h" + typedef struct { uint32_t return_code; // Populated in kelvin_start.S. uint32_t output_ptr;