Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d7a00d30
Commit
d7a00d30
authored
Jan 18, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move distributed and duplicated config for stat() and fstat() into pyport.h.
parent
b466861e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
51 deletions
+34
-51
Include/pyport.h
Include/pyport.h
+34
-2
Objects/fileobject.c
Objects/fileobject.c
+0
-20
Python/getmtime.c
Python/getmtime.c
+0
-10
Python/import.c
Python/import.c
+0
-19
No files found.
Include/pyport.h
View file @
d7a00d30
...
...
@@ -118,6 +118,38 @@ typedef unsigned LONG_LONG Py_uintptr_t;
#endif
/* !HAVE_SYS_SELECT_H */
/*******************************
* stat() and fstat() fiddling *
*******************************/
/* We expect that stat and fstat exist on most systems.
* It's confirmed on Unix, Mac and Windows.
* If you don't have them, add
* #define DONT_HAVE_STAT
* and/or
* #define DONT_HAVE_FSTAT
* to your config.h. Python code beyond this should check HAVE_STAT and
* HAVE_FSTAT instead.
* Also
* #define DONT_HAVE_SYS_STAT_H
* if <sys/stat.h> doesn't exist on your platform, and
* #define HAVE_STAT_H
* if <stat.h> does (don't look at me -- ths mess is inherited).
*/
#ifndef DONT_HAVE_STAT
#define HAVE_STAT
#endif
#ifndef DONT_HAVE_FSTAT
#define HAVE_FSTAT
#endif
#ifndef DONT_HAVE_SYS_STAT_H
#include <sys/stat.h>
#elif defined(HAVE_STAT_H)
#include <stat.h>
#endif
#ifdef __cplusplus
/* Move this down here since some C++ #include's don't like to be included
...
...
@@ -192,7 +224,7 @@ extern int gethostname(char *, int);
#ifdef __BEOS__
/* Unchecked */
/* It's in the libs, but not the headers... - [cjh] */
int
shutdown
(
int
,
int
);
int
shutdown
(
int
,
int
);
#endif
#ifdef HAVE__GETPTY
...
...
@@ -305,7 +337,7 @@ extern double hypot(double, double);
#define sqrt sqrtd
#define tan tand
#define tanh tanhd
#endif
#endif
/************************************
...
...
Objects/fileobject.c
View file @
d7a00d30
...
...
@@ -8,26 +8,6 @@
#include <sys/types.h>
#endif
/* DONT_HAVE_SYS_TYPES_H */
/* We expect that fstat exists on most systems.
It's confirmed on Unix, Mac and Windows.
If you don't have it, add #define DONT_HAVE_FSTAT to your config.h. */
#ifndef DONT_HAVE_FSTAT
#define HAVE_FSTAT
#ifndef DONT_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef DONT_HAVE_SYS_STAT_H
#include <sys/stat.h>
#else
#ifdef HAVE_STAT_H
#include <stat.h>
#endif
#endif
#endif
/* DONT_HAVE_FSTAT */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
...
...
Python/getmtime.c
View file @
d7a00d30
...
...
@@ -6,16 +6,6 @@
#include "Python.h"
#include "config.h"
#include <stdio.h>
#ifndef DONT_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef DONT_HAVE_SYS_STAT_H
#include <sys/stat.h>
#elif defined(HAVE_STAT_H)
#include <stat.h>
#endif
time_t
PyOS_GetLastModificationTime
(
char
*
path
,
FILE
*
fp
)
{
...
...
Python/import.c
View file @
d7a00d30
...
...
@@ -19,22 +19,6 @@
#include <unistd.h>
#endif
/* We expect that stat exists on most systems.
It's confirmed on Unix, Mac and Windows.
If you don't have it, add #define DONT_HAVE_STAT to your config.h. */
#ifndef DONT_HAVE_STAT
#define HAVE_STAT
#ifndef DONT_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef DONT_HAVE_SYS_STAT_H
#include <sys/stat.h>
#elif defined(HAVE_STAT_H)
#include <stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
...
...
@@ -48,9 +32,6 @@
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
#endif
extern
time_t
PyOS_GetLastModificationTime
(
char
*
,
FILE
*
);
/* In getmtime.c */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment