Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ode for openSUSE:Factory checked in at 2023-01-18 13:12:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ode (Old) and /work/SRC/openSUSE:Factory/.ode.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ode" Wed Jan 18 13:12:29 2023 rev:7 rq:1059200 version:0.16.3 Changes: -------- --- /work/SRC/openSUSE:Factory/ode/ode.changes 2020-09-17 15:09:11.120957532 +0200 +++ /work/SRC/openSUSE:Factory/.ode.new.32243/ode.changes 2023-01-18 13:12:38.633289085 +0100 @@ -1,0 +2,6 @@ +Sun Jan 15 21:03:50 UTC 2023 - Dirk Müller <[email protected]> + +- update to 0.16.3: + * compatibility corrections + +------------------------------------------------------------------- Old: ---- ode-0.16.2.tar.gz New: ---- ode-0.16.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ode.spec ++++++ --- /var/tmp/diff_new_pack.ougizf/_old 2023-01-18 13:12:39.381291917 +0100 +++ /var/tmp/diff_new_pack.ougizf/_new 2023-01-18 13:12:39.385291933 +0100 @@ -1,7 +1,7 @@ # # spec file for package ode # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define so_maj 8 %define lname libode%{so_maj} Name: ode -Version: 0.16.2 +Version: 0.16.3 Release: 0 Summary: Open Dynamics Engine Library License: BSD-3-Clause OR LGPL-2.1-or-later @@ -92,6 +92,7 @@ %ifarch %{ix86} # Fail. %else + %check %make_build check %endif ++++++ ode-0.16.2.tar.gz -> ode-0.16.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/CMakeLists.txt new/ode-0.16.3/CMakeLists.txt --- old/ode-0.16.2/CMakeLists.txt 2020-07-30 15:27:35.000000000 +0200 +++ new/ode-0.16.3/CMakeLists.txt 2022-12-19 23:13:50.000000000 +0100 @@ -9,7 +9,7 @@ set(VERSION_MAJOR 0) set(VERSION_MINOR 16) -set(VERSION_PATCH 2) +set(VERSION_PATCH 3) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) option(BUILD_SHARED_LIBS "Build shared libraries." ON) @@ -518,6 +518,12 @@ if(APPLE) target_compile_definitions(ODE PRIVATE -DMAC_OS_X_VERSION=${MAC_OS_X_VERSION}) + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + find_library(CORESERVICES_FW NAMES CoreServices) + if (CORESERVICES_FW) + target_link_libraries(ODE PRIVATE ${CORESERVICES_FW}) + endif() + endif() endif() if(WIN32) @@ -670,6 +676,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ode.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ode-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development) +unset(DRAWSTUFF_RSRC) + if(ODE_WITH_DEMOS) set( DRAWSTUFF_SRCS @@ -680,11 +688,12 @@ ) if(WIN32) + set(DRAWSTUFF_RSRC drawstuff/src/resources.rc) list( APPEND DRAWSTUFF_SRCS drawstuff/src/resource.h - drawstuff/src/resources.rc drawstuff/src/windows.cpp + ${DRAWSTUFF_RSRC} ) elseif(APPLE) list(APPEND DRAWSTUFF_SRCS drawstuff/src/osx.cpp) @@ -717,7 +726,7 @@ endif() set( - DEMO_SRCS + ALL_DEMO_SRCS ode/demo/demo_boxstack.cpp ode/demo/demo_buggy.cpp ode/demo/demo_cards.cpp @@ -755,7 +764,7 @@ if(NOT ODE_NO_TRIMESH) list( - APPEND DEMO_SRCS + APPEND ALL_DEMO_SRCS ode/demo/demo_basket.cpp ode/demo/demo_cyl.cpp ode/demo/demo_moving_convex.cpp @@ -765,12 +774,31 @@ ) endif() - foreach(DEMO_SRC ${DEMO_SRCS}) - get_filename_component(DEMO ${DEMO_SRC} NAME_WE) - add_executable(${DEMO} ${DEMO_SRC}) + foreach(MAIN_DEMO_SRC ${ALL_DEMO_SRCS}) + get_filename_component(DEMO ${MAIN_DEMO_SRC} NAME_WE) + set( + DEMO_SRC + ${MAIN_DEMO_SRC} + ) + + if(NOT WIN32 OR ${DEMO} STREQUAL "demo_ode") + add_executable(${DEMO} ${DEMO_SRC}) + else() + if(NOT BUILD_SHARED_LIBS) + list( + APPEND DEMO_SRC + ${DRAWSTUFF_RSRC} + ) + endif() + + add_executable(${DEMO} WIN32 ${DEMO_SRC}) + if(WIN32 AND MSVC) + set_target_properties(${DEMO} PROPERTIES LINK_FLAGS /ENTRY:mainCRTStartup) + endif() + endif() target_link_libraries(${DEMO} drawstuff) - if(NOT WIN32 AND ${DEMO} MATCHES "demo_chain1") + if(NOT WIN32 AND ${DEMO} STREQUAL "demo_chain1") target_link_libraries(${DEMO} m) endif() endforeach() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/build/config-default.h new/ode-0.16.3/build/config-default.h --- old/ode-0.16.2/build/config-default.h 2020-07-30 15:26:48.000000000 +0200 +++ new/ode-0.16.3/build/config-default.h 2022-12-19 23:13:50.000000000 +0100 @@ -67,7 +67,7 @@ #define ODE_PLATFORM_PSP #elif defined(SN_TARGET_PS3) #define ODE_PLATFORM_PS3 -#elif defined(_MSC_VER) || defined(__CYGWIN32__) || defined(__MINGW32__) +#elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) #define ODE_PLATFORM_WINDOWS #elif defined(__linux__) #define ODE_PLATFORM_LINUX @@ -82,7 +82,7 @@ #define WIN32 #endif -#if defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(__CYGWIN__) || defined(__MINGW32__) #define CYGWIN #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/build/premake4.lua new/ode-0.16.3/build/premake4.lua --- old/ode-0.16.2/build/premake4.lua 2020-07-30 15:27:35.000000000 +0200 +++ new/ode-0.16.3/build/premake4.lua 2022-12-19 23:13:50.000000000 +0100 @@ -4,7 +4,7 @@ -- For more information on Premake: http://industriousone.com/premake ---------------------------------------------------------------------- - ode_version = "0.16.2" + ode_version = "0.16.3 ---------------------------------------------------------------------- -- Demo list: add/remove demos from here and the rest of the build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/config.h.cmake.in new/ode-0.16.3/config.h.cmake.in --- old/ode-0.16.2/config.h.cmake.in 2020-07-30 15:26:48.000000000 +0200 +++ new/ode-0.16.3/config.h.cmake.in 2022-12-19 23:13:50.000000000 +0100 @@ -65,7 +65,7 @@ #define ODE_PLATFORM_PSP #elif defined(SN_TARGET_PS3) #define ODE_PLATFORM_PS3 -#elif defined(_MSC_VER) || defined(__CYGWIN32__) || defined(__MINGW32__) +#elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) #define ODE_PLATFORM_WINDOWS #elif defined(__linux__) #define ODE_PLATFORM_LINUX @@ -80,7 +80,7 @@ #define WIN32 #endif -#if defined(__CYGWIN32__) || defined(__MINGW32__) +#if defined(__CYGWIN__) || defined(__MINGW32__) #define CYGWIN #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/configure new/ode-0.16.3/configure --- old/ode-0.16.2/configure 2020-07-30 15:28:42.000000000 +0200 +++ new/ode-0.16.3/configure 2022-12-19 23:16:40.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ODE 0.16.2. +# Generated by GNU Autoconf 2.69 for ODE 0.16.3. # # Report bugs to <[email protected]>. # @@ -589,8 +589,8 @@ # Identity of this package. PACKAGE_NAME='ODE' PACKAGE_TARNAME='ode' -PACKAGE_VERSION='0.16.2' -PACKAGE_STRING='ODE 0.16.2' +PACKAGE_VERSION='0.16.3' +PACKAGE_STRING='ODE 0.16.3' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1426,7 +1426,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ODE 0.16.2 to adapt to many kinds of systems. +\`configure' configures ODE 0.16.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1497,7 +1497,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ODE 0.16.2:";; + short | recursive ) echo "Configuration of ODE 0.16.3:";; esac cat <<\_ACEOF @@ -1662,7 +1662,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ODE configure 0.16.2 +ODE configure 0.16.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2336,7 +2336,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ODE $as_me 0.16.2, which was +It was created by ODE $as_me 0.16.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2684,7 +2684,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ODE_VERSION=0.16.2 +ODE_VERSION=0.16.3 # Those are instructions from the Libtool manual: @@ -2707,7 +2707,7 @@ # 6. If any interfaces have been removed since the last public release, # then set AGE to 0. CURRENT=8 -REVISION=2 +REVISION=3 AGE=0 # Check whether --enable-version-info was given. @@ -3316,7 +3316,7 @@ # Define the identity of the package. PACKAGE='ode' - VERSION='0.16.2' + VERSION='0.16.3' cat >>confdefs.h <<_ACEOF @@ -19355,7 +19355,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ODE $as_me 0.16.2, which was +This file was extended by ODE $as_me 0.16.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19421,7 +19421,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ODE config.status 0.16.2 +ODE config.status 0.16.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/configure.ac new/ode-0.16.3/configure.ac --- old/ode-0.16.2/configure.ac 2020-07-30 15:27:35.000000000 +0200 +++ new/ode-0.16.3/configure.ac 2022-12-19 23:13:50.000000000 +0100 @@ -1,6 +1,6 @@ dnl AC_INIT does not take a macro as a version nr: set it separately! - Bram -AC_INIT([ODE],[0.16.2],[[email protected]]) -ODE_VERSION=0.16.2 +AC_INIT([ODE],[0.16.3],[[email protected]]) +ODE_VERSION=0.16.3 AC_SUBST(ODE_VERSION) # Those are instructions from the Libtool manual: @@ -23,7 +23,7 @@ # 6. If any interfaces have been removed since the last public release, # then set AGE to 0. CURRENT=8 -REVISION=2 +REVISION=3 AGE=0 AC_ARG_ENABLE(version-info, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/include/ode/precision.h new/ode-0.16.3/include/ode/precision.h --- old/ode-0.16.2/include/ode/precision.h 2020-07-30 15:28:56.000000000 +0200 +++ new/ode-0.16.3/include/ode/precision.h 2022-12-19 23:18:47.000000000 +0100 @@ -10,7 +10,7 @@ #elif defined(dIDEDOUBLE) #define dDOUBLE #else -#define dSINGLE +#define dDOUBLE #endif #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/include/ode/version.h new/ode-0.16.3/include/ode/version.h --- old/ode-0.16.2/include/ode/version.h 2020-07-30 15:28:56.000000000 +0200 +++ new/ode-0.16.3/include/ode/version.h 2022-12-19 23:18:47.000000000 +0100 @@ -1,6 +1,6 @@ #ifndef _ODE_VERSION_H_ #define _ODE_VERSION_H_ -#define dODE_VERSION "0.16.2" +#define dODE_VERSION "0.16.3" #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/ode/doc/Makefile.in new/ode-0.16.3/ode/doc/Makefile.in --- old/ode-0.16.2/ode/doc/Makefile.in 2020-07-30 15:28:42.000000000 +0200 +++ new/ode-0.16.3/ode/doc/Makefile.in 2022-12-19 23:16:40.000000000 +0100 @@ -374,8 +374,8 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_DOXYGEN_FALSE@mostlyclean-local: @HAVE_DOXYGEN_FALSE@html-local: +@HAVE_DOXYGEN_FALSE@mostlyclean-local: clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/ode/src/lcp.cpp new/ode-0.16.3/ode/src/lcp.cpp --- old/ode-0.16.2/ode/src/lcp.cpp 2020-07-30 15:26:48.000000000 +0200 +++ new/ode-0.16.3/ode/src/lcp.cpp 2022-12-19 23:13:30.000000000 +0100 @@ -378,10 +378,10 @@ int *const m_findex; unsigned *const m_p, *const m_C; - dLCP (unsigned _n, unsigned _nskip, unsigned _nub, dReal *_Adata, dReal *_pairsbx, dReal *_w, - dReal *_pairslh, dReal *_L, dReal *_d, - dReal *_Dell, dReal *_ell, dReal *_tmp, - bool *_state, int *_findex, unsigned *_p, unsigned *_C, dReal **Arows); + dLCP (unsigned n, unsigned nskip, unsigned nub, dReal *Adata, dReal *pairsbx, dReal *w, + dReal *pairslh, dReal *L, dReal *d, + dReal *Dell, dReal *ell, dReal *tmp, + bool *state, int *findex, unsigned *p, unsigned *C, dReal **Arows); unsigned getNub() const { return m_nub; } void transfer_i_to_C (unsigned i); void transfer_i_to_N (unsigned /*i*/) { m_nN++; } // because we can assume C and N span 1:i-1 @@ -408,43 +408,38 @@ }; -dLCP::dLCP (unsigned _n, unsigned _nskip, unsigned _nub, dReal *_Adata, dReal *_pairsbx, dReal *_w, - dReal *_pairslh, dReal *_L, dReal *_d, - dReal *_Dell, dReal *_ell, dReal *_tmp, - bool *_state, int *_findex, unsigned *_p, unsigned *_C, dReal **Arows): - m_n(_n), m_nskip(_nskip), m_nub(_nub), m_nC(0), m_nN(0), +dLCP::dLCP (unsigned n, unsigned nskip, unsigned nub, dReal *Adata, dReal *pairsbx, dReal *w, + dReal *pairslh, dReal *L, dReal *d, + dReal *Dell, dReal *ell, dReal *tmp, + bool *state, int *findex, unsigned *p, unsigned *C, dReal **Arows): + m_n(n), m_nskip(nskip), m_nub(nub), m_nC(0), m_nN(0), # ifdef ROWPTRS m_A(Arows), #else - m_A(_Adata), + m_A(Adata), #endif - m_pairsbx(_pairsbx), m_w(_w), m_pairslh(_pairslh), - m_L(_L), m_d(_d), m_Dell(_Dell), m_ell(_ell), m_tmp(_tmp), - m_state(_state), m_findex(_findex), m_p(_p), m_C(_C) + m_pairsbx(pairsbx), m_w(w), m_pairslh(pairslh), + m_L(L), m_d(d), m_Dell(Dell), m_ell(ell), m_tmp(tmp), + m_state(state), m_findex(findex), m_p(p), m_C(C) { - dxtSetZero<PBX__MAX>(m_pairsbx + PBX_X, m_n); + dxtSetZero<PBX__MAX>(pairsbx + PBX_X, n); { # ifdef ROWPTRS // make matrix row pointers - dReal *aptr = _Adata; + dReal *aptr = Adata; ATYPE A = m_A; - const unsigned n = m_n, nskip = m_nskip; for (unsigned k=0; k<n; aptr+=nskip, ++k) A[k] = aptr; # endif } { - unsigned *p = m_p; - const unsigned n = m_n; for (unsigned k=0; k != n; ++k) p[k] = k; // initially unpermutted } /* // for testing, we can do some random swaps in the area i > nub { - const unsigned n = m_n; - const unsigned nub = m_nub; if (nub < n) { for (unsigned k=0; k<100; k++) { unsigned i1,i2; @@ -468,48 +463,42 @@ // if lo=-inf and hi=inf - this is because these limits may change during the // solution process. + unsigned currNub = nub; { - int *findex = m_findex; - dReal *pairslh = m_pairslh; - const unsigned n = m_n; - for (unsigned k = m_nub; k < n; ++k) { + for (unsigned k = currNub; k < n; ++k) { if (findex && findex[k] >= 0) continue; if ((pairslh + (sizeint)k * PLH__MAX)[PLH_LO] == -dInfinity && (pairslh + (sizeint)k * PLH__MAX)[PLH_HI] == dInfinity) { - swapProblem (m_A, m_pairsbx, m_w, pairslh, m_p, m_state, findex, n, m_nub, k, m_nskip, 0); - m_nub++; + swapProblem (m_A, m_pairsbx, m_w, pairslh, m_p, m_state, findex, n, currNub, k, nskip, 0); + m_nub = ++currNub; } } } // if there are unbounded variables at the start, factorize A up to that - // point and solve for x. this puts all indexes 0..nub-1 into C. - if (m_nub > 0) { - const unsigned nub = m_nub; + // point and solve for x. this puts all indexes 0..currNub-1 into C. + if (currNub > 0) { { dReal *Lrow = m_L; - const unsigned nskip = m_nskip; - for (unsigned j = 0; j < nub; Lrow += nskip, ++j) memcpy(Lrow, AROW(j), (j + 1) * sizeof(dReal)); + for (unsigned j = 0; j < currNub; Lrow += nskip, ++j) memcpy(Lrow, AROW(j), (j + 1) * sizeof(dReal)); } - transfer_b_to_x<false> (m_pairsbx, nub); - factorMatrixAsLDLT<1> (m_L, m_d, nub, m_nskip); - solveEquationSystemWithLDLT<1, PBX__MAX> (m_L, m_d, m_pairsbx + PBX_X, nub, m_nskip); - dSetZero (m_w, nub); + transfer_b_to_x<false> (m_pairsbx, currNub); + factorMatrixAsLDLT<1> (m_L, m_d, currNub, nskip); + solveEquationSystemWithLDLT<1, PBX__MAX> (m_L, m_d, m_pairsbx + PBX_X, currNub, nskip); + dSetZero (m_w, currNub); { unsigned *C = m_C; - for (unsigned k = 0; k < nub; ++k) C[k] = k; + for (unsigned k = 0; k < currNub; ++k) C[k] = k; } - m_nC = nub; + m_nC = currNub; } - // permute the indexes > nub such that all findex variables are at the end - if (m_findex) { - const unsigned nub = m_nub; - int *findex = m_findex; + // permute the indexes > currNub such that all findex variables are at the end + if (findex) { unsigned num_at_end = 0; - for (unsigned k = m_n; k > nub; ) { + for (unsigned k = m_n; k > currNub; ) { --k; if (findex[k] >= 0) { - swapProblem (m_A, m_pairsbx, m_w, m_pairslh, m_p, m_state, findex, m_n, k, m_n - 1 - num_at_end, m_nskip, 1); + swapProblem (m_A, m_pairsbx, m_w, m_pairslh, m_p, m_state, findex, m_n, k, m_n - 1 - num_at_end, nskip, 1); num_at_end++; } } @@ -518,10 +507,8 @@ // print info about indexes /* { - const unsigned n = m_n; - const unsigned nub = m_nub; for (unsigned k=0; k<n; k++) { - if (k<nub) printf ("C"); + if (k<currNub) printf ("C"); else if ((m_pairslh + (sizeint)k * PLH__MAX)[PLH_LO] == -dInfinity && (m_pairslh + (sizeint)k * PLH__MAX)[PLH_HI] == dInfinity) printf ("c"); else printf ("."); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/ode/src/timer.cpp new/ode-0.16.3/ode/src/timer.cpp --- old/ode-0.16.2/ode/src/timer.cpp 2020-07-30 15:26:48.000000000 +0200 +++ new/ode-0.16.3/ode/src/timer.cpp 2022-12-19 23:13:30.000000000 +0100 @@ -42,7 +42,7 @@ //**************************************************************************** // implementation for windows based on the multimedia performance counter. -#ifdef WIN32 +#ifdef _WIN32 #include "windows.h" @@ -88,7 +88,6 @@ return hz; } -#endif //**************************************************************************** // implementation based on the pentium time stamp counter. the timer functions @@ -96,7 +95,7 @@ // instructions have executed and data has been written back before the cpu // time stamp counter is read. the CPUID instruction is used to serialize. -#if defined(PENTIUM) && !defined(WIN32) +#elif defined(PENTIUM) // we need to know the clock rate so that the timing function can report // accurate times. this number only needs to be set accurately if we're @@ -169,31 +168,63 @@ return PENTIUM_HZ; } -#endif //**************************************************************************** -// otherwise, do the implementation based on gettimeofday(). - -#if !defined(PENTIUM) && !defined(WIN32) +// Implementation based on OSX mach_absolute_time() -#ifndef macintosh +#elif defined(__APPLE__) && defined(__MACH__) -#include <sys/time.h> +#include <CoreServices/CoreServices.h> +#include <mach/mach.h> +#include <mach/mach_time.h> #include <unistd.h> - static inline void getClockCount (unsigned long cc[2]) { - struct timeval tv; - gettimeofday (&tv,0); - cc[0] = tv.tv_usec; - cc[1] = tv.tv_sec; + uint64_t absTime = mach_absolute_time(); + cc[1] = (uint32_t)((absTime >> 32) & 0xFFFFFFFF); + cc[0] = (uint32_t)(absTime & 0xFFFFFFFF); +} + +static inline void serialize() +{ +} + + +static inline double loadClockCount (unsigned long a[2]) +{ + uint64_t absTime = (uint64_t)(a[0] | ((uint64_t)a[1] << 32)); + + mach_timebase_info_data_t timeInfo; + double resultTime = mach_timebase_info(&timeInfo) == 0 ? absTime * ((double)timeInfo.numer / timeInfo.denom) : 0.0; + + return resultTime; +} + +double dTimerResolution() +{ + mach_timebase_info_data_t timeInfo; + double nanoResolution = 1e-9; + double resultResolution = mach_timebase_info(&timeInfo) == 0 ? nanoResolution * ((double)timeInfo.numer / timeInfo.denom) : nanoResolution; + + return resultResolution; +} + +double dTimerTicksPerSecond() +{ + return 1e9; } -#else // macintosh + +//**************************************************************************** +// Otherwise, do the implementation based on Macintosh Microseconds +// or POSIX gettimeofday(). + +#else + +#if defined(macintosh) #include <CoreServices/CoreServices.h> -#include <ode/Timer.h> static inline void getClockCount (unsigned long cc[2]) { @@ -203,7 +234,21 @@ cc[0] = ms.lo - ( cc[1] * 1000000 ); } -#endif + +#else // POSIX + +#include <sys/time.h> +#include <unistd.h> + +static inline void getClockCount (unsigned long cc[2]) +{ + struct timeval tv; + gettimeofday (&tv,0); + cc[0] = tv.tv_usec; + cc[1] = tv.tv_sec; +} + +#endif // POSIX static inline void serialize() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ode-0.16.2/ou/include/ou/atomic.h new/ode-0.16.3/ou/include/ou/atomic.h --- old/ode-0.16.2/ou/include/ou/atomic.h 2020-07-30 15:27:35.000000000 +0200 +++ new/ode-0.16.3/ou/include/ou/atomic.h 2022-12-19 23:13:50.000000000 +0100 @@ -574,8 +574,16 @@ #define __OU_ATOMIC_READREORDERBARRIER_FUNCTION_DEFINED + +END_NAMESPACE_OU(); + + #include <intrin.h> + +BEGIN_NAMESPACE_OU(); + + static _OU_ALWAYSINLINE void _OU_CONVENTION_API /*void */AtomicReadReorderBarrier() {
