Mercurial > cpython-lru_cache-weakref
annotate Python/getmtime.c @ 24155:9456a2ccda61 legacy-trunk
The Py_REF_DEBUG/COUNT_ALLOCS/Py_TRACE_REFS macro minefield: added
more trivial lexical helper macros so that uses of these guys expand
to nothing at all when they're not enabled. This should help sub-
standard compilers that can't do a good job of optimizing away the
previous "(void)0" expressions.
Py_DECREF: There's only one definition of this now. Yay! That
was that last one in the family defined multiple times in an #ifdef
maze.
Py_FatalError(): Changed the char* signature to const char*.
_Py_NegativeRefcount(): New helper function for the Py_REF_DEBUG
expansion of Py_DECREF. Calling an external function cuts down on
the volume of generated code. The previous inline expansion of abort()
didn't work as intended on Windows (the program often kept going, and
the error msg scrolled off the screen unseen). _Py_NegativeRefcount
calls Py_FatalError instead, which captures our best knowledge of
how to abort effectively across platforms.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Tue, 09 Jul 2002 02:57:01 +0000 |
| parents | 2dea40e40d9d |
| children | 2f3f2e32dfd9 |
| rev | line source |
|---|---|
| 1449 | 1 |
| 2 /* Subroutine to get the last modification time of a file */ | |
| 3 | |
| 4 /* (A separate file because this may be OS dependent) */ | |
| 5 | |
|
13226
12437deb0680
Trent Mick <trentm@activestate.com>:
Fred Drake <fdrake@acm.org>
parents:
6243
diff
changeset
|
6 #include "Python.h" |
|
18835
2dea40e40d9d
Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.
Martin v. Löwis <martin@v.loewis.de>
parents:
15978
diff
changeset
|
7 #include "pyconfig.h" |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1449
diff
changeset
|
8 |
|
13226
12437deb0680
Trent Mick <trentm@activestate.com>:
Fred Drake <fdrake@acm.org>
parents:
6243
diff
changeset
|
9 time_t |
|
13658
f79434ee41fa
Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents:
13267
diff
changeset
|
10 PyOS_GetLastModificationTime(char *path, FILE *fp) |
| 1449 | 11 { |
| 12 struct stat st; | |
|
6243
4279f4eb210a
First part of package support.
Guido van Rossum <guido@python.org>
parents:
5440
diff
changeset
|
13 if (fstat(fileno(fp), &st) != 0) |
| 1449 | 14 return -1; |
| 15 else | |
| 16 return st.st_mtime; | |
| 17 } |
