Mercurial > hg > octave-kai > gnulib-hg
changeset 17025:ca76418cc04d
u64: use extern-inline
* lib/u64.c: New file.
* lib/u64.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
(_GL_U64_INLINE): New macro. Use it instead of 'static inline'.
* modules/u64 (Files): Add lib/u64.c.
(Depends-on): Add extern-inline.
(configure.ac): No need to require AC_C_INLINE, since extern-inline
does that now.
(lib_SOURCES): Add u64.c.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sat, 28 Jul 2012 07:20:59 -0700 |
parents | fc5763921b7d |
children | ca6d65189199 |
files | ChangeLog lib/u64.c lib/u64.h modules/u64 |
diffstat | 4 files changed, 34 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2012-08-01 Paul Eggert <eggert@cs.ucla.edu> + u64: use extern-inline + * lib/u64.c: New file. + * lib/u64.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END. + (_GL_U64_INLINE): New macro. Use it instead of 'static inline'. + * modules/u64 (Files): Add lib/u64.c. + (Depends-on): Add extern-inline. + (configure.ac): No need to require AC_C_INLINE, since extern-inline + does that now. + (lib_SOURCES): Add u64.c. + timespec: use extern-inline * lib/timespec.c: New file. * lib/timespec.h: Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
new file mode 100644 --- /dev/null +++ b/lib/u64.c @@ -0,0 +1,3 @@ +#include <config.h> +#define _GL_U64_INLINE _GL_EXTERN_INLINE +#include <u64.h>
--- a/lib/u64.h +++ b/lib/u64.h @@ -19,6 +19,8 @@ #include <stdint.h> +_GL_INLINE_HEADER_BEGIN + /* Return X rotated left by N bits, where 0 < N < 64. */ #define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n)) @@ -52,9 +54,13 @@ # define u64init(hi, lo) { lo, hi } # endif +#ifndef _GL_U64_INLINE +# define _GL_U64_INLINE _GL_INLINE +#endif + /* Given the high and low-order 32-bit quantities HI and LO, return a u64 value representing (HI << 32) + LO. */ -static inline u64 +_GL_U64_INLINE u64 u64hilo (uint32_t hi, uint32_t lo) { u64 r; @@ -64,7 +70,7 @@ } /* Return a u64 value representing LO. */ -static inline u64 +_GL_U64_INLINE u64 u64lo (uint32_t lo) { u64 r; @@ -74,7 +80,7 @@ } /* Return a u64 value representing SIZE. */ -static inline u64 +_GL_U64_INLINE u64 u64size (size_t size) { u64 r; @@ -84,14 +90,14 @@ } /* Return X < Y. */ -static inline int +_GL_U64_INLINE int u64lt (u64 x, u64 y) { return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo); } /* Return X & Y. */ -static inline u64 +_GL_U64_INLINE u64 u64and (u64 x, u64 y) { u64 r; @@ -101,7 +107,7 @@ } /* Return X | Y. */ -static inline u64 +_GL_U64_INLINE u64 u64or (u64 x, u64 y) { u64 r; @@ -111,7 +117,7 @@ } /* Return X ^ Y. */ -static inline u64 +_GL_U64_INLINE u64 u64xor (u64 x, u64 y) { u64 r; @@ -121,7 +127,7 @@ } /* Return X + Y. */ -static inline u64 +_GL_U64_INLINE u64 u64plus (u64 x, u64 y) { u64 r; @@ -131,7 +137,7 @@ } /* Return X << N. */ -static inline u64 +_GL_U64_INLINE u64 u64shl (u64 x, int n) { u64 r; @@ -149,7 +155,7 @@ } /* Return X >> N. */ -static inline u64 +_GL_U64_INLINE u64 u64shr (u64 x, int n) { u64 r; @@ -167,3 +173,5 @@ } #endif + +_GL_INLINE_HEADER_END