mirror of
https://github.com/boostorg/config.git
synced 2025-07-30 04:17:16 +02:00
Fix some warnings and miswritten test case, add test for BOOST_HAS_PRAGMA_DETECT_MISMATCH.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#
|
||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
||||
# This file was automatically generated on Tue Mar 6 17:44:35 2018
|
||||
# This file was automatically generated on Wed Apr 18 20:03:40 2018
|
||||
# by libs/config/tools/generate.cpp
|
||||
# Copyright John Maddock.
|
||||
# Use, modification and distribution are subject to the
|
||||
@ -14,6 +14,7 @@ import path ;
|
||||
obj two_arg_use_facet : test_case.cpp : <define>TEST_BOOST_HAS_TWO_ARG_USE_FACET ;
|
||||
obj bethreads : test_case.cpp : <define>TEST_BOOST_HAS_BETHREADS ;
|
||||
obj clock_gettime : test_case.cpp : <define>TEST_BOOST_HAS_CLOCK_GETTIME ;
|
||||
obj pragma_detect_mismatch : test_case.cpp : <define>TEST_BOOST_HAS_PRAGMA_DETECT_MISMATCH ;
|
||||
obj dirent_h : test_case.cpp : <define>TEST_BOOST_HAS_DIRENT_H ;
|
||||
obj expm1 : test_case.cpp : <define>TEST_BOOST_HAS_EXPM1 ;
|
||||
obj float128 : test_case.cpp : <define>TEST_BOOST_HAS_FLOAT128 ;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on Tue Mar 6 17:44:35 2018
|
||||
// This file was automatically generated on Wed Apr 18 20:03:40 2018
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
@ -26,6 +26,11 @@
|
||||
# error "Feature macro BOOST_HAS_CLOCK_GETTIME is not defined."
|
||||
# endif
|
||||
#endif
|
||||
#ifdef TEST_BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
# ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
# error "Feature macro BOOST_HAS_PRAGMA_DETECT_MISMATCH is not defined."
|
||||
# endif
|
||||
#endif
|
||||
#ifdef TEST_BOOST_HAS_DIRENT_H
|
||||
# ifndef BOOST_HAS_DIRENT_H
|
||||
# error "Feature macro BOOST_HAS_DIRENT_H is not defined."
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Regression test Jamfile for boost configuration setup.
|
||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
||||
# This file was automatically generated on Tue Mar 6 17:44:35 2018
|
||||
# This file was automatically generated on Wed Apr 18 20:03:40 2018
|
||||
# by libs/config/tools/generate.cpp
|
||||
# Copyright John Maddock.
|
||||
# Use, modification and distribution are subject to the
|
||||
@ -31,6 +31,9 @@ test-suite "BOOST_HAS_BETHREADS" :
|
||||
test-suite "BOOST_HAS_CLOCK_GETTIME" :
|
||||
[ run ../has_clock_gettime_pass.cpp ]
|
||||
[ compile-fail ../has_clock_gettime_fail.cpp ] ;
|
||||
test-suite "BOOST_HAS_PRAGMA_DETECT_MISMATCH" :
|
||||
[ run ../has_detect_mismatch_pass.cpp ]
|
||||
[ compile-fail ../has_detect_mismatch_fail.cpp ] ;
|
||||
test-suite "BOOST_HAS_DIRENT_H" :
|
||||
[ run ../has_dirent_h_pass.cpp ]
|
||||
[ compile-fail ../has_dirent_h_fail.cpp ] ;
|
||||
|
24
test/boost_has_detect_mismatch.ipp
Normal file
24
test/boost_has_detect_mismatch.ipp
Normal file
@ -0,0 +1,24 @@
|
||||
// (C) Copyright John Maddock 2018.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/config for most recent version.
|
||||
|
||||
// MACRO: BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
// TITLE: detect_mismatch pragma
|
||||
// DESCRIPTION: The compiler supports #pragma detect_mismatch
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
namespace boost_has_pragma_detect_mismatch {
|
||||
|
||||
int test()
|
||||
{
|
||||
# pragma detect_mismatch("Boost_Config", "1")
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ namespace boost_has_partial_std_allocator{
|
||||
//
|
||||
|
||||
template <class T>
|
||||
int test_allocator(const T& i)
|
||||
int test_allocator(const T&)
|
||||
{
|
||||
typedef std::allocator<int> alloc1_t;
|
||||
#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700)))
|
||||
|
@ -52,6 +52,8 @@ int test()
|
||||
a1 |= 2;
|
||||
a1 ^= 3;
|
||||
|
||||
a2 = 0u;
|
||||
|
||||
a3.store(&v);
|
||||
a3.fetch_add(1);
|
||||
a3.fetch_sub(1);
|
||||
|
@ -17,6 +17,7 @@ namespace boost_no_cxx11_hdr_tuple {
|
||||
int test()
|
||||
{
|
||||
std::tuple<int, int, long> t(0, 1, 2);
|
||||
(void)t;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ namespace boost_no_cxx11_pointer_traits {
|
||||
template<class T>
|
||||
struct pointer {
|
||||
template<class U>
|
||||
using rebind = pointer<bool>;
|
||||
using rebind = pointer<U>;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
@ -31,7 +31,7 @@ struct result<pointer<bool> > {
|
||||
|
||||
int test()
|
||||
{
|
||||
return result<std::pointer_traits<pointer<int> >::rebind<char> >::value;
|
||||
return result<std::pointer_traits<pointer<int> >::rebind<bool> >::value;
|
||||
}
|
||||
|
||||
} /* boost_no_cxx11_pointer_traits */
|
||||
|
@ -25,7 +25,7 @@ namespace boost_no_std_allocator{
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
int test_allocator(const T& i)
|
||||
int test_allocator(const T&)
|
||||
{
|
||||
typedef std::allocator<int> alloc1_t;
|
||||
#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700)))
|
||||
|
@ -1054,6 +1054,7 @@ void print_boost_macros()
|
||||
PRINT_MACRO(BOOST_HAS_NL_TYPES_H);
|
||||
PRINT_MACRO(BOOST_HAS_NRVO);
|
||||
PRINT_MACRO(BOOST_HAS_PARTIAL_STD_ALLOCATOR);
|
||||
PRINT_MACRO(BOOST_HAS_PRAGMA_DETECT_MISMATCH);
|
||||
PRINT_MACRO(BOOST_HAS_PTHREADS);
|
||||
PRINT_MACRO(BOOST_HAS_PTHREAD_DELAY_NP);
|
||||
PRINT_MACRO(BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE);
|
||||
@ -1235,6 +1236,7 @@ void print_boost_macros()
|
||||
|
||||
|
||||
|
||||
|
||||
// END GENERATED BLOCK
|
||||
|
||||
PRINT_MACRO(BOOST_INTEL);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on Tue Mar 6 17:44:35 2018
|
||||
// This file was automatically generated on Wed Apr 18 20:03:40 2018
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
@ -823,6 +823,11 @@ namespace boost_has_bethreads = empty_boost;
|
||||
#else
|
||||
namespace boost_has_clock_gettime = empty_boost;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
#include "boost_has_detect_mismatch.ipp"
|
||||
#else
|
||||
namespace boost_has_pragma_detect_mismatch = empty_boost;
|
||||
#endif
|
||||
#ifdef BOOST_HAS_DIRENT_H
|
||||
#include "boost_has_dirent_h.ipp"
|
||||
#else
|
||||
@ -1006,6 +1011,11 @@ int main( int, char *[] )
|
||||
std::cerr << "Failed test for BOOST_HAS_CLOCK_GETTIME at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_has_pragma_detect_mismatch::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_HAS_PRAGMA_DETECT_MISMATCH at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_has_dirent_h::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_HAS_DIRENT_H at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
|
37
test/has_detect_mismatch_fail.cpp
Normal file
37
test/has_detect_mismatch_fail.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Wed Apr 18 20:03:40 2018
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/config for the most recent version.//
|
||||
// Revision $Id$
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
// This file should not compile, if it does then
|
||||
// BOOST_HAS_PRAGMA_DETECT_MISMATCH should be defined.
|
||||
// See file boost_has_detect_mismatch.ipp for details
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
// the objective of this file:
|
||||
#ifdef BOOST_ASSERT_CONFIG
|
||||
# undef BOOST_ASSERT_CONFIG
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
#include "boost_has_detect_mismatch.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_has_pragma_detect_mismatch::test();
|
||||
}
|
||||
|
37
test/has_detect_mismatch_pass.cpp
Normal file
37
test/has_detect_mismatch_pass.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Wed Apr 18 20:03:40 2018
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/config for the most recent version.//
|
||||
// Revision $Id$
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
// This file should compile, if it does not then
|
||||
// BOOST_HAS_PRAGMA_DETECT_MISMATCH should not be defined.
|
||||
// See file boost_has_detect_mismatch.ipp for details
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
// the objective of this file:
|
||||
#ifdef BOOST_ASSERT_CONFIG
|
||||
# undef BOOST_ASSERT_CONFIG
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
#include "boost_has_detect_mismatch.ipp"
|
||||
#else
|
||||
namespace boost_has_pragma_detect_mismatch = empty_boost;
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_has_pragma_detect_mismatch::test();
|
||||
}
|
||||
|
Reference in New Issue
Block a user