From 9540148c07135563932b38a962e3eea4a658cd6a Mon Sep 17 00:00:00 2001 From: moteus Date: Mon, 23 Dec 2013 16:27:30 +0400 Subject: [PATCH] Release version 0.3.3 --- rockspecs/lzmq-0.3.3-1.rockspec | 94 +++++++++++++++++++++++++++++ rockspecs/lzmq-ffi-0.3.3-1.rockspec | 58 ++++++++++++++++++ src/lua/lzmq/ffi.lua | 6 +- src/lzmq.c | 2 +- 4 files changed, 156 insertions(+), 4 deletions(-) create mode 100644 rockspecs/lzmq-0.3.3-1.rockspec create mode 100644 rockspecs/lzmq-ffi-0.3.3-1.rockspec diff --git a/rockspecs/lzmq-0.3.3-1.rockspec b/rockspecs/lzmq-0.3.3-1.rockspec new file mode 100644 index 0000000..0e89eac --- /dev/null +++ b/rockspecs/lzmq-0.3.3-1.rockspec @@ -0,0 +1,94 @@ +package = "lzmq" +version = "0.3.3-1" + +source = { + url = "/~https://github.com/moteus/lzmq/archive/v0.3.3.zip", + dir = "lzmq-0.3.3", +} + +description = { + summary = "Lua bindings to ZeroMQ", + homepage = "/~https://github.com/moteus/lzmq", + license = "MIT/X11", +} + +dependencies = { + "lua >= 5.1", + -- "lua-llthreads >= 1.2" +} + +external_dependencies = { + platforms = { + windows = { + ZMQ = { + header = "zmq.h", + library = "libzmq", + } + }; + unix = { + ZMQ = { + header = "zmq.h", + -- library = "zmq", -- does not work !? + } + }; + } +} + +build = { + copy_directories = {"test", "examples"}, + + type = "builtin", + + platforms = { + windows = { modules = { + ["lzmq.timer"] = { + defines = {'USE_PERF_COUNT'} + }, + ["lzmq"] = { + libraries = {"libzmq"}, + } + }}, + unix = { modules = { + ["lzmq.timer"] = { + defines = {'USE_CLOCK_MONOTONIC', 'USE_GETTIMEOFDAY'}, + libraries = {"rt"}, + }, + ["lzmq"] = { + libraries = {"zmq"}, + } + }} + }, + + modules = { + ["lzmq"] = { + sources = {'src/lzmq.c','src/lzutils.c','src/poller.c', + 'src/zcontext.c','src/zerror.c','src/zmsg.c', + 'src/zpoller.c','src/zsocket.c'}, + incdirs = {"$(ZMQ_INCDIR)"}, + libdirs = {"$(ZMQ_LIBDIR)"}, + defines = { + 'LUAZMQ_USE_SEND_AS_BUF', + 'LUAZMQ_USE_TEMP_BUFFERS', + 'LUAZMQ_USE_ERR_TYPE_OBJECT', + -- 'LUAZMQ_USE_ERR_TYPE_NUMBER' + -- 'LUAZMQ_USE_ERR_TYPE_STRING' + }, + }, + ["lzmq.timer"] = { + sources = {'src/ztimer.c','src/lzutils.c'}, + }, + ["lzmq.loop" ] = "src/lua/lzmq/loop.lua"; + ["lzmq.poller" ] = "src/lua/lzmq/poller.lua"; + ["lzmq.threads" ] = "src/lua/lzmq/threads.lua"; + ["lzmq.ffi" ] = "src/lua/lzmq/ffi.lua"; + ["lzmq.ffi.api" ] = "src/lua/lzmq/ffi/api.lua"; + ["lzmq.ffi.error" ] = "src/lua/lzmq/ffi/error.lua"; + ["lzmq.ffi.loop" ] = "src/lua/lzmq/ffi/loop.lua"; + ["lzmq.ffi.poller" ] = "src/lua/lzmq/ffi/poller.lua"; + ["lzmq.ffi.timer" ] = "src/lua/lzmq/ffi/timer.lua"; + ["lzmq.ffi.threads" ] = "src/lua/lzmq/ffi/threads.lua"; + ["lzmq.llthreads.ex" ] = "src/lua/lzmq/llthreads/ex.lua"; + ["lzmq.impl.threads" ] = "src/lua/lzmq/impl/threads.lua"; + ["lzmq.impl.loop" ] = "src/lua/lzmq/impl/loop.lua"; + }, +} diff --git a/rockspecs/lzmq-ffi-0.3.3-1.rockspec b/rockspecs/lzmq-ffi-0.3.3-1.rockspec new file mode 100644 index 0000000..bae2bd2 --- /dev/null +++ b/rockspecs/lzmq-ffi-0.3.3-1.rockspec @@ -0,0 +1,58 @@ +package = "lzmq-ffi" +version = "0.3.3-1" + +source = { + url = "/~https://github.com/moteus/lzmq/archive/v0.3.3.zip", + dir = "lzmq-0.3.3", +} + +description = { + summary = "Lua bindings to ZeroMQ", + homepage = "/~https://github.com/moteus/lzmq", + license = "MIT/X11", +} + +dependencies = { + "lua >= 5.1", + -- "lua-llthreads >= 1.2" + -- "lzmq-timer" +} + +build = { + copy_directories = {"test", "examples"}, + + type = "builtin", + + platforms = { + windows = { modules = { + ["lzmq.timer"] = { + defines = {'USE_PERF_COUNT'} + } + }}, + unix = { modules = { + ["lzmq.timer"] = { + defines = {'USE_CLOCK_MONOTONIC', 'USE_GETTIMEOFDAY'}, + libraries = {"rt"}, + } + }} + }, + + modules = { + ["lzmq.timer"] = { + sources = {'src/ztimer.c','src/lzutils.c'}, + }, + ["lzmq" ] = "src/lua/lzmq/ffi/lzmq.lua"; + ["lzmq.ffi" ] = "src/lua/lzmq/ffi.lua"; + + ["lzmq.loop" ] = "src/lua/lzmq/loop.lua"; + ["lzmq.poller" ] = "src/lua/lzmq/ffi/poller.lua"; + ["lzmq.threads" ] = "src/lua/lzmq/threads.lua"; + + ["lzmq.ffi.api" ] = "src/lua/lzmq/ffi/api.lua"; + ["lzmq.ffi.error" ] = "src/lua/lzmq/ffi/error.lua"; + + ["lzmq.llthreads.ex" ] = "src/lua/lzmq/llthreads/ex.lua"; + ["lzmq.impl.threads" ] = "src/lua/lzmq/impl/threads.lua"; + ["lzmq.impl.loop" ] = "src/lua/lzmq/impl/loop.lua"; + }, +} diff --git a/src/lua/lzmq/ffi.lua b/src/lua/lzmq/ffi.lua index 1825eb2..7ce2547 100644 --- a/src/lua/lzmq/ffi.lua +++ b/src/lua/lzmq/ffi.lua @@ -439,8 +439,8 @@ local RANDOM_PORT_MAX = 0xFFFF function Socket:bind_to_random_port(address, port, tries) port = port or RANDOM_PORT_BASE - tries = RANDOM_PORT_MAX - port + 1 - + tries = tries or (RANDOM_PORT_MAX - port + 1) + assert(type(address) == 'string') assert((port > 0) and (port <= RANDOM_PORT_MAX), "invalid port number") assert(tries > 0, "invalid max tries value") @@ -1069,7 +1069,7 @@ end do -- zmq -zmq._VERSION = "0.3.3-dev" +zmq._VERSION = "0.3.3" function zmq.version(unpack) local mj,mn,pt = api.zmq_version() diff --git a/src/lzmq.c b/src/lzmq.c index 548693b..8d011e6 100644 --- a/src/lzmq.c +++ b/src/lzmq.c @@ -55,7 +55,7 @@ LUAZMQ_EXPORT int luazmq_socket (lua_State *L, void *skt, unsigned char own) { #define LUAZMQ_VERSION_MAJOR 0 #define LUAZMQ_VERSION_MINOR 3 #define LUAZMQ_VERSION_PATCH 3 -#define LUAZMQ_VERSION_COMMENT "dev" +// #define LUAZMQ_VERSION_COMMENT "dev" //----------------------------------------------------------- // common