aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml13
-rw-r--r--src/options.c4
2 files changed, 11 insertions, 6 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ee6e1d4..432bafb 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -13,22 +13,27 @@ jobs:
13 fail-fast: false 13 fail-fast: false
14 matrix: 14 matrix:
15 luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ] 15 luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ]
16 platform: [ "ubuntu-20.04", "macos-11" ] # "windows-2022" not supported by gh-actions-lua 16 platform: [ "ubuntu-20.04", "macos-11", "windows-2022" ]
17 runs-on: ${{ matrix.platform }} 17 runs-on: ${{ matrix.platform }}
18 steps: 18 steps:
19 - name: Checkout 19 - name: Checkout
20 uses: actions/checkout@v3 20 uses: actions/checkout@v3
21 - name: Setup ’msvc’
22 uses: ilammy/msvc-dev-cmd@v1
23 if: ${{ !startsWith(matrix.luaVersion, 'luajit') }}
21 - name: Setup ‘lua’ 24 - name: Setup ‘lua’
22 uses: leafo/gh-actions-lua@v9 25 uses: leso-kn/gh-actions-lua@v11-staging
23 with: 26 with:
24 luaVersion: ${{ matrix.luaVersion }} 27 luaVersion: ${{ matrix.luaVersion }}
25 - name: Setup ‘luarocks’ 28 - name: Setup ‘luarocks’
26 uses: leafo/gh-actions-luarocks@v4 29 uses: hishamhm/gh-actions-luarocks@master
27 - name: Make and install 30 - name: Make and install
28 run: | 31 run: |
29 export DEBUG=DEBUG
30 luarocks make -- luasocket-scm-3.rockspec 32 luarocks make -- luasocket-scm-3.rockspec
33 env:
34 DEBUG: DEBUG
31 - name: Run regression tests 35 - name: Run regression tests
36 shell: bash
32 run: | 37 run: |
33 cd test 38 cd test
34 lua hello.lua 39 lua hello.lua
diff --git a/src/options.c b/src/options.c
index 6581cae..9dea6bd 100644
--- a/src/options.c
+++ b/src/options.c
@@ -58,7 +58,7 @@ int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps)
58/* binds socket to network interface */ 58/* binds socket to network interface */
59int opt_set_bindtodevice(lua_State *L, p_socket ps) 59int opt_set_bindtodevice(lua_State *L, p_socket ps)
60{ 60{
61#if defined(__APPLE__) || defined(__WIN32__) || defined(_MSC_VER) 61#ifndef SO_BINDTODEVICE
62 return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system"); 62 return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system");
63#else 63#else
64 const char *dev = luaL_checkstring(L, 3); 64 const char *dev = luaL_checkstring(L, 3);
@@ -68,7 +68,7 @@ int opt_set_bindtodevice(lua_State *L, p_socket ps)
68 68
69int opt_get_bindtodevice(lua_State *L, p_socket ps) 69int opt_get_bindtodevice(lua_State *L, p_socket ps)
70{ 70{
71#if defined(__APPLE__) || defined(__WIN32__) || defined(_MSC_VER) 71#ifndef SO_BINDTODEVICE
72 return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system"); 72 return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system");
73#else 73#else
74 char dev[IFNAMSIZ]; 74 char dev[IFNAMSIZ];