mirror of
https://github.com/python/cpython.git
synced 2025-11-14 07:49:28 +00:00
Get hotshot closer to compiling on Windows.
Still broken: GETTIMEOFDAY. This macro obviously isn't being defined on Windows, so there's logic errors here I'd rather Fred untangled.
This commit is contained in:
parent
3e99643682
commit
1566a17af5
3 changed files with 30 additions and 3 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
#ifdef MS_WIN32
|
#ifdef MS_WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <largeint.h>
|
#include <largeint.h>
|
||||||
|
#include <direct.h> /* for getcwd() */
|
||||||
typedef LARGE_INTEGER hs_time;
|
typedef LARGE_INTEGER hs_time;
|
||||||
#else
|
#else
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
|
|
@ -41,6 +42,14 @@ typedef struct timeval hs_time;
|
||||||
|
|
||||||
#define BUFFERSIZE 10240
|
#define BUFFERSIZE 10240
|
||||||
|
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
# ifdef MAX_PATH
|
||||||
|
# define PATH_MAX MAX_PATH
|
||||||
|
# else
|
||||||
|
# error "Need a defn. for PATH_MAX in _hotshot.c"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
PyObject *filemap;
|
PyObject *filemap;
|
||||||
|
|
@ -365,6 +374,7 @@ logreader_tp_iternext(LogReaderObject *self)
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
;
|
||||||
}
|
}
|
||||||
if (err == ERR_EOF && oldindex != 0) {
|
if (err == ERR_EOF && oldindex != 0) {
|
||||||
/* It looks like we ran out of data before we had it all; this
|
/* It looks like we ran out of data before we had it all; this
|
||||||
|
|
@ -470,7 +480,7 @@ flush_data(ProfilerObject *self)
|
||||||
{
|
{
|
||||||
/* Need to dump data to the log file... */
|
/* Need to dump data to the log file... */
|
||||||
size_t written = fwrite(self->buffer, 1, self->index, self->logfp);
|
size_t written = fwrite(self->buffer, 1, self->index, self->logfp);
|
||||||
if (written == self->index)
|
if (written == (size_t)self->index)
|
||||||
self->index = 0;
|
self->index = 0;
|
||||||
else {
|
else {
|
||||||
memmove(self->buffer, &self->buffer[written],
|
memmove(self->buffer, &self->buffer[written],
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ extern void init_locale(void);
|
||||||
extern void init_codecs(void);
|
extern void init_codecs(void);
|
||||||
extern void initxreadlines(void);
|
extern void initxreadlines(void);
|
||||||
extern void init_weakref(void);
|
extern void init_weakref(void);
|
||||||
|
extern void init_hotshot(void);
|
||||||
extern void initxxsubtype(void);
|
extern void initxxsubtype(void);
|
||||||
|
|
||||||
/* XXX tim: what's the purpose of ADDMODULE MARKER? */
|
/* XXX tim: what's the purpose of ADDMODULE MARKER? */
|
||||||
|
|
@ -98,6 +99,7 @@ struct _inittab _PyImport_Inittab[] = {
|
||||||
{"_codecs", init_codecs},
|
{"_codecs", init_codecs},
|
||||||
{"xreadlines", initxreadlines},
|
{"xreadlines", initxreadlines},
|
||||||
{"_weakref", init_weakref},
|
{"_weakref", init_weakref},
|
||||||
|
{"_hotshot", init_hotshot},
|
||||||
|
|
||||||
{"xxsubtype", initxxsubtype},
|
{"xxsubtype", initxxsubtype},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,21 @@ SOURCE=..\Modules\_codecsmodule.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\Modules\_hotshot.c
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "pythoncore - Win32 Release"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "pythoncore - Win32 Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Release"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\Modules\_localemodule.c
|
SOURCE=..\Modules\_localemodule.c
|
||||||
|
|
||||||
!IF "$(CFG)" == "pythoncore - Win32 Release"
|
!IF "$(CFG)" == "pythoncore - Win32 Release"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue