Skip to content

Commit 546460f

Browse files
author
topin89
committed
Dlib compilation config fixed
Dlib usually compiles as a library. So there is some checks for ODR and that version used is the same across compilation units. Unfortunately, there is a bug where ODR is checked regardless of check configs. Fixed.
1 parent 19cdc72 commit 546460f

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

benchmarks/dlib/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// always off. If you don't define one of these two macros then DLIB_ASSERT will toggle
88
// automatically depending on the state of certain other macros, which is not what you want
99
// when creating a shared library.
10-
#define ENABLE_ASSERTS // asserts always enabled
10+
// #define ENABLE_ASSERTS // asserts always enabled
1111
/* #undef DLIB_DISABLE_ASSERTS */
1212

1313
/* #undef DLIB_ISO_CPP_ONLY */
@@ -30,5 +30,5 @@
3030

3131
// This variable allows dlib/test_for_odr_violations.h to catch people who mistakenly use
3232
// headers from one version of dlib with a compiled dlib binary from a different dlib version.
33-
#define DLIB_CHECK_FOR_VERSION_MISMATCH DLIB_VERSION_MISMATCH_CHECK__EXPECTED_VERSION_19_21_99
33+
// #define DLIB_CHECK_FOR_VERSION_MISMATCH DLIB_VERSION_MISMATCH_CHECK__EXPECTED_VERSION_19_21_99
3434

benchmarks/dlib/test_for_odr_violations.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ extern "C"
1919
#ifdef ENABLE_ASSERTS
2020
const extern int USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1;
2121
const int DLIB_NO_WARN_UNUSED dlib_check_assert_helper_variable = USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1;
22-
#else
23-
const extern int USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_;
24-
const int DLIB_NO_WARN_UNUSED dlib_check_assert_helper_variable = USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_;
2522
#endif
2623

2724

0 commit comments

Comments
 (0)