]> granicus.if.org Git - python/commitdiff
Patch #623780: Replace obsolete struct macros.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 16 Oct 2002 20:28:25 +0000 (20:28 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 16 Oct 2002 20:28:25 +0000 (20:28 +0000)
Modules/posixmodule.c
Modules/timemodule.c
configure
configure.in
pyconfig.h.in

index 53324b5d20405314966400d56c77e4f59fda8e9a..68f7b6264894994e1e17beed5d698cdc7cae5579 100644 (file)
@@ -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
index 13da2ffe24ef4a531ac3416cac64cbac810459ef..7a2f02a8754eb2cec9fafe5782db836baccc4b38 100644 (file)
@@ -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);
index d9e98e07caacc7f9318ba4ad0a77254d913e4a06..3e7e901716ebca855ea80b9bade71df65984373d 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.356 .
+# From configure.in Revision: 1.357 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.53.
 #
@@ -13333,7 +13333,6 @@ _ACEOF
   fi
 fi
 
-
 echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5
 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6
 if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then
@@ -13388,14 +13387,8 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ST_RDEV 1
-_ACEOF
-
 fi
 
-
-
 echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
 echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6
 if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
@@ -13450,13 +13443,8 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ST_BLKSIZE 1
-_ACEOF
-
 fi
 
-
 echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5
 echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6
 if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then
index 21fc77c65e10fc47e19381a9efe20c5274e95768..002666d5d1752c2fa4b4d8e6afa822c57cfd408a 100644 (file)
@@ -1860,8 +1860,8 @@ AC_CHECK_FUNCS(getnameinfo)
 AC_HEADER_TIME
 AC_STRUCT_TM
 AC_STRUCT_TIMEZONE
-AC_STRUCT_ST_RDEV
-AC_STRUCT_ST_BLKSIZE
+AC_CHECK_MEMBERS([struct stat.st_rdev])
+AC_CHECK_MEMBERS([struct stat.st_blksize])
 AC_STRUCT_ST_BLOCKS
 
 AC_MSG_CHECKING(for time.h that defines altzone)
index 01cced8084a31efa460441f76d967f22455380ea..c6713de7699a7f2ae35436f94a14a99dfea10f2e 100644 (file)
 /* Define to 1 if `tm_zone' is member of `struct tm'. */
 #undef HAVE_STRUCT_TM_TM_ZONE
 
-/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use
-   `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */
-#undef HAVE_ST_BLKSIZE
-
 /* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use
    `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */
 #undef HAVE_ST_BLOCKS
 
-/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
-   `HAVE_STRUCT_STAT_ST_RDEV' instead. */
-#undef HAVE_ST_RDEV
-
 /* Define to 1 if you have the `symlink' function. */
 #undef HAVE_SYMLINK