diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-03-08 22:03:13 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-03-08 22:03:13 +0100 |
commit | e641699717e5e1a58da975ec7357baefb8526095 (patch) | |
tree | 3ed90c683189e9526c9ca3f08efe90ce22fbe16f /src/blogc-make/ctx.h | |
parent | d41c2fcdd9366fb3f1fcb11aceed919bfebbed61 (diff) | |
download | blogc-e641699717e5e1a58da975ec7357baefb8526095.tar.gz blogc-e641699717e5e1a58da975ec7357baefb8526095.tar.bz2 blogc-e641699717e5e1a58da975ec7357baefb8526095.zip |
make: fix compilation on android
Diffstat (limited to 'src/blogc-make/ctx.h')
-rw-r--r-- | src/blogc-make/ctx.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/blogc-make/ctx.h b/src/blogc-make/ctx.h index e36fa4c..67d0a7d 100644 --- a/src/blogc-make/ctx.h +++ b/src/blogc-make/ctx.h @@ -16,15 +16,28 @@ #include "../common/utils.h" #ifdef __APPLE__ -#ifndef st_mtim -#define st_mtim st_mtimespec +#define st_mtim_tv_sec st_mtimespec.tv_sec +#define st_mtim_tv_nsec st_mtimespec.tv_nsec #endif + +#ifdef __ANDROID__ +#define st_mtim_tv_sec st_mtime +#define st_mtim_tv_nsec st_mtime_nsec +#endif + +#ifndef st_mtim_tv_sec +#define st_mtim_tv_sec st_mtim.tv_sec #endif +#ifndef st_mtim_tv_nsec +#define st_mtim_tv_nsec st_mtim.tv_nsec +#endif + typedef struct { char *path; char *short_path; - struct timespec timestamp; + time_t tv_sec; + long tv_nsec; bool readable; } bm_filectx_t; @@ -50,7 +63,7 @@ typedef struct { } bm_ctx_t; bm_filectx_t* bm_filectx_new(bm_ctx_t *ctx, const char *filename); -bool bm_filectx_changed(bm_filectx_t *ctx, struct timespec *ts); +bool bm_filectx_changed(bm_filectx_t *ctx, time_t *tv_sec, long *tv_nsec); void bm_filectx_reload(bm_filectx_t *ctx); void bm_filectx_free(bm_filectx_t *fctx); bm_ctx_t* bm_ctx_new(bm_ctx_t *base, const char *settings_file, |