|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50224 - in sandbox/chrono: boost/chrono libs/chrono/build libs/chrono/src libs/chrono/test
From: bdawes_at_[hidden]
Date: 2008-12-09 12:26:35
Author: bemandawes
Date: 2008-12-09 12:26:34 EST (Tue, 09 Dec 2008)
New Revision: 50224
URL: http://svn.boost.org/trac/boost/changeset/50224
Log:
Chrono: Jamfiles working on Windows. Linux code seems to be working, but having bjam problems.
Text files modified:
sandbox/chrono/boost/chrono/config.hpp | 6 +++---
sandbox/chrono/libs/chrono/build/Jamfile.v2 | 10 +++++-----
sandbox/chrono/libs/chrono/src/chrono.cpp | 7 +++----
sandbox/chrono/libs/chrono/test/Jamfile.v2 | 10 +++++++++-
sandbox/chrono/libs/chrono/test/run_timer_test.cpp | 2 +-
5 files changed, 21 insertions(+), 14 deletions(-)
Modified: sandbox/chrono/boost/chrono/config.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/config.hpp (original)
+++ sandbox/chrono/boost/chrono/config.hpp 2008-12-09 12:26:34 EST (Tue, 09 Dec 2008)
@@ -15,11 +15,11 @@
// BOOST_CHRONO_POSIX_API, BOOST_CHRONO_MAC_API, or BOOST_CHRONO_WINDOWS_API
// can be defined by the user to specify which API should be used
-#ifdef BOOST_CHRONO_WINDOWS_API
+#if defined(BOOST_CHRONO_WINDOWS_API)
# warning Boost.Chrono will use the Windows API
-#elif BOOST_CHRONO_MAC_API
+#elif defined(BOOST_CHRONO_MAC_API)
# warning Boost.Chrono will use the Mac API
-#elif BOOST_CHRONO_POSIX_API
+#elif defined(BOOST_CHRONO_POSIX_API)
# warning Boost.Chrono will use the POSIX API
#endif
Modified: sandbox/chrono/libs/chrono/build/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/build/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/build/Jamfile.v2 2008-12-09 12:26:34 EST (Tue, 09 Dec 2008)
@@ -10,17 +10,17 @@
project boost/chrono
: source-location ../src
: usage-requirements # pass these requirement to dependents (i.e. users)
- <link>shared:<define>BOOST_CHRONO_DYN_LINK
- <link>static:<define>BOOST_CHRONO_STATIC_LINK
+ <link>shared:<define>BOOST_CHRONO_DYN_LINK=1
+ <link>static:<define>BOOST_CHRONO_STATIC_LINK=1
;
-SOURCES = chrono ;
+SOURCES = chrono process_clock run_timer run_timer_static ;
lib boost_chrono
: $(SOURCES).cpp
../../system/build//boost_system
- : <link>shared:<define>BOOST_ALL_DYN_LINK
- <link>static:<define>BOOST_All_STATIC_LINK
+ : <link>shared:<define>BOOST_ALL_DYN_LINK=1
+ <link>static:<define>BOOST_All_STATIC_LINK=1
;
boost-install boost_chrono ;
\ No newline at end of file
Modified: sandbox/chrono/libs/chrono/src/chrono.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/chrono.cpp (original)
+++ sandbox/chrono/libs/chrono/src/chrono.cpp 2008-12-09 12:26:34 EST (Tue, 09 Dec 2008)
@@ -241,8 +241,7 @@
//----------------------------------------------------------------------------//
#elif defined(BOOST_CHRONO_POSIX_API)
-//#include <sys/time.h>
-#include <time.h>
+#include <time.h> // for clock_gettime
namespace boost
{
@@ -281,7 +280,7 @@
if ( ::clock_gettime( CLOCK_REALTIME, &ts ) )
{
ec.assign( errno, system::system_category );
- return time_point(0);
+ return time_point();
}
ec.clear();
@@ -322,7 +321,7 @@
if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
{
ec.assign( errno, system::system_category );
- return time_point(duration(0));
+ return time_point();
}
ec.clear();
Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2008-12-09 12:26:34 EST (Tue, 09 Dec 2008)
@@ -20,7 +20,15 @@
: # requirements
<link>static
]
- [ run ../example/time2_demo.cpp
+ [ run ../example/time2_demo.cpp ../../system/build
: : : : time2_demo_dll
]
+ [ run run_timer_test.cpp
+ : : : <link>static
+ ]
+ [ run run_timer_test.cpp ../../system/build
+ : : : : run_timer_test_dll
+ ]
+ [ run ../example/run_timer_example.cpp ../../system/build
+ ]
;
Modified: sandbox/chrono/libs/chrono/test/run_timer_test.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/run_timer_test.cpp (original)
+++ sandbox/chrono/libs/chrono/test/run_timer_test.cpp 2008-12-09 12:26:34 EST (Tue, 09 Dec 2008)
@@ -177,7 +177,7 @@
boost::chrono::process_timer t;
- for (long i = 0; i < 1000000L; ++i)
+ for (long i = 0; i < 10000000L; ++i)
{
std::sqrt( static_cast<double>(i) );
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk