Skip to content

Commit

Permalink
Introduce CPPSORT_DEPRECATED, disable it in the test suite
Browse files Browse the repository at this point in the history
This is the first step to needed to deprecate and remove components from
the library (see issues #167 and #168).
  • Loading branch information
Morwenn committed Jul 17, 2020
1 parent 861a668 commit 7ff8716
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion include/cpp-sort/detail/config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2016-2019 Morwenn
* Copyright (c) 2016-2020 Morwenn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -96,4 +96,19 @@
# endif
#endif

////////////////////////////////////////////////////////////
// CPPSORT_DEPRECATED

// [[deprecated]] is available since C++14, hence why this
// macro is not in attributes.h: we hide it behind a macro
// to make sure that it can be silenced

#ifndef CPPSORT_DEPRECATED
# ifndef CPPSORT_DISABLE_DEPRECATION_WARNINGS
# define CPPSORT_DEPRECATED(message) [[deprecated(message)]]
# else
# define CPPSORT_DEPRECATED(message)
# endif
#endif

#endif // CPPSORT_DETAIL_CONFIG_H_
2 changes: 2 additions & 0 deletions testsuite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ macro(configure_tests target)
CATCH_CONFIG_DISABLE_MATCHERS
# Enable assertions for more thorough tests
CPPSORT_ENABLE_ASSERTIONS
# We test deprecated code but we don't want it to warn
CPPSORT_DISABLE_DEPRECATION_WARNINGS
)

# More warnings and settings
Expand Down

0 comments on commit 7ff8716

Please sign in to comment.