summaryrefslogtreecommitdiffstats
path: root/src/shared/libosmocore/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-03-27 00:05:41 +0800
committerHarald Welte <laforge@gnumonks.org>2010-03-27 00:05:41 +0800
commit66188c0bf038d1a6727da552d0e9428020df5c13 (patch)
treebafad0c80d6d53e18cd83650dd58e1ea48ec6ef9 /src/shared/libosmocore/src
parent42b794668e0b0b21c98ea2d505c53f2f09048938 (diff)
parenta3b844cf45dc4d6a6a3686e8ce6e2447643b878e (diff)
Merge commit 'a3b844cf45dc4d6a6a3686e8ce6e2447643b878e'
Diffstat (limited to 'src/shared/libosmocore/src')
-rw-r--r--src/shared/libosmocore/src/logging.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/libosmocore/src/logging.c b/src/shared/libosmocore/src/logging.c
index ea03d303..7c508771 100644
--- a/src/shared/libosmocore/src/logging.c
+++ b/src/shared/libosmocore/src/logging.c
@@ -307,11 +307,14 @@ void log_set_category_filter(struct log_target *target, int category,
target->categories[category].loglevel = level;
}
+/* since C89/C99 says stderr is a macro, we can safely do this! */
+#ifdef stderr
static void _stderr_output(struct log_target *target, const char *log)
{
fprintf(target->tgt_stdout.out, "%s", log);
fflush(target->tgt_stdout.out);
}
+#endif
struct log_target *log_target_create(void)
{
@@ -342,6 +345,8 @@ struct log_target *log_target_create(void)
struct log_target *log_target_create_stderr(void)
{
+/* since C89/C99 says stderr is a macro, we can safely do this! */
+#ifdef stderr
struct log_target *target;
target = log_target_create();
@@ -351,6 +356,9 @@ struct log_target *log_target_create_stderr(void)
target->tgt_stdout.out = stderr;
target->output = _stderr_output;
return target;
+#else
+ return NULL;
+#endif /* stderr */
}
void log_init(const struct log_info *cat)