Skip to content

Commit

Permalink
Attempt to fix macro
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 4, 2024
1 parent cc496ea commit b88164c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions c/src/include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion c/src/p0836.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ const char *EMSCRIPTEN_KEEPALIVE p0836() {
return "aprilfoolsjoke";
}

PROGRAM_TAIL("%s", p0836)
PROGRAM_TAIL("s", p0836)
#endif
6 changes: 4 additions & 2 deletions cplusplus/src/include/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b88164c

Please sign in to comment.