Fix: log_level usage on mingw platform
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 3 Jul 2019 21:46:45 +0000 (17:46 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 4 Jul 2019 21:46:29 +0000 (17:46 -0400)
commit95c324a414e7d862985caaf49bdb58f0cdfa2647
treeb190ac5c2d8aa94fdb0110c03077ceab988bb037
parent0408934a2ff110ed1c5bf3719ae6b650b5834146
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>
src/common/mmap-align.h
src/compat/mman.c
src/compat/mman.h
src/compat/socket.h
src/plugins/ctf/fs-src/data-stream-file.c
src/plugins/ctf/lttng-live/viewer-connection.c
This page took 0.026096 seconds and 4 git commands to generate.