Browse Source

Fixed Cygwin build -- asio headers are now correct

master
Artyom Beilis 15 years ago
parent
commit
4e98e9035a
7 changed files with 39 additions and 38 deletions
  1. +26
    -0
      asio_config.h
  2. +4
    -1
      session_tcp_storage.cpp
  3. +0
    -1
      session_tcp_storage.h
  4. +2
    -0
      tcp_cache.cpp
  5. +2
    -16
      tcp_cache_server.cpp
  6. +3
    -1
      tcp_connector.cpp
  7. +2
    -19
      tcp_messenger.h

+ 26
- 0
asio_config.h View File

@@ -0,0 +1,26 @@
#ifndef CPPCMS_ASIO_CONF_H
#define CPPCMS_ASIO_CONF_H

#include "config.h"
#ifdef __CYGWIN__
// Cygwin ASIO works only with win32 sockets
#define _WIN32_WINNT 1
#define __USE_W32_SOCKETS 1
#endif

#ifdef USE_BOOST_ASIO
#include <boost/asio.hpp>
namespace aio = boost::asio;
using boost::system::error_code;
using boost::system::system_error;
#else
#include <asio.hpp>
namespace aio = asio;
using asio::error_code;
using asio::system_error;
#endif

using aio::ip::tcp;


#endif

+ 4
- 1
session_tcp_storage.cpp View File

@@ -1,6 +1,9 @@
#include "asio_config.h"
// MUST BE FIRST TO COMPILE CORRECTLY UNDER CYGWIN
#include "tcp_messenger.h"
#include "session_tcp_storage.h"
#include "session_sid.h"
#include "manager.h"
#include "global_config.h"

namespace cppcms {



+ 0
- 1
session_tcp_storage.h View File

@@ -3,7 +3,6 @@

#include "session_storage.h"
#include "tcp_connector.h"
#include "tcp_messenger.h"
#include "session_backend_factory.h"

namespace cppcms {


+ 2
- 0
tcp_cache.cpp View File

@@ -1,3 +1,5 @@
#include "asio_config.h"
// MUST BE FIRST TO COMPILE CORRECTLY UNDER CYGWIN
#include "tcp_messenger.h"
#include "tcp_cache.h"



+ 2
- 16
tcp_cache_server.cpp View File

@@ -1,19 +1,6 @@
#include "config.h"
#ifdef __CYGWIN__
// Cygwin ASIO works only with win32 sockets
#define _WIN32_WINNT 1
#define __USE_W32_SOCKETS 1
#endif
#include "asio_config.h"
// MUST BE FIRST TO COMPILE CORRECTLY UNDER CYGWIN

#ifdef USE_BOOST_ASIO
#include <boost/asio.hpp>
namespace aio = boost::asio;
using boost::system::error_code;
#else
#include <asio.hpp>
namespace aio = asio;
using asio::error_code;
#endif
#include "tcp_cache_protocol.h"
#include "session_storage.h"
#include "archive.h"
@@ -34,7 +21,6 @@ using asio::error_code;

using namespace std;
using namespace cppcms;
using aio::ip::tcp;
using boost::shared_ptr;




+ 3
- 1
tcp_connector.cpp View File

@@ -1,5 +1,7 @@
#include "tcp_connector.h"
#include "asio_config.h"
// MUST BE FIRST TO COMPILE CORRECTLY UNDER CYGWIN
#include "tcp_messenger.h"
#include "tcp_connector.h"

namespace cppcms {



+ 2
- 19
tcp_messenger.h View File

@@ -1,29 +1,12 @@
#ifndef CPPCMS_TCP_MESSENGER_H
#define CPPCMS_TCP_MESSENGER_H

#include "config.h"
#ifdef __CYGWIN__
// Cygwin ASIO works only with win32 sockets
#define _WIN32_WINNT 1
#define __USE_W32_SOCKETS 1
#endif

#ifdef USE_BOOST_ASIO
#include <boost/asio.hpp>
namespace aio = boost::asio;
using boost::system::error_code;
using boost::system::system_error;
#else
#include <asio.hpp>
namespace aio = asio;
using asio::error_code;
using asio::system_error;
#endif
#include "asio_config.h"
// MUST BE FIRST

#include "tcp_cache_protocol.h"
#include "archive.h"

using aio::ip::tcp;

namespace cppcms {



Loading…
Cancel
Save