Boost configuration: Add macros and initial test file (#1575)
This commit is contained in:
parent
58b8cef822
commit
0aa4910244
|
@ -14,4 +14,10 @@
|
||||||
<not-null/>
|
<not-null/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- https://www.boost.org/doc/libs/master/libs/config/doc/html/boost_config/boost_macro_reference.html -->
|
||||||
|
<define name="BOOST_FORCEINLINE" value="inline"/>
|
||||||
|
<define name="BOOST_NOINLINE" value=""/>
|
||||||
|
<define name="BOOST_NORETURN" value="[[noreturn]]"/>
|
||||||
|
<define name="BOOST_LIKELY(X)" value="(X)"/>
|
||||||
|
<define name="BOOST_UNLIKELY(X)" value="(X)"/>
|
||||||
</def>
|
</def>
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
// Test library configuration for boost.cfg
|
||||||
|
//
|
||||||
|
// Usage:
|
||||||
|
// $ cppcheck --check-library --enable=information --error-exitcode=1 --suppress=missingIncludeSystem --inline-suppr test/cfg/boost.cpp
|
||||||
|
// =>
|
||||||
|
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
BOOST_FORCEINLINE void boost_forceinline_test()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_NOINLINE void boost_noinline_test()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_NORETURN void boost_noreturn_test()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void valid_code()
|
||||||
|
{
|
||||||
|
if (BOOST_LIKELY(1)) {
|
||||||
|
}
|
||||||
|
if (BOOST_UNLIKELY(0)) {
|
||||||
|
}
|
||||||
|
}
|
|
@ -126,6 +126,19 @@ else
|
||||||
fi
|
fi
|
||||||
${CPPCHECK} ${CPPCHECK_OPT} --inconclusive --library=gtk -f ${DIR}gtk.c
|
${CPPCHECK} ${CPPCHECK_OPT} --inconclusive --library=gtk -f ${DIR}gtk.c
|
||||||
|
|
||||||
|
# boost.cpp
|
||||||
|
set +e
|
||||||
|
echo -e "#include <boost/config.hpp>" | ${CXX} ${CXX_OPT} -x c++ -
|
||||||
|
BOOSTCHECK_RETURNCODE=$?
|
||||||
|
set -e
|
||||||
|
if [ ${BOOSTCHECK_RETURNCODE} -ne 0 ]; then
|
||||||
|
echo "Boost not completely present or not working, skipping syntax check with ${CXX}."
|
||||||
|
else
|
||||||
|
echo "Boost found and working, checking syntax with ${CXX} now."
|
||||||
|
${CXX} ${CXX_OPT} ${DIR}boost.cpp
|
||||||
|
fi
|
||||||
|
${CPPCHECK} ${CPPCHECK_OPT} --inconclusive --library=boost ${DIR}boost.cpp
|
||||||
|
|
||||||
# Check the syntax of the defines in the configuration files
|
# Check the syntax of the defines in the configuration files
|
||||||
set +e
|
set +e
|
||||||
xmlstarlet --version
|
xmlstarlet --version
|
||||||
|
|
Loading…
Reference in New Issue