From 3240832746eeb7623e6a30b29a8bc4bdcdb2f705 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Thu, 2 Feb 2017 11:42:04 +0300 Subject: Fix. Warning about undefined `pthread_kill` on some systems. (Close #8 #10) --- .travis.yml | 12 ++++++++- appveyor.yml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/llthread.c | 3 +++ 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 335473d..c4f54b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,24 @@ sudo: false matrix: include: + - compiler: ": Lua51-osx" + env: LUA="lua 5.1" + os: osx - compiler: ": Lua51" env: LUA="lua 5.1" + os: linux - compiler: ": Lua52" env: LUA="lua 5.2" + os: linux - compiler: ": Lua53" env: LUA="lua 5.3" + os: linux - compiler: ": LuaJIT20" env: LUA="luajit 2.0" + os: linux - compiler: ": LuaJIT21" env: LUA="luajit 2.1" + os: linux cache: directories: @@ -24,6 +32,8 @@ branches: before_install: - export CC=gcc + - gcc --version + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=$PATH:~/Library/Python/2.7/bin/; fi - pip install --user hererocks - hererocks here -r^ --$LUA; - export PATH=$PATH:$PWD/here/bin @@ -52,7 +62,7 @@ script: - lua test_threads_ex_opt_2.lua - lua test_threads_attr.lua - lua test_integer.lua - # - lua$LUA_SFX test_register_llthreads.lua + # - lua test_register_llthreads.lua notifications: email: diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..db2206e --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,78 @@ +version: 0.3.2.{build} + +os: +- Windows Server 2012 R2 + +shallow_clone: true + +environment: + LR_EXTERNAL: c:\external + + matrix: + - LUA: "lua 5.1" + - LUA: "lua 5.2" + - LUA: "lua 5.3" + +platform: + - x64 + - x86 + # - mingw + +cache: + - c:\hererocks -> appveyor.yml + - c:\external -> appveyor.yml + +install: + - echo "Setup..." + - set PATH=C:\Python27\Scripts;%LR_EXTERNAL%;%PATH% + - if /I "%platform%"=="x86" set HR_TARGET=vs_32 + - if /I "%platform%"=="x64" set HR_TARGET=vs_64 + - if /I "%platform%"=="mingw" set HR_TARGET=mingw + - if /I "%platform%"=="mingw" set PATH=C:\MinGW\bin;%PATH% + - if not exist "%LR_EXTERNAL%" ( + mkdir "%LR_EXTERNAL%" && + mkdir "%LR_EXTERNAL%\lib" && + mkdir "%LR_EXTERNAL%\include" + ) + - if not exist c:\hererocks ( + pip install hererocks && + hererocks c:\hererocks --%LUA% --target %HR_TARGET% -rlatest + ) + - call c:\hererocks\bin\activate + +before_build: + # external deps + +build_script: + - echo "Making..." + - luarocks make rockspecs/lua-llthreads2-compat-scm-0.rockspec + - luarocks make rockspecs/lua-llthreads2-scm-0.rockspec + +before_test: + # test deps + +test_script: + - echo "Testing..." + - cd %APPVEYOR_BUILD_FOLDER%\test + - lua test_version.lua + - lua test_table_copy.lua + - lua test_threads.lua 10 + - lua test_llthreads.lua + - lua test_join_timeout.lua + - lua test_join_detach.lua + - lua test_join_error.lua + - lua test_register_ffi.lua + - lua test_logger.lua + - lua test_pass_cfunction.lua + - lua test_load_llthreads2.lua + - lua test_alive.lua + - lua test_threads_ex.lua 10 + - lua test_threads_ex_arg.lua + - lua test_threads_ex_opt.lua + - lua test_threads_ex_opt_2.lua + - lua test_threads_attr.lua + - lua test_integer.lua + # - lua test_register_llthreads.lua + +after_test: + # deploy diff --git a/src/llthread.c b/src/llthread.c index 97405d0..eee7290 100644 --- a/src/llthread.c +++ b/src/llthread.c @@ -12,6 +12,9 @@ # include #else # include +# ifndef _WIN32 +# include +# endif #endif #include -- cgit v1.2.3-55-g6feb