2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
+ timespec: use extern-inline
+ * lib/timespec.c: New file.
+ * lib/timespec.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ (_GL_TIMESPEC_INLINE): New macro. Use it instead of 'static inline'.
+ * modules/timespec (Files): Add lib/timespec.c.
+ (Depends-on): Add extern-inline.
+ (lib_SOURCES): Add timespec.c.
+
stat-time: use extern-inline
* lib/stat-time.c: New file.
* lib/stat-time.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
# include <time.h>
+_GL_INLINE_HEADER_BEGIN
+
/* Return negative, zero, positive if A < B, A == B, A > B, respectively.
For each time stamp T, this code assumes that either:
The (int) cast avoids a gcc -Wconversion warning. */
-static inline int
+#ifndef _GL_TIMESPEC_INLINE
+# define _GL_TIMESPEC_INLINE _GL_INLINE
+#endif
+
+_GL_TIMESPEC_INLINE int
timespec_cmp (struct timespec a, struct timespec b)
{
return (a.tv_sec < b.tv_sec ? -1
/* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be
nonnegative. */
-static inline int
+_GL_TIMESPEC_INLINE int
timespec_sign (struct timespec a)
{
return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
_GL_ATTRIBUTE_CONST;
/* Return an approximation to A, of type 'double'. */
-static inline double
+_GL_TIMESPEC_INLINE double
timespectod (struct timespec a)
{
return a.tv_sec + a.tv_nsec / 1e9;
void gettime (struct timespec *);
int settime (struct timespec const *);
+_GL_INLINE_HEADER_END
+
#endif