<div dir="ltr">BTW, those WITH_* guards in ModemManager seem a bit inconsistent.<div><br></div><div>WITH_QMI, WITH_MBIM is only defined as 1 when enabled. The code has a mixed use of `#if WITH_XXX` and `#if defined WITH_XXX` for them. Other WITH_* is defined to be either 0 or 1, and the code uses `#if WITH_XXX`. Should we settle with one style?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 21, 2017 at 11:53 PM, Ben Chan <span dir="ltr"><<a href="mailto:benchan@chromium.org" target="_blank">benchan@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Commit fd0bed1df ("log: Add support for journal logging") added a<br>
configure option --with-systemd-journal to enable journal logging.<br>
However, configure always defines WITH_SYSTEMD_JOURNAL, which is either<br>
0 or 1. Thus, `#if WITH_SYSTEMD_JOURNAL` should be used instead of<br>
`#if defined WITH_SYSTEMD_JOURNAL` to properly guard the journal logging<br>
code.<br>
---<br>
src/mm-log.c | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/mm-log.c b/src/mm-log.c<br>
index 5691b26f..8b1fa425 100644<br>
--- a/src/mm-log.c<br>
+++ b/src/mm-log.c<br>
@@ -35,7 +35,7 @@<br>
#include <libmbim-glib.h><br>
#endif<br>
<br>
-#if defined WITH_SYSTEMD_JOURNAL<br>
+#if WITH_SYSTEMD_JOURNAL<br>
#define SD_JOURNAL_SUPPRESS_LOCATION<br>
#include <systemd/sd-journal.h><br>
#endif<br>
@@ -153,7 +153,7 @@ log_backend_syslog (const char *loc,<br>
syslog (syslog_level, "%s", message);<br>
}<br>
<br>
-#if defined WITH_SYSTEMD_JOURNAL<br>
+#if WITH_SYSTEMD_JOURNAL<br>
static void<br>
log_backend_systemd_journal (const char *loc,<br>
const char *func,<br>
@@ -301,7 +301,7 @@ mm_log_setup (const char *level,<br>
/* Grab start time for relative timestamps */<br>
g_get_current_time (&rel_start);<br>
<br>
-#if defined WITH_SYSTEMD_JOURNAL<br>
+#if WITH_SYSTEMD_JOURNAL<br>
if (log_journal) {<br>
log_backend = log_backend_systemd_journal;<br>
append_log_level_text = FALSE;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.1.611.g7e3b11ae1-goog<br>
<br>
______________________________<wbr>_________________<br>
ModemManager-devel mailing list<br>
<a href="mailto:ModemManager-devel@lists.freedesktop.org">ModemManager-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/modemmanager-<wbr>devel</a><br>
</font></span></blockquote></div><br></div>