Fix: log_level usage on mingw platform
The mingw build was simply broken.
For example:
mman.c: In function 'mmap_lock':
mman.c:29:30: error: 'mapping' undeclared (first use in this function)
29 | #define BT_LOG_OUTPUT_LEVEL (mapping->log_level)
| ^~~~~~~
../../src/logging/log.h:165:31: note: in expansion of macro 'BT_LOG_OUTPUT_LEVEL'
165 | #define _BT_LOG_OUTPUT_LEVEL BT_LOG_OUTPUT_LEVEL
| ^~~~~~~~~~~~~~~~~~~
../../src/logging/log.h:671:38: note: in expansion of macro '_BT_LOG_OUTPUT_LEVEL'
671 | (BT_LOG_ENABLED((lvl)) && (lvl) >= _BT_LOG_OUTPUT_LEVEL)
| ^~~~~~~~~~~~~~~~~~~~
../../src/logging/log.h:835:9: note: in expansion of macro 'BT_LOG_ON'
835 | if (BT_LOG_ON(lvl)) \
| ^~~~~~~~~
../../src/logging/log.h:974:4: note: in expansion of macro 'BT_LOG_WRITE'
974 | BT_LOG_WRITE(BT_LOG_FATAL, _BT_LOG_TAG, __VA_ARGS__)
| ^~~~~~~~~~~~
../../src/logging/log.h:995:24: note: in expansion of macro 'BT_LOGF'
995 | #define BT_LOGF_STR(s) BT_LOGF("%s", (s))
| ^~~~~~~
mman.c:122:3: note: in expansion of macro 'BT_LOGF_STR'
122 | BT_LOGF_STR("Failed to acquire mmap_mutex.");
| ^~~~~~~~~~~
mman.c:29:30: note: each undeclared identifier is reported only once for each function it appears in
29 | #define BT_LOG_OUTPUT_LEVEL (mapping->log_level)
| ^~~~~~~
../../src/logging/log.h:165:31: note: in expansion of macro 'BT_LOG_OUTPUT_LEVEL'
165 | #define _BT_LOG_OUTPUT_LEVEL BT_LOG_OUTPUT_LEVEL
| ^~~~~~~~~~~~~~~~~~~
../../src/logging/log.h:671:38: note: in expansion of macro '_BT_LOG_OUTPUT_LEVEL'
671 | (BT_LOG_ENABLED((lvl)) && (lvl) >= _BT_LOG_OUTPUT_LEVEL)
| ^~~~~~~~~~~~~~~~~~~~
../../src/logging/log.h:835:9: note: in expansion of macro 'BT_LOG_ON'
835 | if (BT_LOG_ON(lvl)) \
| ^~~~~~~~~
../../src/logging/log.h:974:4: note: in expansion of macro 'BT_LOG_WRITE'
974 | BT_LOG_WRITE(BT_LOG_FATAL, _BT_LOG_TAG, __VA_ARGS__)
| ^~~~~~~~~~~~
../../src/logging/log.h:995:24: note: in expansion of macro 'BT_LOGF'
995 | #define BT_LOGF_STR(s) BT_LOGF("%s", (s))
| ^~~~~~~
mman.c:122:3: note: in expansion of macro 'BT_LOGF_STR'
122 | BT_LOGF_STR("Failed to acquire mmap_mutex.");
| ^~~~~~~~~~~
mman.c: In function 'mmap_unlock':
mman.c:29:30: error: 'mapping' undeclared (first use in this function)
29 | #define BT_LOG_OUTPUT_LEVEL (mapping->log_level)
| ^~~~~~~
../../src/logging/log.h:165:31: note: in expansion of macro 'BT_LOG_OUTPUT_LEVEL'
165 | #define _BT_LOG_OUTPUT_LEVEL BT_LOG_OUTPUT_LEVEL
| ^~~~~~~~~~~~~~~~~~~
../../src/logging/log.h:671:38: note: in expansion of macro '_BT_LOG_OUTPUT_LEVEL'
671 | (BT_LOG_ENABLED((lvl)) && (lvl) >= _BT_LOG_OUTPUT_LEVEL)
| ^~~~~~~~~~~~~~~~~~~~
../../src/logging/log.h:835:9: note: in expansion of macro 'BT_LOG_ON'
835 | if (BT_LOG_ON(lvl)) \
| ^~~~~~~~~
../../src/logging/log.h:974:4: note: in expansion of macro 'BT_LOG_WRITE'
974 | BT_LOG_WRITE(BT_LOG_FATAL, _BT_LOG_TAG, __VA_ARGS__)
| ^~~~~~~~~~~~
../../src/logging/log.h:995:24: note: in expansion of macro 'BT_LOGF'
995 | #define BT_LOGF_STR(s) BT_LOGF("%s", (s))
| ^~~~~~~
mman.c:131:3: note: in expansion of macro 'BT_LOGF_STR'
131 | BT_LOGF_STR("Failed to release mmap_mutex.");
| ^~~~~~~~~~~
mman.c: At top level:
mman.c:173:7: error: conflicting types for 'bt_mmap'
173 | void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
| ^~~~~~~
In file included from mman.c:53:
../../src/compat/mman.h:48:7: note: previous declaration of 'bt_mmap' was here
48 | void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
| ^~~~~~~
mman.c: In function 'bt_mmap':
mman.c:202:12: error: too many arguments to function 'mapping_create'
202 | mapping = mapping_create(log_level);
| ^~~~~~~~~~~~~~
mman.c:73:22: note: declared here
73 | struct mmap_mapping *mapping_create(void)
| ^~~~~~~~~~~~~~
make[2]: *** [Makefile:501: mman.lo] Error 1
Change-Id: I71b36504541382cadf09953d9e113adc6c3641b6
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1610
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.028483 seconds and 4 git commands to generate.