diff --git a/config b/config index 044deb974e..bf194ebb3c 100644 --- a/config +++ b/config @@ -400,6 +400,7 @@ HTTP_LUA_DEPS=" \ $ngx_addon_dir/src/ngx_http_lua_shdict.h \ $ngx_addon_dir/src/ngx_http_lua_socket_tcp.h \ $ngx_addon_dir/src/api/ngx_http_lua_api.h \ + $ngx_addon_dir/src/api/ngx_http_lua_api_common.h \ $ngx_addon_dir/src/ngx_http_lua_logby.h \ $ngx_addon_dir/src/ngx_http_lua_sleep.h \ $ngx_addon_dir/src/ngx_http_lua_semaphore.h\ diff --git a/src/api/ngx_http_lua_api.h b/src/api/ngx_http_lua_api.h index a725a51413..231b5757aa 100644 --- a/src/api/ngx_http_lua_api.h +++ b/src/api/ngx_http_lua_api.h @@ -15,6 +15,7 @@ #include #include +#include "ngx_http_lua_api_common.h" /* Public API for other Nginx modules */ diff --git a/src/api/ngx_http_lua_api_common.h b/src/api/ngx_http_lua_api_common.h new file mode 100644 index 0000000000..9d80fb128b --- /dev/null +++ b/src/api/ngx_http_lua_api_common.h @@ -0,0 +1,19 @@ + +#ifndef _NGX_HTTP_LUA_API_COMMON_H_INCLUDED_ +#define _NGX_HTTP_LUA_API_COMMON_H_INCLUDED_ + +#include + + +#ifndef NGX_LUA_NO_FFI_API +typedef struct { + int len; + /* this padding hole on 64-bit systems is expected */ + u_char *data; +} ngx_http_lua_ffi_str_t; +#endif /* NGX_LUA_NO_FFI_API */ + + +#endif /* _NGX_HTTP_LUA_API_COMMON_H_INCLUDED_ */ + +/* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/src/ngx_http_lua_common.h b/src/ngx_http_lua_common.h index 01ef2bec8b..be06e8fbb4 100644 --- a/src/ngx_http_lua_common.h +++ b/src/ngx_http_lua_common.h @@ -21,6 +21,8 @@ #include #include +#include "api/ngx_http_lua_api_common.h" + #if (NGX_PCRE) diff --git a/src/ngx_http_lua_util.h b/src/ngx_http_lua_util.h index e9924e41eb..57957f6c55 100644 --- a/src/ngx_http_lua_util.h +++ b/src/ngx_http_lua_util.h @@ -18,13 +18,6 @@ #ifndef NGX_LUA_NO_FFI_API -typedef struct { - int len; - /* this padding hole on 64-bit systems is expected */ - u_char *data; -} ngx_http_lua_ffi_str_t; - - typedef struct { ngx_http_lua_ffi_str_t key; ngx_http_lua_ffi_str_t value;