Fix. Do not use redefine typedefs as forward declaration.
parent
00c1bc4687
commit
e65cb95567
11
.travis.yml
11
.travis.yml
|
@ -6,14 +6,22 @@ matrix:
|
||||||
include:
|
include:
|
||||||
- compiler: ": Lua51"
|
- compiler: ": Lua51"
|
||||||
env: LUA="lua 5.1"
|
env: LUA="lua 5.1"
|
||||||
|
os: osx
|
||||||
|
- compiler: ": Lua51"
|
||||||
|
env: LUA="lua 5.1"
|
||||||
|
os: linux
|
||||||
- compiler: ": Lua52"
|
- compiler: ": Lua52"
|
||||||
env: LUA="lua 5.2"
|
env: LUA="lua 5.2"
|
||||||
|
os: linux
|
||||||
- compiler: ": Lua53"
|
- compiler: ": Lua53"
|
||||||
env: LUA="lua 5.3"
|
env: LUA="lua 5.3"
|
||||||
|
os: linux
|
||||||
- compiler: ": LuaJIT20"
|
- compiler: ": LuaJIT20"
|
||||||
env: LUA="luajit 2.0"
|
env: LUA="luajit 2.0"
|
||||||
|
os: linux
|
||||||
- compiler: ": LuaJIT21"
|
- compiler: ": LuaJIT21"
|
||||||
env: LUA="luajit 2.1"
|
env: LUA="luajit 2.1"
|
||||||
|
os: linux
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
@ -26,10 +34,11 @@ branches:
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- export CC=gcc
|
- export CC=gcc
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=$PATH:~/Library/Python/2.7/bin/; fi
|
||||||
- pip install --user cpp-coveralls
|
- pip install --user cpp-coveralls
|
||||||
- pip install --user hererocks
|
- pip install --user hererocks
|
||||||
- hererocks here -r^ --$LUA
|
- hererocks here -r^ --$LUA
|
||||||
- export PATH=$PATH:$PWD/here/bin
|
- source here/bin/activate
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- luarocks make rockspecs/lua-curl-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
|
- luarocks make rockspecs/lua-curl-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
|
||||||
|
|
|
@ -35,7 +35,12 @@ enum {
|
||||||
|
|
||||||
#define LCURL_EASY_MAGIC 0xEA
|
#define LCURL_EASY_MAGIC 0xEA
|
||||||
|
|
||||||
|
#if LCURL_CC_SUPPORT_FORWARD_TYPEDEF
|
||||||
typedef struct lcurl_multi_tag lcurl_multi_t;
|
typedef struct lcurl_multi_tag lcurl_multi_t;
|
||||||
|
#else
|
||||||
|
struct lcurl_multi_tag;
|
||||||
|
#define lcurl_multi_t struct lcurl_multi_tag
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct lcurl_easy_tag{
|
typedef struct lcurl_easy_tag{
|
||||||
unsigned char magic;
|
unsigned char magic;
|
||||||
|
@ -67,4 +72,8 @@ void lcurl_easy_initlib(lua_State *L, int nup);
|
||||||
|
|
||||||
void lcurl__easy_assign_lua(lua_State *L, lcurl_easy_t *p, lua_State *value, int assign_multi);
|
void lcurl__easy_assign_lua(lua_State *L, lcurl_easy_t *p, lua_State *value, int assign_multi);
|
||||||
|
|
||||||
|
#if !LCURL_CC_SUPPORT_FORWARD_TYPEDEF
|
||||||
|
#undef lcurl_multi_t
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,6 +23,14 @@ typedef struct lcurl_multi_tag{
|
||||||
lcurl_callback_t sc;
|
lcurl_callback_t sc;
|
||||||
}lcurl_multi_t;
|
}lcurl_multi_t;
|
||||||
|
|
||||||
|
|
||||||
|
#if LCURL_CC_SUPPORT_FORWARD_TYPEDEF
|
||||||
|
typedef struct lcurl_multi_tag lcurl_multi_t;
|
||||||
|
#else
|
||||||
|
struct lcurl_easy_tag;
|
||||||
|
#define lcurl_easy_t struct lcurl_easy_tag
|
||||||
|
#endif
|
||||||
|
|
||||||
int lcurl_multi_create(lua_State *L, int error_mode);
|
int lcurl_multi_create(lua_State *L, int error_mode);
|
||||||
|
|
||||||
lcurl_multi_t *lcurl_getmulti_at(lua_State *L, int i);
|
lcurl_multi_t *lcurl_getmulti_at(lua_State *L, int i);
|
||||||
|
@ -35,4 +43,8 @@ void lcurl__multi_assign_lua(lua_State *L, lcurl_multi_t *p, lua_State *value, i
|
||||||
|
|
||||||
CURLMcode lcurl__multi_remove_handle(lua_State *L, lcurl_multi_t *p, lcurl_easy_t *e);
|
CURLMcode lcurl__multi_remove_handle(lua_State *L, lcurl_multi_t *p, lcurl_easy_t *e);
|
||||||
|
|
||||||
|
#if !LCURL_CC_SUPPORT_FORWARD_TYPEDEF
|
||||||
|
#undef lcurl_easy_t
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,6 +13,18 @@
|
||||||
|
|
||||||
#include "lcurl.h"
|
#include "lcurl.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# define LCURL_CC_SUPPORT_FORWARD_TYPEDEF 1
|
||||||
|
#elif defined(__STDC_VERSION__)
|
||||||
|
# if __STDC_VERSION__ >= 201112
|
||||||
|
# define LCURL_CC_SUPPORT_FORWARD_TYPEDEF 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LCURL_CC_SUPPORT_FORWARD_TYPEDEF
|
||||||
|
# define LCURL_CC_SUPPORT_FORWARD_TYPEDEF 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LCURL_MAKE_VERSION(MIN, MAJ, PAT) ((MIN<<16) + (MAJ<<8) + PAT)
|
#define LCURL_MAKE_VERSION(MIN, MAJ, PAT) ((MIN<<16) + (MAJ<<8) + PAT)
|
||||||
#define LCURL_CURL_VER_GE(MIN, MAJ, PAT) (LIBCURL_VERSION_NUM >= LCURL_MAKE_VERSION(MIN, MAJ, PAT))
|
#define LCURL_CURL_VER_GE(MIN, MAJ, PAT) (LIBCURL_VERSION_NUM >= LCURL_MAKE_VERSION(MIN, MAJ, PAT))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue