[Patches] fix timemodule.c for Win64

Trent Mick trentm@activestate.com
Thu, 1 Jun 2000 18:53:21 -0700


Discussion:

Mark Hammond provided (a long time ago) a better Win32 specific time_clock
implementation in timemodule.c. The library for this implementation does not
exist on Win64 (yet, at least). This patch makes Win64 fall back on the
system's clock() function for time_clock().


Legal:

I confirm that, to the best of my knowledge and belief, this
contribution is free of any claims of third parties under
copyright, patent or other rights or interests ("claims").  To
the extent that I have any such claims, I hereby grant to CNRI a
nonexclusive, irrevocable, royalty-free, worldwide license to
reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part
of the Python software and its related documentation, or any
derivative versions thereof, at no cost to CNRI or its licensed
users, and to authorize others to do so.

I acknowledge that CNRI may, at its sole discretion, decide
whether or not to incorporate this contribution in the Python
software and its related documentation.  I further grant CNRI
permission to use my name and other identifying information
provided to CNRI by me for use in connection with the Python
software and its related documentation.


Patch (use 'patch -p8'):

*** /home/trentm/main/contrib/python/dist/src/Modules/timemodule.c	Thu Jun  1 00:13:39 2000
--- /home/trentm/main/Apps/Perlium/Python/dist/src/Modules/timemodule.c	Wed May 31 23:54:18 2000
***************
*** 89,99 ****
  #endif /* MS_WINDOWS */
  #endif /* !__WATCOMC__ || __QNX__ */
  
! #ifdef MS_WIN32
! /* Win32 has better clock replacement */
  #include <largeint.h>
  #undef HAVE_CLOCK /* We have our own version down below */
! #endif /* MS_WIN32 */
  
  #if defined(PYCC_VACPP)
  #include <sys/time.h>
--- 89,100 ----
  #endif /* MS_WINDOWS */
  #endif /* !__WATCOMC__ || __QNX__ */
  
! #if defined(MS_WIN32) && !defined(MS_WIN64)
! /* Win32 has better clock replacement
!    XXX Win64 does not yet, but might when the platform matures. */
  #include <largeint.h>
  #undef HAVE_CLOCK /* We have our own version down below */
! #endif /* MS_WIN32 && !MS_WIN64 */
  
  #if defined(PYCC_VACPP)
  #include <sys/time.h>
***************
*** 190,196 ****
  }
  #endif /* HAVE_CLOCK */
  
! #ifdef MS_WIN32
  /* Due to Mark Hammond */
  static PyObject *
  time_clock(self, args)
--- 191,197 ----
  }
  #endif /* HAVE_CLOCK */
  
! #if defined(MS_WIN32) && !defined(MS_WIN64)
  /* Due to Mark Hammond */
  static PyObject *
  time_clock(self, args)
***************
*** 226,232 ****
  }
  
  #define HAVE_CLOCK /* So it gets included in the methods */
! #endif /* MS_WIN32 */
  
  #ifdef HAVE_CLOCK
  static char clock_doc[] =
--- 227,233 ----
  }
  
  #define HAVE_CLOCK /* So it gets included in the methods */
! #endif /* MS_WIN32 && !MS_WIN64 */
  
  #ifdef HAVE_CLOCK
  static char clock_doc[] =


-- 
Trent Mick
trentm@activestate.com