Menu

#60 BBMD compile error when disabled

v0.8.6
open
nobody
1
2018-12-20
2018-12-20
No

When BBMD_ENABLED is set to 0 in the main Makefile, compilation fails.

make -s -C lib all
../src/bvlc.c: In function bvlc_get_bdt_local’:
../src/bvlc.c:1756:14: error: BBMD_Table undeclared (first use in this function)
     *table = BBMD_Table;
              ^~~~~~~~~~
../src/bvlc.c:1756:14: note: each undeclared identifier is reported only once for each function it appears in
../src/bvlc.c:1758:29: error: MAX_BBMD_ENTRIES undeclared (first use in this function); did you mean BBMD_ENABLED?
     for (count = 0; count < MAX_BBMD_ENTRIES; ++count) {
                             ^~~~~~~~~~~~~~~~
                             BBMD_ENABLED
../src/bvlc.c: In function bvlc_clear_bdt_local’:
../src/bvlc.c:1773:21: error: MAX_BBMD_ENTRIES undeclared (first use in this function); did you mean BBMD_ENABLED?
     for (i = 0; i < MAX_BBMD_ENTRIES; ++i) {
                     ^~~~~~~~~~~~~~~~
                     BBMD_ENABLED
../src/bvlc.c:1774:9: error: BBMD_Table undeclared (first use in this function)
         BBMD_Table[i].valid = false;
         ^~~~~~~~~~
../src/bvlc.c: In function bvlc_add_bdt_entry_local’:
../src/bvlc.c:1797:21: error: MAX_BBMD_ENTRIES undeclared (first use in this function); did you mean BBMD_ENABLED?
     for (i = 0; i < MAX_BBMD_ENTRIES; ++i) {
                     ^~~~~~~~~~~~~~~~
                     BBMD_ENABLED
../src/bvlc.c:1798:14: error: BBMD_Table undeclared (first use in this function)
         if (!BBMD_Table[i].valid) {
              ^~~~~~~~~~
Makefile:216: recipe for target '../src/bvlc.o' failed
make[1]: *** [../src/bvlc.o] Error 1
Makefile:68: recipe for target 'library' failed
make: *** [library] Error 2

Adding an ifdef/endif from line 1738 to 1825 solves the issue.

#if defined(BBMD_ENABLED) && BBMD_ENABLED
...
#endif

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB