From 2b7da153873cd37295d2d6f3b18f48ee01409d57 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 13 Jul 2011 18:03:52 +0000 Subject: [PATCH] Document BOOST_HAS_GETSYSTEMTIMEASFILETIME, add test case, and change test for BOOST_HAS_FTIME. Refs #2881. [SVN r73058] --- doc/html/boost_config/acknowledgements.html | 2 +- .../boost_config/boost_macro_reference.html | 21 ++++++++++- .../guidelines_for_boost_authors.html | 2 +- doc/html/boost_config/rationale.html | 2 +- doc/html/index.html | 6 +-- doc/macro_reference.qbk | 5 ++- include/boost/config/platform/win32.hpp | 2 + test/all/Jamfile.v2 | 5 ++- test/boost_has_ftime.ipp | 5 +-- test/boost_has_getsystemtimeasfiletime.ipp | 30 +++++++++++++++ test/boost_no_decltype.ipp | 4 ++ test/config_info.cpp | 2 + test/config_test.cpp | 12 +++++- test/has_getsystemtimeasfiletime_fail.cpp | 37 +++++++++++++++++++ test/has_getsystemtimeasfiletime_pass.cpp | 37 +++++++++++++++++++ 15 files changed, 158 insertions(+), 14 deletions(-) create mode 100644 test/boost_has_getsystemtimeasfiletime.ipp create mode 100644 test/has_getsystemtimeasfiletime_fail.cpp create mode 100644 test/has_getsystemtimeasfiletime_pass.cpp diff --git a/doc/html/boost_config/acknowledgements.html b/doc/html/boost_config/acknowledgements.html index f8143ae3..8286d72d 100644 --- a/doc/html/boost_config/acknowledgements.html +++ b/doc/html/boost_config/acknowledgements.html @@ -3,7 +3,7 @@ Acknowledgements - + diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 806bc110..e1fc36f2 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -3,7 +3,7 @@ Boost Macro Reference - + @@ -1439,7 +1439,24 @@

- The platform has the Win32 API GetSystemTimeAsFileTime. + The platform has the Win32 API type FTIME. +

+ + + + +

+ BOOST_HAS_GETSYSTEMTIMEASFILETIME +

+ + +

+ Platform +

+ + +

+ The platform has the Win32 API GetSystemTimeAsFileTime.

diff --git a/doc/html/boost_config/guidelines_for_boost_authors.html b/doc/html/boost_config/guidelines_for_boost_authors.html index 1079480d..cbc7dbce 100644 --- a/doc/html/boost_config/guidelines_for_boost_authors.html +++ b/doc/html/boost_config/guidelines_for_boost_authors.html @@ -3,7 +3,7 @@ Guidelines for Boost Authors - + diff --git a/doc/html/boost_config/rationale.html b/doc/html/boost_config/rationale.html index f92d7993..d62510c1 100644 --- a/doc/html/boost_config/rationale.html +++ b/doc/html/boost_config/rationale.html @@ -3,7 +3,7 @@ Rationale - + diff --git a/doc/html/index.html b/doc/html/index.html index 9c2bee38..8ba9dc99 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ Boost.Config - + @@ -29,7 +29,7 @@
-

+

Distributed under 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)

@@ -947,7 +947,7 @@
- +

Last revised: June 01, 2011 at 14:31:32 GMT

Last revised: July 13, 2011 at 18:00:55 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index f319f595..07b13c14 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -348,7 +348,10 @@ The platform has the POSIX header ``. The platform has the functions `expm1`, `expm1f` and `expm1l` in `` ]] [[`BOOST_HAS_FTIME`][Platform][ -The platform has the Win32 API `GetSystemTimeAsFileTime`. +The platform has the Win32 API type FTIME. +]] +[[`BOOST_HAS_GETSYSTEMTIMEASFILETIME`][Platform][ +The platform has the Win32 API GetSystemTimeAsFileTime. ]] [[`BOOST_HAS_GETTIMEOFDAY`][Platform][ The platform has the POSIX API `gettimeofday`. diff --git a/include/boost/config/platform/win32.hpp b/include/boost/config/platform/win32.hpp index 72c3dceb..39220127 100644 --- a/include/boost/config/platform/win32.hpp +++ b/include/boost/config/platform/win32.hpp @@ -55,6 +55,8 @@ #ifdef _WIN32_WCE # define BOOST_NO_ANSI_APIS +#else +# define BOOST_HAS_GETSYSTEMTIMEASFILETIME #endif #ifndef BOOST_HAS_PTHREADS diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 8f138e9d..2c10d7f3 100644 --- a/test/all/Jamfile.v2 +++ b/test/all/Jamfile.v2 @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Wed Jun 1 21:44:56 2011 +# This file was automatically generated on Wed Jul 13 18:50:14 2011 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -40,6 +40,9 @@ test-suite "BOOST_HAS_EXPM1" : test-suite "BOOST_HAS_FTIME" : [ run ../has_ftime_pass.cpp ] [ compile-fail ../has_ftime_fail.cpp ] ; +test-suite "BOOST_HAS_GETSYSTEMTIMEASFILETIME" : +[ run ../has_getsystemtimeasfiletime_pass.cpp ] +[ compile-fail ../has_getsystemtimeasfiletime_fail.cpp ] ; test-suite "BOOST_HAS_GETTIMEOFDAY" : [ run ../has_gettimeofday_pass.cpp ] [ compile-fail ../has_gettimeofday_fail.cpp ] ; diff --git a/test/boost_has_ftime.ipp b/test/boost_has_ftime.ipp index 664bc1f0..70964481 100644 --- a/test/boost_has_ftime.ipp +++ b/test/boost_has_ftime.ipp @@ -6,8 +6,8 @@ // See http://www.boost.org/libs/config for most recent version. // MACRO: BOOST_HAS_FTIME -// TITLE: GetSystemTimeAsFileTime -// DESCRIPTION: The platform supports Win32 API GetSystemTimeAsFileTime. +// TITLE: The platform has FTIME. +// DESCRIPTION: The platform supports the Win32 API type FTIME. #include @@ -18,7 +18,6 @@ void f() { // this is never called, it just has to compile: FILETIME ft; - GetSystemTimeAsFileTime(&ft); } int test() diff --git a/test/boost_has_getsystemtimeasfiletime.ipp b/test/boost_has_getsystemtimeasfiletime.ipp new file mode 100644 index 00000000..d9b7e1c9 --- /dev/null +++ b/test/boost_has_getsystemtimeasfiletime.ipp @@ -0,0 +1,30 @@ +// (C) Copyright John Maddock 2011. +// 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_GETSYSTEMTIMEASFILETIME +// TITLE: GetSystemTimeAsFileTime +// DESCRIPTION: The platform supports Win32 API GetSystemTimeAsFileTime. + +#include + + +namespace boost_has_getsystemtimeasfiletime{ + +void f() +{ + // this is never called, it just has to compile: + FILETIME ft; + GetSystemTimeAsFileTime(&ft); +} + +int test() +{ + return 0; +} + +} + diff --git a/test/boost_no_decltype.ipp b/test/boost_no_decltype.ipp index f76db77e..db1aae39 100644 --- a/test/boost_no_decltype.ipp +++ b/test/boost_no_decltype.ipp @@ -40,7 +40,11 @@ int test() int i; decltype(i) j; decltype(get_test_class()) k; + #ifndef _MSC_VER + // Although the VC++ decltype is buggy, we none the less enable support, + // so don't test the bugs for now! baz(get_test_class); + #endif return 0; } diff --git a/test/config_info.cpp b/test/config_info.cpp index eece2e19..8f672c36 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -917,6 +917,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_HAS_DIRENT_H); PRINT_MACRO(BOOST_HAS_EXPM1); PRINT_MACRO(BOOST_HAS_FTIME); + PRINT_MACRO(BOOST_HAS_GETSYSTEMTIMEASFILETIME); PRINT_MACRO(BOOST_HAS_GETTIMEOFDAY); PRINT_MACRO(BOOST_HAS_HASH); PRINT_MACRO(BOOST_HAS_LOG1P); @@ -1084,6 +1085,7 @@ void print_boost_macros() + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index 10abbd62..8e909be7 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Wed Jun 1 21:44:56 2011 +// This file was automatically generated on Wed Jul 13 18:50:14 2011 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -633,6 +633,11 @@ namespace boost_has_expm1 = empty_boost; #else namespace boost_has_ftime = empty_boost; #endif +#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME +#include "boost_has_getsystemtimeasfiletime.ipp" +#else +namespace boost_has_getsystemtimeasfiletime = empty_boost; +#endif #ifdef BOOST_HAS_GETTIMEOFDAY #include "boost_has_gettimeofday.ipp" #else @@ -886,6 +891,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_HAS_FTIME at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_has_getsystemtimeasfiletime::test()) + { + std::cerr << "Failed test for BOOST_HAS_GETSYSTEMTIMEASFILETIME at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_has_gettimeofday::test()) { std::cerr << "Failed test for BOOST_HAS_GETTIMEOFDAY at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/has_getsystemtimeasfiletime_fail.cpp b/test/has_getsystemtimeasfiletime_fail.cpp new file mode 100644 index 00000000..15414938 --- /dev/null +++ b/test/has_getsystemtimeasfiletime_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Wed Jul 13 18:50:13 2011 +// 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: generate.cpp 72327 2011-06-01 14:51:03Z eric_niebler $ +// + + +// Test file for macro BOOST_HAS_GETSYSTEMTIMEASFILETIME +// This file should not compile, if it does then +// BOOST_HAS_GETSYSTEMTIMEASFILETIME should be defined. +// See file boost_has_getsystemtimeasfiletime.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 +#include "test.hpp" + +#ifndef BOOST_HAS_GETSYSTEMTIMEASFILETIME +#include "boost_has_getsystemtimeasfiletime.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_has_getsystemtimeasfiletime::test(); +} + diff --git a/test/has_getsystemtimeasfiletime_pass.cpp b/test/has_getsystemtimeasfiletime_pass.cpp new file mode 100644 index 00000000..e8ea83bb --- /dev/null +++ b/test/has_getsystemtimeasfiletime_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Wed Jul 13 18:50:13 2011 +// 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: generate.cpp 72327 2011-06-01 14:51:03Z eric_niebler $ +// + + +// Test file for macro BOOST_HAS_GETSYSTEMTIMEASFILETIME +// This file should compile, if it does not then +// BOOST_HAS_GETSYSTEMTIMEASFILETIME should not be defined. +// See file boost_has_getsystemtimeasfiletime.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 +#include "test.hpp" + +#ifdef BOOST_HAS_GETSYSTEMTIMEASFILETIME +#include "boost_has_getsystemtimeasfiletime.ipp" +#else +namespace boost_has_getsystemtimeasfiletime = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_has_getsystemtimeasfiletime::test(); +} +