Commit 5efe9d12 by Michael Haggerty

Introduce a new `XDL_INLINE` macro and use it instead of `inline`

`inline` is not portable enough, and the `xdiff` code doesn't import
the `GIT_INLINE` macro. So introduce a new `XDL_INLINE` macro (with
the same definition as `GIT_INLINE`). Use the new macro to inline two
functions in `xdiffi.c`.
parent b28825a1
......@@ -31,7 +31,12 @@
#define XDL_SNAKE_CNT 20
#define XDL_K_HEUR 4
/** Declare a function as always inlined. */
#if defined(_MSC_VER)
# define XDL_INLINE(type) static __inline type
#else
# define XDL_INLINE(type) static inline type
#endif
typedef struct s_xdpsplit {
long i1, i2;
......@@ -735,7 +740,7 @@ static void group_init(xdfile_t *xdf, struct xdlgroup *g)
* Move g to describe the next (possibly empty) group in xdf and return 0. If g
* is already at the end of the file, do nothing and return -1.
*/
static inline int group_next(xdfile_t *xdf, struct xdlgroup *g)
XDL_INLINE(int) group_next(xdfile_t *xdf, struct xdlgroup *g)
{
if (g->end == xdf->nrec)
return -1;
......@@ -751,7 +756,7 @@ static inline int group_next(xdfile_t *xdf, struct xdlgroup *g)
* Move g to describe the previous (possibly empty) group in xdf and return 0.
* If g is already at the beginning of the file, do nothing and return -1.
*/
static inline int group_previous(xdfile_t *xdf, struct xdlgroup *g)
XDL_INLINE(int) group_previous(xdfile_t *xdf, struct xdlgroup *g)
{
if (g->start == 0)
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment