diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-21 11:26:59 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-21 11:26:59 +0100 |
| commit | 3c82771d65f65f2cc5f4bfd4791014da07620518 (patch) | |
| tree | da6d3d64fd95ed043579ec3bc1a595e1f795bfeb /any_log.h | |
| parent | 7d5858fe44c4007dbf15b12846937e7208a5a95e (diff) | |
Make the lib c++ friendly
Diffstat (limited to 'any_log.h')
| -rw-r--r-- | any_log.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -192,6 +192,10 @@ typedef enum { #define ANY_LOG_ATTRIBUTE(...) #endif +#ifdef __cpluscplus +extern "C" { +#endif + // All log functions will ignore the message if the level is below the // threshold specified in any_log_level. // @@ -234,6 +238,10 @@ ANY_LOG_ATTRIBUTE(nonnull(1, 4)) void any_log_panic(const char *file, int line, const char *module, const char *func, const char *format, ...); +#ifdef __cpluscplus +} +#endif + #endif #ifdef ANY_LOG_IMPLEMENT @@ -287,9 +295,9 @@ const char *any_log_level_to_string(any_log_level_t level) any_log_level_t any_log_level_from_string(const char *string) { - for (any_log_level_t level = ANY_LOG_PANIC; level < ANY_LOG_ALL; level++) { + for (int level = ANY_LOG_PANIC; level < ANY_LOG_ALL; level++) { if (strcmp(any_log_level_strings[level], string) == 0) - return level; + return (any_log_level_t)level; } return ANY_LOG_ALL; |
