diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-09-12 20:03:04 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-09-12 20:03:04 +0000 |
commit | b80efa2003d8208dc5ebdee285c363dc9c5e5844 (patch) | |
tree | 345dd03df488c9f44c7f16f3aa133d7535b25720 /src/include | |
parent | 47b410cd382d965c2c449f9c30c533b5d12def19 (diff) | |
download | skalibs-b80efa2003d8208dc5ebdee285c363dc9c5e5844.tar.xz |
Try another workaround for bad struct stat
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/skalibs/stat.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/include/skalibs/stat.h b/src/include/skalibs/stat.h index de85cce..ac13e54 100644 --- a/src/include/skalibs/stat.h +++ b/src/include/skalibs/stat.h @@ -3,29 +3,22 @@ #ifndef SKALIBS_STAT_H #define SKALIBS_STAT_H -#include <skalibs/sysdeps.h> - -#ifdef SKALIBS_HASSTATIM - -#define ST_ATIM st_atim -#define ST_MTIM st_mtim -#define ST_CTIM st_ctim + /* + This header must always be paired with skalibs/nonposix.h + (which must always come first). + If you #include <sys/stat.h> before this, it will not work. + */ -#else - -#ifdef SKALIBS_HASSTATIMESPEC +#include <skalibs/sysdeps.h> -#define ST_ATIM st_atimespec -#define ST_MTIM st_mtimespec -#define ST_CTIM st_ctimespec +#include <sys/stat.h> -#else +#if !defined(SKALIBS_HASSTATIM) && defined(SKALIBS_HASSTATIMESPEC) -#define ST_ATIM st_how_the_fuck_do_you_even_get_atime_on_this_OS -#define ST_MTIM st_how_the_fuck_do_you_even_get_mtime_on_this_OS -#define ST_CTIM st_how_the_fuck_do_you_even_get_ctime_on_this_OS +#define st_atim st_atimespec +#define st_mtim st_mtimespec +#define st_ctim st_ctimespec #endif -#endif #endif |