Index: lua_config.c
===================================================================
--- lua_config.c	(revision 758044)
+++ lua_config.c	(working copy)
@@ -49,7 +49,7 @@
     return APL_SCOPE_ONCE;
 }
 
-apr_status_t apl_lua_map_handler(apl_dir_cfg *cfg,
+AP_LUA_DECLARE(apr_status_t) apl_lua_map_handler(apl_dir_cfg *cfg,
                                  const char *file,
                                  const char *function,
                                  const char *pattern, const char *scope)
@@ -233,7 +233,7 @@
     {NULL, NULL}
 };
 
-void apl_load_config_lmodule(lua_State *L)
+AP_LUA_DECLARE(void) apl_load_config_lmodule(lua_State *L)
 {
     luaL_newmetatable(L, "Apache2.DirConfig");  /* [metatable] */
     lua_pushvalue(L, -1);
Index: lua_config.h
===================================================================
--- lua_config.h	(revision 758044)
+++ lua_config.h	(working copy)
@@ -20,9 +20,9 @@
 #ifndef _APL_CONFIG_H_
 #define _APL_CONFIG_H_
 
-APR_DECLARE(void) apl_load_config_lmodule(lua_State *L);
+AP_LUA_DECLARE(void) apl_load_config_lmodule(lua_State *L);
 
-APR_DECLARE(apr_status_t) apl_lua_map_handler(apl_dir_cfg *cfg,
+AP_LUA_DECLARE(apr_status_t) apl_lua_map_handler(apl_dir_cfg *cfg,
                                               const char *file,
                                               const char *function,
                                               const char *pattern,
Index: lua_request.c
===================================================================
--- lua_request.c	(revision 758044)
+++ lua_request.c	(working copy)
@@ -334,10 +334,11 @@
         switch (rft->type) {
         case APL_REQ_FUNTYPE_TABLE:{
                 req_field_apr_table_f func = rft->fun;
+                apr_table_t *rs;
                 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                               "request_rec->dispatching %s -> apr table",
                               name);
-                apr_table_t *rs;
+                
                 rs = (*func)(r);
                 apl_push_apr_table(L, rs);          
                 return 1;
@@ -508,7 +509,7 @@
     return rft;
 }
 
-void apl_load_request_lmodule(lua_State *L, apr_pool_t *p)
+AP_LUA_DECLARE(void) apl_load_request_lmodule(lua_State *L, apr_pool_t *p)
 {
 
     apr_hash_t *dispatch = apr_hash_make(p);
@@ -644,7 +645,7 @@
     lua_pop(L, 1);
 }
 
-void apl_push_request(lua_State *L, request_rec *r)
+AP_LUA_DECLARE(void) apl_push_request(lua_State *L, request_rec *r)
 {
     lua_boxpointer(L, r);
     luaL_getmetatable(L, "Apache2.Request");
Index: lua_request.h
===================================================================
--- lua_request.h	(revision 758044)
+++ lua_request.h	(working copy)
@@ -18,8 +18,8 @@
 #ifndef _LUA_REQUEST_H_
 #define _LUA_REQUEST_H_
 
-APR_DECLARE(void) apl_push_request(lua_State *L, request_rec *r);
-APR_DECLARE(void) apl_load_request_lmodule(lua_State *L, apr_pool_t *p);
+AP_LUA_DECLARE(void) apl_push_request(lua_State *L, request_rec *r);
+AP_LUA_DECLARE(void) apl_load_request_lmodule(lua_State *L, apr_pool_t *p);
 
 #define APL_REQ_FUNTYPE_STRING      1
 #define APL_REQ_FUNTYPE_INT         2
Index: mod_lua.h
===================================================================
--- mod_lua.h	(revision 758044)
+++ mod_lua.h	(working copy)
@@ -44,6 +44,24 @@
 #include "lauxlib.h"
 #include "lualib.h"
 
+#if !defined(WIN32)
+#define AP_LUA_DECLARE(type)            type
+#define AP_LUA_DECLARE_NONSTD(type)     type
+#define AP_LUA_DECLARE_DATA
+#elif defined(LUA_DECLARE_STATIC)
+#define AP_LUA_DECLARE(type)            type __stdcall
+#define AP_LUA_DECLARE_NONSTD(type)     type
+#define AP_LUA_DECLARE_DATA
+#elif defined(LUA_DECLARE_EXPORT)
+#define AP_LUA_DECLARE(type)            __declspec(dllexport) type __stdcall
+#define AP_LUA_DECLARE_NONSTD(type)     __declspec(dllexport) type
+#define AP_LUA_DECLARE_DATA             __declspec(dllexport)
+#else
+#define AP_LUA_DECLARE(type)            __declspec(dllimport) type __stdcall
+#define AP_LUA_DECLARE_NONSTD(type)     __declspec(dllimport) type
+#define AP_LUA_DECLARE_DATA             __declspec(dllimport)
+#endif
+
 #include "lua_request.h"
 #include "lua_vmprep.h"
 
@@ -120,24 +138,6 @@
 
 extern module AP_MODULE_DECLARE_DATA lua_module;
 
-#if !defined(WIN32)
-#define AP_LUA_DECLARE(type)            type
-#define AP_LUA_DECLARE_NONSTD(type)     type
-#define AP_LUA_DECLARE_DATA
-#elif defined(LUA_DECLARE_STATIC)
-#define AP_LUA_DECLARE(type)            type __stdcall
-#define AP_LUA_DECLARE_NONSTD(type)     type
-#define AP_LUA_DECLARE_DATA
-#elif defined(LUA_DECLARE_EXPORT)
-#define AP_LUA_DECLARE(type)            __declspec(dllexport) type __stdcall
-#define AP_LUA_DECLARE_NONSTD(type)     __declspec(dllexport) type
-#define AP_LUA_DECLARE_DATA             __declspec(dllexport)
-#else
-#define AP_LUA_DECLARE(type)            __declspec(dllimport) type __stdcall
-#define AP_LUA_DECLARE_NONSTD(type)     __declspec(dllimport) type
-#define AP_LUA_DECLARE_DATA             __declspec(dllimport)
-#endif
-
 APR_DECLARE_EXTERNAL_HOOK(apl, AP_LUA, int, lua_open,
                           (lua_State *L, apr_pool_t *p));
 
