Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# -fPIC is not used on Windows platform (all DLLs are
# relocable), -Wall generates about 30k stupid warnings
# that can hide useful ones.
set(PLATFORM_DEPENDENT_COMPILER_OPTIONS "-D_CRT_SECURE_NO_WARNINGS")
if (${MSVC})
set(PLATFORM_DEPENDENT_COMPILER_OPTIONS "-D_CRT_SECURE_NO_WARNINGS")
elseif (${MINGW})
set(LIBS ${LIBS} ws2_32)

endif()

# needed for windows sockets (not verified)
add_definitions(-D_WIN32_WINNT=0x0501)
Expand Down
9 changes: 6 additions & 3 deletions include/cql/internal/cql_connection_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ class cql_connection_impl_t : public cql::cql_connection_t

_callback_storage.set_callbacks(stream, callback_pair_t(callback, errback));

create_request(new cql::cql_message_query_impl_t(query),
cql::cql_message_query_impl_t message(query);
create_request(&message,
boost::bind(&cql_connection_impl_t::write_handle,
this,
boost::asio::placeholders::error,
Expand All @@ -254,8 +255,9 @@ class cql_connection_impl_t : public cql::cql_connection_t

_callback_storage.set_callbacks(stream, callback_pair_t(callback, errback));

cql::cql_message_prepare_impl_t message(query);
create_request(
new cql::cql_message_prepare_impl_t(query),
&message,
boost::bind(&cql_connection_impl_t::write_handle,
this,
boost::asio::placeholders::error,
Expand Down Expand Up @@ -814,8 +816,9 @@ class cql_connection_impl_t : public cql::cql_connection_t
void
options_write()
{
std::auto_ptr<cql::cql_message_options_impl_t> m(new cql::cql_message_options_impl_t());
create_request(
new cql::cql_message_options_impl_t(),
m.release(),
(boost::function<void (const boost::system::error_code &, std::size_t)>)boost::bind(
&cql_connection_impl_t::write_handle,
this,
Expand Down
4 changes: 2 additions & 2 deletions src/cql/cql_serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using namespace std;

inline double
swap_double(double source) {
#ifdef _WIN32
#if defined(_WIN32) && !defined(__GNUC__)
uint64_t bytes = *reinterpret_cast<uint64_t*>(&source);
uint64_t swapped = _byteswap_uint64(bytes);
return *reinterpret_cast<double*>(&swapped);
Expand All @@ -50,7 +50,7 @@ swap_double(double source) {

inline float
swap_float(float source) {
#ifdef _WIN32
#if defined(_WIN32) && !defined(__GNUC__)
uint32_t bytes = *reinterpret_cast<uint32_t*>(&source);
uint32_t swapped = _byteswap_ulong(bytes);
return *reinterpret_cast<float*>(&swapped);
Expand Down