Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 434238 | Differences between
and this patch

Collapse All | Expand All

(-)a/configure.ac (-27 lines)
Lines 68-100 else Link Here
68
	fi
68
	fi
69
fi
69
fi
70
70
71
_LIBS="${LIBS}"
72
_CFLAGS="${CFLAGS}"
73
_CPPFLAGS="${CPPFLAGS}"
74
LIBS="${LIBS} ${LUA_LIBS}"
75
CFLAGS="${CFLAGS} ${LUA_CFLAGS}"
76
CPPFLAGS="${CPPFLAGS} ${LUA_CFLAGS}"
77
78
AC_MSG_CHECKING([whether Lua library was compiled with compat support])
79
AC_LINK_IFELSE(
80
	[AC_LANG_PROGRAM([
81
			#define LUA_COMPAT_ALL
82
			#include <lauxlib.h>
83
		],[luaL_register(0,0,0);])],
84
	[lua_compat_support=yes],
85
	[lua_compat_support=no]
86
)
87
AC_MSG_RESULT([${lua_compat_support}])
88
89
if test "x${lua_compat_support}" = xno ; then
90
	AC_MSG_ERROR([Lua library needs to be compiled with compat support])
91
fi
92
93
LIBS="${_LIBS}"
94
CFLAGS="${_CFLAGS}"
95
CPPFLAGS="${_CPPFLAGS}"
96
unset _LIBS _CFLAGS _CPPFLAGS
97
98
AX_SUBST_L([LUA_CFLAGS], [LUA_LIBS], [LUA], [LUAC])
71
AX_SUBST_L([LUA_CFLAGS], [LUA_LIBS], [LUA], [LUAC])
99
72
100
73
(-)a/inotify.c (-1 / +1 lines)
Lines 499-505 inotify_ready( Link Here
499
extern void
499
extern void
500
register_inotify( lua_State *L )
500
register_inotify( lua_State *L )
501
{
501
{
502
	luaL_register( L, LSYNCD_INOTIFYLIBNAME, linotfylib );
502
	luaL_newlib( L, linotfylib );
503
}
503
}
504
504
505
505
(-)a/lsyncd.c (-3 / +4 lines)
Lines 1086-1098 l_exec( lua_State *L ) Link Here
1086
		{
1086
		{
1087
			int tlen;
1087
			int tlen;
1088
			int it;
1088
			int it;
1089
			lua_checkstack( L, lua_gettop( L ) + lua_objlen( L, i ) + 1 );
1089
1090
			lua_checkstack( L, lua_gettop( L ) + lua_rawlen( L, i ) + 1 );
1090
1091
1091
			// moves table to top of stack
1092
			// moves table to top of stack
1092
			lua_pushvalue( L, i );
1093
			lua_pushvalue( L, i );
1093
			lua_remove( L, i );
1094
			lua_remove( L, i );
1094
			argc--;
1095
			argc--;
1095
			tlen = lua_objlen( L, -1 );
1096
			tlen = lua_rawlen( L, -1 );
1096
1097
1097
			for( it = 1; it <= tlen; it++ )
1098
			for( it = 1; it <= tlen; it++ )
1098
			{
1099
			{
Lines 1850-1856 l_jiffies_le(lua_State *L) Link Here
1850
void
1851
void
1851
register_lsyncd( lua_State *L )
1852
register_lsyncd( lua_State *L )
1852
{
1853
{
1853
	luaL_register( L, LSYNCD_LIBNAME, lsyncdlib );
1854
	luaL_newlib( L, lsyncdlib );
1854
	lua_setglobal( L, LSYNCD_LIBNAME );
1855
	lua_setglobal( L, LSYNCD_LIBNAME );
1855
1856
1856
	// creates the metatable for the jiffies ( timestamps ) userdata
1857
	// creates the metatable for the jiffies ( timestamps ) userdata
(-)a/lsyncd.h (-4 lines)
Lines 16-23 Link Here
16
#define _XOPEN_SOURCE 700
16
#define _XOPEN_SOURCE 700
17
#define _DARWIN_C_SOURCE 1
17
#define _DARWIN_C_SOURCE 1
18
18
19
#define LUA_COMPAT_ALL
20
21
// includes needed for headerfile
19
// includes needed for headerfile
22
#include "config.h"
20
#include "config.h"
23
21
24
- 
25
--
26
inotify.c | 6 ++++++
22
inotify.c | 6 ++++++
27
lsyncd.c  | 9 +++++++++
23
lsyncd.c  | 9 +++++++++
28
2 files changed, 15 insertions(+)
24
2 files changed, 15 insertions(+)
(-)a/inotify.c (+6 lines)
Lines 39-44 Link Here
39
#include <lualib.h>
39
#include <lualib.h>
40
#include <lauxlib.h>
40
#include <lauxlib.h>
41
41
42
/*
43
| Lua 5.1 compatibility fallbacks
44
*/
45
#if LUA_VERSION_NUM < 502
46
#   define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
47
#endif
42
48
43
/*
49
/*
44
| Event types.
50
| Event types.
(-)a/lsyncd.c (-1 / +9 lines)
Lines 56-61 extern const char defaults_out[]; Link Here
56
extern size_t defaults_size;
56
extern size_t defaults_size;
57
57
58
/*
58
/*
59
| Lua 5.1 compatibility fallbacks
60
*/
61
#if LUA_VERSION_NUM < 502
62
/* lua_rawlen: Not entirely correct, but should work anyway */
63
#	define lua_rawlen lua_objlen
64
#	define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
65
#endif
66
67
/*
59
| Makes sure there is one file system monitor.
68
| Makes sure there is one file system monitor.
60
*/
69
*/
61
#ifndef LSYNCD_WITH_INOTIFY
70
#ifndef LSYNCD_WITH_INOTIFY
62
- 

Return to bug 434238