Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
2f81256f
Commit
2f81256f
authored
Mar 01, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
34b0a2e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
test_for_odr_violations.cpp
dlib/test_for_odr_violations.cpp
+4
-4
test_for_odr_violations.h
dlib/test_for_odr_violations.h
+8
-11
No files found.
dlib/test_for_odr_violations.cpp
View file @
2f81256f
...
...
@@ -11,9 +11,9 @@ extern "C"
// from compiling part of their application with DLIB_ASSERT enabled and part with them
// disabled since doing that would be a violation of C++'s one definition rule.
#ifdef ENABLE_ASSERTS
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1
;
const
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1
=
0
;
#else
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_
;
const
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_
=
0
;
#endif
...
...
@@ -29,7 +29,7 @@ extern "C"
// Or even better, don't install dlib at all and instead build your program as shown in
// examples/CMakeLists.txt
#if defined(DLIB_NOT_CONFIGURED) && !defined(DLIB__CMAKE_GENERATED_A_CONFIG_H_FILE)
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2
;
const
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2
=
0
;
#endif
...
...
@@ -37,7 +37,7 @@ extern "C"
#ifdef DLIB_CHECK_FOR_VERSION_MISSMATCH
int
DLIB_CHECK_FOR_VERSION_MISSMATCH
;
const
int
DLIB_CHECK_FOR_VERSION_MISSMATCH
=
0
;
#endif
}
...
...
dlib/test_for_odr_violations.h
View file @
2f81256f
...
...
@@ -17,13 +17,12 @@ extern "C"
// you have simply forgotten to compile dlib/all/source.cpp into your application.
// =========================>>> WHY YOU ARE GETTING AN ERROR HERE <<<=========================
#ifdef ENABLE_ASSERTS
extern
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1
;
inline
int
dlib_check_consistent_assert_usage
()
{
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1
=
0
;
return
0
;
}
const
extern
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1
;
const
int
DLIB_NO_WARN_UNUSED
dlib_check_assert_helper_variable
=
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1
;
#else
extern
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_
;
inline
int
dlib_check_consistent_assert_usage
()
{
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_
=
0
;
return
0
;
}
const
extern
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_
;
const
int
DLIB_NO_WARN_UNUSED
dlib_check_assert_helper_variable
=
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_
;
#endif
const
int
DLIB_NO_WARN_UNUSED
dlib_check_assert_helper_variable
=
dlib_check_consistent_assert_usage
();
...
...
@@ -39,9 +38,8 @@ extern "C"
// Or even better, don't install dlib at all and instead build your program as shown in
// examples/CMakeLists.txt
#if defined(DLIB_NOT_CONFIGURED) && !defined(DLIB__CMAKE_GENERATED_A_CONFIG_H_FILE)
extern
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2
;
inline
int
dlib_check_consistent_config_h_usage
()
{
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2
=
0
;
return
0
;
}
const
int
DLIB_NO_WARN_UNUSED
dlib_check_not_configured_helper_variable
=
dlib_check_consistent_config_h_usage
();
const
extern
int
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2
;
const
int
DLIB_NO_WARN_UNUSED
dlib_check_not_configured_helper_variable
=
USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2
;
#endif
...
...
@@ -49,9 +47,8 @@ extern "C"
// Cause the user to get a linker error if they try to use header files from one version of
// dlib with the compiled binary from a different version of dlib.
#ifdef DLIB_CHECK_FOR_VERSION_MISSMATCH
extern
int
DLIB_CHECK_FOR_VERSION_MISSMATCH
;
inline
int
dlib_check_for_dlib_version_missmatch
()
{
DLIB_CHECK_FOR_VERSION_MISSMATCH
=
0
;
return
0
;
}
const
int
DLIB_NO_WARN_UNUSED
dlib_check_for_version_missmatch
=
dlib_check_for_dlib_version_missmatch
();
const
extern
int
DLIB_CHECK_FOR_VERSION_MISSMATCH
;
const
int
DLIB_NO_WARN_UNUSED
dlib_check_for_version_missmatch
=
DLIB_CHECK_FOR_VERSION_MISSMATCH
;
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment