diff --git a/c/src/include/macros.h b/c/src/include/macros.h index eee58ab3..7c9070cf 100644 --- a/c/src/include/macros.h +++ b/c/src/include/macros.h @@ -102,10 +102,12 @@ #define MAX_POW_10_128 ((uintmax_t) MAX_POW_10_64 * (uintmax_t) MAX_POW_10_64) #define POW_OF_MAX_POW_10_128 38 +#ifndef UNITY_END #define PROGRAM_TAIL(type, prob) \ -#ifndef UNITY_END \ int main(int argc, char const *argv[]) { \ printf("%" type "\n", prob()); return 0; \ -} \ +} +#else +#define PROGRAM_TAIL(type, prob) #endif diff --git a/c/src/p0836.c b/c/src/p0836.c index 3f0aaaa7..ba7a6ffa 100644 --- a/c/src/p0836.c +++ b/c/src/p0836.c @@ -25,5 +25,5 @@ const char *EMSCRIPTEN_KEEPALIVE p0836() { return "aprilfoolsjoke"; } -PROGRAM_TAIL("%s", p0836) +PROGRAM_TAIL("s", p0836) #endif diff --git a/cplusplus/src/include/macros.hpp b/cplusplus/src/include/macros.hpp index cca9edbd..504045c2 100644 --- a/cplusplus/src/include/macros.hpp +++ b/cplusplus/src/include/macros.hpp @@ -74,10 +74,12 @@ #define MAX_POW_10_128 ((uintmax_t) MAX_POW_10_64 * (uintmax_t) MAX_POW_10_64) #define POW_OF_MAX_POW_10_128 38 +#ifndef UNITY_END #define PROGRAM_TAIL(prob) \ -#ifndef UNITY_END \ int main(int argc, char const *argv[]) { \ std::cout << prob() << std::endl; \ return 0; \ -} \ +} +#else +#define PROGRAM_TAIL(prob) #endif