diff options
Diffstat (limited to 'Sluift')
-rw-r--r-- | Sluift/Lua/Value.cpp | 4 | ||||
-rw-r--r-- | Sluift/SConscript | 4 | ||||
-rw-r--r-- | Sluift/sluift.cpp | 16 |
3 files changed, 15 insertions, 9 deletions
diff --git a/Sluift/Lua/Value.cpp b/Sluift/Lua/Value.cpp index c03e633..3164ec6 100644 --- a/Sluift/Lua/Value.cpp +++ b/Sluift/Lua/Value.cpp @@ -6,9 +6,7 @@ #include "Value.h" -extern "C" { - #include <lualib.h> -} +#include <lualib.h> #include <boost/variant/apply_visitor.hpp> #include <Swiften/Base/foreach.h> diff --git a/Sluift/SConscript b/Sluift/SConscript index 576eae5..7c434de 100644 --- a/Sluift/SConscript +++ b/Sluift/SConscript @@ -22,6 +22,10 @@ if env["SCONS_STAGE"] == "build" : myenv.Append(CPPDEFINES = ["SLUIFT_BUILD_DLL"]) elif myenv["PLATFORM"] == "darwin" : myenv["SHLIBSUFFIX"] = ".so" + if env["PLATFORM"] == "win32" : + myenv.Append(CFLAGS = ["/TP"]) + else : + myenv.Append(CFLAGS = ["-x", "c++"]) myenv["SLUIFT_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "sluift") def patchLua(env, target, source) : diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp index 49cfec4..b911772 100644 --- a/Sluift/sluift.cpp +++ b/Sluift/sluift.cpp @@ -4,16 +4,15 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -extern "C" { - #include "sluift.h" - #include <lauxlib.h> -} +#include "sluift.h" +#include <lauxlib.h> #include <iostream> #include <string> #include <deque> #include <boost/assign/list_of.hpp> +#include <Swiften/Base/foreach.h> #include <Swiften/Swiften.h> #include "Watchdog.h" @@ -63,6 +62,10 @@ class SluiftClient { return client; } + ClientOptions& getOptions() { + return options; + } + void connect() { rosterReceived = false; client->connect(); @@ -179,6 +182,7 @@ class SluiftClient { private: Client* client; + ClientOptions options; ClientXMLTracer* tracer; bool rosterReceived; std::deque<Stanza::ref> pendingEvents; @@ -453,12 +457,12 @@ static int sluift_client_set_options(lua_State* L) { luaL_checktype(L, 2, LUA_TTABLE); lua_getfield(L, 2, "compress"); if (!lua_isnil(L, -1)) { - client->getClient()->setUseStreamCompression(lua_toboolean(L, -1)); + client->getOptions().useStreamCompression = lua_toboolean(L, -1); } lua_getfield(L, 2, "tls"); if (!lua_isnil(L, -1)) { bool useTLS = lua_toboolean(L, -1); - client->getClient()->setUseTLS(useTLS ? Client::UseTLSWhenAvailable : Client::NeverUseTLS); + client->getOptions().useTLS = (useTLS ? ClientOptions::UseTLSWhenAvailable : ClientOptions::NeverUseTLS); } lua_pushvalue(L, 1); return 0; |