~ubuntu-branches/ubuntu/intrepid/miro/intrepid

« back to all changes in this revision

Viewing changes to portable/libtorrent/include/libtorrent/asio/detail/signal_init.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2008-02-09 13:37:10 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080209133710-9rs90q6gckvp1b6i
Tags: 1.1.2-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// signal_init.hpp
 
3
// ~~~~~~~~~~~~~~~
 
4
//
 
5
// Copyright (c) 2003-2007 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
6
//
 
7
// Distributed under the Boost Software License, Version 1.0. (See accompanying
 
8
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
9
//
 
10
 
 
11
#ifndef ASIO_DETAIL_SIGNAL_INIT_HPP
 
12
#define ASIO_DETAIL_SIGNAL_INIT_HPP
 
13
 
 
14
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
 
15
# pragma once
 
16
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
17
 
 
18
#include "asio/detail/push_options.hpp"
 
19
 
 
20
#include "asio/detail/push_options.hpp"
 
21
#include <boost/config.hpp>
 
22
#include "asio/detail/pop_options.hpp"
 
23
 
 
24
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
 
25
 
 
26
#include "asio/detail/push_options.hpp"
 
27
#include <csignal>
 
28
#include "asio/detail/pop_options.hpp"
 
29
 
 
30
namespace asio {
 
31
namespace detail {
 
32
 
 
33
template <int Signal = SIGPIPE>
 
34
class signal_init
 
35
{
 
36
public:
 
37
  // Constructor.
 
38
  signal_init()
 
39
  {
 
40
    std::signal(Signal, SIG_IGN);
 
41
  }
 
42
};
 
43
 
 
44
} // namespace detail
 
45
} // namespace asio
 
46
 
 
47
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
 
48
 
 
49
#include "asio/detail/pop_options.hpp"
 
50
 
 
51
#endif // ASIO_DETAIL_SIGNAL_INIT_HPP