summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-10-16 20:28:25 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-10-16 20:28:25 (GMT)
commit60a5d72908a8422d15452356892fe592c80dad33 (patch)
tree04a54459bcdba5db15f77eeb1d0aab24c9adccc4 /Modules
parent98ef20d5e47c456552b87a911c1203571a06ad35 (diff)
downloadcpython-60a5d72908a8422d15452356892fe592c80dad33.zip
cpython-60a5d72908a8422d15452356892fe592c80dad33.tar.gz
cpython-60a5d72908a8422d15452356892fe592c80dad33.tar.bz2
Patch #623780: Replace obsolete struct macros.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c18
-rw-r--r--Modules/timemodule.c4
2 files changed, 11 insertions, 11 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 53324b5..68f7b62 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -685,31 +685,31 @@ static PyStructSequence_Field stat_result_fields[] = {
{"st_atime", "time of last access"},
{"st_mtime", "time of last modification"},
{"st_ctime", "time of last change"},
-#ifdef HAVE_ST_BLKSIZE
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
{"st_blksize", "blocksize for filesystem I/O"},
#endif
-#ifdef HAVE_ST_BLOCKS
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
{"st_blocks", "number of blocks allocated"},
#endif
-#ifdef HAVE_ST_RDEV
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
{"st_rdev", "device type (if inode device)"},
#endif
{0}
};
-#ifdef HAVE_ST_BLKSIZE
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
#define ST_BLKSIZE_IDX 13
#else
#define ST_BLKSIZE_IDX 12
#endif
-#ifdef HAVE_ST_BLOCKS
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
#define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1)
#else
#define ST_BLOCKS_IDX ST_BLKSIZE_IDX
#endif
-#ifdef HAVE_ST_RDEV
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
#define ST_RDEV_IDX (ST_BLOCKS_IDX+1)
#else
#define ST_RDEV_IDX ST_BLOCKS_IDX
@@ -866,15 +866,15 @@ _pystat_fromstructstat(STRUCT_STAT st)
fill_time(v, 8, st.st_mtime, mnsec);
fill_time(v, 9, st.st_ctime, cnsec);
-#ifdef HAVE_ST_BLKSIZE
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
PyStructSequence_SET_ITEM(v, ST_BLKSIZE_IDX,
PyInt_FromLong((long)st.st_blksize));
#endif
-#ifdef HAVE_ST_BLOCKS
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
PyStructSequence_SET_ITEM(v, ST_BLOCKS_IDX,
PyInt_FromLong((long)st.st_blocks));
#endif
-#ifdef HAVE_ST_RDEV
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
PyStructSequence_SET_ITEM(v, ST_RDEV_IDX,
PyInt_FromLong((long)st.st_rdev));
#endif
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 13da2ff..7a2f02a8 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -653,7 +653,7 @@ inittime(void)
PyModule_AddObject(m, "tzname",
Py_BuildValue("(zz)", tzname[0], tzname[1]));
#else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/
-#ifdef HAVE_TM_ZONE
+#ifdef HAVE_STRUCT_TM_TM_ZONE
{
#define YEAR ((time_t)((365 * 24 + 6) * 3600))
time_t t;
@@ -702,7 +702,7 @@ inittime(void)
PyModule_AddIntConstant(m, "daylight", 0);
PyModule_AddObject(m, "tzname", Py_BuildValue("(zz)", "", ""));
#endif /* macintosh */
-#endif /* HAVE_TM_ZONE */
+#endif /* HAVE_STRUCT_TM_TM_ZONE */
#ifdef __CYGWIN__
tzset();
PyModule_AddIntConstant(m, "timezone", _timezone);