diff options
| author | Paul Eggert | 2012-08-01 21:46:10 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-08-01 21:46:10 -0700 |
| commit | a0d4efe9c3c01fde58b401ee5ab88f052128fa85 (patch) | |
| tree | 70862330c792d4ba0d16d9b389e742d65ddf2004 /lib/stat-time.h | |
| parent | 13294f95172c68a5e77143f917231e0f17f37537 (diff) | |
| download | emacs-a0d4efe9c3c01fde58b401ee5ab88f052128fa85.tar.gz emacs-a0d4efe9c3c01fde58b401ee5ab88f052128fa85.zip | |
Merge from gnulib, for extern-inline.
2012-08-01 extern-inline: new module
2012-08-01 stat-time, timespec, u64, utimens: use extern-inline
* lib/stat-time.c, lib/utimespec.c, lib/u64.c, m4/extern-inline.m4:
New files. The new .c files are for instantiating extern inline
functions.
Fixes: debbugs:12116
Diffstat (limited to 'lib/stat-time.h')
| -rw-r--r-- | lib/stat-time.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/stat-time.h b/lib/stat-time.h index 30c2acdab63..74dd00aeb3e 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h | |||
| @@ -23,6 +23,11 @@ | |||
| 23 | #include <sys/stat.h> | 23 | #include <sys/stat.h> |
| 24 | #include <time.h> | 24 | #include <time.h> |
| 25 | 25 | ||
| 26 | _GL_INLINE_HEADER_BEGIN | ||
| 27 | #ifndef _GL_STAT_TIME_INLINE | ||
| 28 | # define _GL_STAT_TIME_INLINE _GL_INLINE | ||
| 29 | #endif | ||
| 30 | |||
| 26 | /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type | 31 | /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type |
| 27 | struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, | 32 | struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, |
| 28 | ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, | 33 | ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, |
| @@ -46,7 +51,7 @@ | |||
| 46 | #endif | 51 | #endif |
| 47 | 52 | ||
| 48 | /* Return the nanosecond component of *ST's access time. */ | 53 | /* Return the nanosecond component of *ST's access time. */ |
| 49 | static inline long int | 54 | _GL_STAT_TIME_INLINE long int |
| 50 | get_stat_atime_ns (struct stat const *st) | 55 | get_stat_atime_ns (struct stat const *st) |
| 51 | { | 56 | { |
| 52 | # if defined STAT_TIMESPEC | 57 | # if defined STAT_TIMESPEC |
| @@ -59,7 +64,7 @@ get_stat_atime_ns (struct stat const *st) | |||
| 59 | } | 64 | } |
| 60 | 65 | ||
| 61 | /* Return the nanosecond component of *ST's status change time. */ | 66 | /* Return the nanosecond component of *ST's status change time. */ |
| 62 | static inline long int | 67 | _GL_STAT_TIME_INLINE long int |
| 63 | get_stat_ctime_ns (struct stat const *st) | 68 | get_stat_ctime_ns (struct stat const *st) |
| 64 | { | 69 | { |
| 65 | # if defined STAT_TIMESPEC | 70 | # if defined STAT_TIMESPEC |
| @@ -72,7 +77,7 @@ get_stat_ctime_ns (struct stat const *st) | |||
| 72 | } | 77 | } |
| 73 | 78 | ||
| 74 | /* Return the nanosecond component of *ST's data modification time. */ | 79 | /* Return the nanosecond component of *ST's data modification time. */ |
| 75 | static inline long int | 80 | _GL_STAT_TIME_INLINE long int |
| 76 | get_stat_mtime_ns (struct stat const *st) | 81 | get_stat_mtime_ns (struct stat const *st) |
| 77 | { | 82 | { |
| 78 | # if defined STAT_TIMESPEC | 83 | # if defined STAT_TIMESPEC |
| @@ -85,7 +90,7 @@ get_stat_mtime_ns (struct stat const *st) | |||
| 85 | } | 90 | } |
| 86 | 91 | ||
| 87 | /* Return the nanosecond component of *ST's birth time. */ | 92 | /* Return the nanosecond component of *ST's birth time. */ |
| 88 | static inline long int | 93 | _GL_STAT_TIME_INLINE long int |
| 89 | get_stat_birthtime_ns (struct stat const *st) | 94 | get_stat_birthtime_ns (struct stat const *st) |
| 90 | { | 95 | { |
| 91 | # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC | 96 | # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC |
| @@ -100,7 +105,7 @@ get_stat_birthtime_ns (struct stat const *st) | |||
| 100 | } | 105 | } |
| 101 | 106 | ||
| 102 | /* Return *ST's access time. */ | 107 | /* Return *ST's access time. */ |
| 103 | static inline struct timespec | 108 | _GL_STAT_TIME_INLINE struct timespec |
| 104 | get_stat_atime (struct stat const *st) | 109 | get_stat_atime (struct stat const *st) |
| 105 | { | 110 | { |
| 106 | #ifdef STAT_TIMESPEC | 111 | #ifdef STAT_TIMESPEC |
| @@ -114,7 +119,7 @@ get_stat_atime (struct stat const *st) | |||
| 114 | } | 119 | } |
| 115 | 120 | ||
| 116 | /* Return *ST's status change time. */ | 121 | /* Return *ST's status change time. */ |
| 117 | static inline struct timespec | 122 | _GL_STAT_TIME_INLINE struct timespec |
| 118 | get_stat_ctime (struct stat const *st) | 123 | get_stat_ctime (struct stat const *st) |
| 119 | { | 124 | { |
| 120 | #ifdef STAT_TIMESPEC | 125 | #ifdef STAT_TIMESPEC |
| @@ -128,7 +133,7 @@ get_stat_ctime (struct stat const *st) | |||
| 128 | } | 133 | } |
| 129 | 134 | ||
| 130 | /* Return *ST's data modification time. */ | 135 | /* Return *ST's data modification time. */ |
| 131 | static inline struct timespec | 136 | _GL_STAT_TIME_INLINE struct timespec |
| 132 | get_stat_mtime (struct stat const *st) | 137 | get_stat_mtime (struct stat const *st) |
| 133 | { | 138 | { |
| 134 | #ifdef STAT_TIMESPEC | 139 | #ifdef STAT_TIMESPEC |
| @@ -143,7 +148,7 @@ get_stat_mtime (struct stat const *st) | |||
| 143 | 148 | ||
| 144 | /* Return *ST's birth time, if available; otherwise return a value | 149 | /* Return *ST's birth time, if available; otherwise return a value |
| 145 | with tv_sec and tv_nsec both equal to -1. */ | 150 | with tv_sec and tv_nsec both equal to -1. */ |
| 146 | static inline struct timespec | 151 | _GL_STAT_TIME_INLINE struct timespec |
| 147 | get_stat_birthtime (struct stat const *st) | 152 | get_stat_birthtime (struct stat const *st) |
| 148 | { | 153 | { |
| 149 | struct timespec t; | 154 | struct timespec t; |
| @@ -186,4 +191,6 @@ get_stat_birthtime (struct stat const *st) | |||
| 186 | return t; | 191 | return t; |
| 187 | } | 192 | } |
| 188 | 193 | ||
| 194 | _GL_INLINE_HEADER_END | ||
| 195 | |||
| 189 | #endif | 196 | #endif |