diff options
Diffstat (limited to 'project/dclib/dclib-file.h')
| -rw-r--r-- | project/dclib/dclib-file.h | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/project/dclib/dclib-file.h b/project/dclib/dclib-file.h index 05e520e..6f6aee9 100644 --- a/project/dclib/dclib-file.h +++ b/project/dclib/dclib-file.h @@ -128,7 +128,7 @@ ccp GetFileOpenMode /////////////////////////////////////////////////////////////////////////////// #ifndef HAVE_STATTIME_NSEC - #if defined(st_atime) && defined(st_mtime) && defined(st_ctime) && !defined(__APPLE__) + #ifdef _STATBUF_ST_NSEC #define HAVE_STATTIME_NSEC 1 #else #define HAVE_STATTIME_NSEC 0 @@ -200,35 +200,13 @@ static inline bool IsTimeSpecNull ( const struct timespec *ts ) /////////////////////////////////////////////////////////////////////////////// /////////////// struct FileAttrib_t /////////////// /////////////////////////////////////////////////////////////////////////////// - -#ifndef HAVE_FILEATTRIB_NSEC - #if defined(st_mtime) && !defined(__APPLE__) - #define HAVE_FILEATTRIB_NSEC 1 - #else - #define HAVE_FILEATTRIB_NSEC 1 - #endif -#endif - -#undef FILEATTRIB_SEC -#undef FILEATTRIB_NSEC -#if HAVE_FILEATTRIB_NSEC - #define FILEATTRIB_SEC(t) ((t).tv_sec) - #define FILEATTRIB_NSEC(t) ((t).tv_nsec) -#else - #define FILEATTRIB_SEC(t) (t) - #define FILEATTRIB_NSEC(t) 0 -#endif - -/////////////////////////////////////////////////////////////////////////////// // [[FileAttrib_t]] typedef struct FileAttrib_t { - #if HAVE_FILEATTRIB_NSEC - union { - struct timespec times[4]; + struct timespec times[4]; // all times as array struct { // order compatible to utimensat() and futimens() @@ -241,17 +219,6 @@ typedef struct FileAttrib_t size_t size; // file size mode_t mode; // file mode - - #else - time_t mtime; // time of last content modification - time_t ctime; // time of file creation or last status change - time_t atime; // last ascces time - time_t itime; // insertion time (special time for archives) - - size_t size; // file size - mode_t mode; // file mode - #endif - } FileAttrib_t; @@ -262,8 +229,8 @@ FileAttrib_t * ClearFileAttrib FileAttrib_t * dest // NULL or destination attribute ); -static inline FileAttrib_t * ZeroFileAttrib ( FileAttrib_t * dest ) - { DASSERT(dest); memset(dest,0,sizeof(*dest)); return dest; } +static inline void ZeroFileAttrib ( FileAttrib_t * dest ) + { DASSERT(dest); memset(dest,0,sizeof(*dest)); } FileAttrib_t * TouchFileAttrib ( |
