mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-20 16:16:17 +00:00
Added configure check for execinfo.h.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@259 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -35,6 +35,7 @@ AC_ARG_ENABLE(werror,
|
|||||||
|
|
||||||
AC_SEARCH_LIBS(wbkgdset, ncurses curses,,echo "*** The ncurses library is required!";exit 1)
|
AC_SEARCH_LIBS(wbkgdset, ncurses curses,,echo "*** The ncurses library is required!";exit 1)
|
||||||
|
|
||||||
|
TORRENT_CHECK_EXECINFO()
|
||||||
TORRENT_CHECK_CURL()
|
TORRENT_CHECK_CURL()
|
||||||
TORRENT_OTFD()
|
TORRENT_OTFD()
|
||||||
|
|
||||||
|
|||||||
@@ -114,3 +114,20 @@ AC_DEFUN([TORRENT_OTFD], [
|
|||||||
|
|
||||||
AC_LANG_POP(C++)
|
AC_LANG_POP(C++)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
AC_DEFUN([TORRENT_CHECK_EXECINFO], [
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for execinfo.h)
|
||||||
|
|
||||||
|
AC_COMPILE_IFELSE(
|
||||||
|
[[#include <execinfo.h>
|
||||||
|
int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
|
||||||
|
]],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(USE_EXECINFO, 1, Use execinfo.h)
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|||||||
+23
-22
@@ -12,25 +12,26 @@ public:
|
|||||||
m_window(newwin(height, width, y, x)) {}
|
m_window(newwin(height, width, y, x)) {}
|
||||||
~Canvas() { delwin(m_window); }
|
~Canvas() { delwin(m_window); }
|
||||||
|
|
||||||
void refresh() { wnoutrefresh(m_window); }
|
void refresh() { wnoutrefresh(m_window); }
|
||||||
void redraw() { redrawwin(m_window); }
|
static void refresh_std() { wnoutrefresh(stdscr); }
|
||||||
|
void redraw() { redrawwin(m_window); }
|
||||||
|
|
||||||
void resize(int w, int h) { wresize(m_window, h, w); }
|
void resize(int w, int h) { wresize(m_window, h, w); }
|
||||||
void resize(int x, int y, int w, int h);
|
void resize(int x, int y, int w, int h);
|
||||||
|
|
||||||
int get_x() { int x, y; getyx(m_window, y, x); return x; }
|
int get_x() { int x, y; getyx(m_window, y, x); return x; }
|
||||||
int get_y() { int x, y; getyx(m_window, y, x); return y; }
|
int get_y() { int x, y; getyx(m_window, y, x); return y; }
|
||||||
int get_width() { int x, y; getmaxyx(m_window, y, x); return x; }
|
int get_width() { int x, y; getmaxyx(m_window, y, x); return x; }
|
||||||
int get_height() { int x, y; getmaxyx(m_window, y, x); return y; }
|
int get_height() { int x, y; getmaxyx(m_window, y, x); return y; }
|
||||||
chtype get_background() { return getbkgd(m_window); }
|
chtype get_background() { return getbkgd(m_window); }
|
||||||
void set_background(chtype c) { return wbkgdset(m_window, c); }
|
void set_background(chtype c) { return wbkgdset(m_window, c); }
|
||||||
|
|
||||||
void erase() { werase(m_window); }
|
void erase() { werase(m_window); }
|
||||||
|
|
||||||
void print_border(chtype ls, chtype rs,
|
void print_border(chtype ls, chtype rs,
|
||||||
chtype ts, chtype bs,
|
chtype ts, chtype bs,
|
||||||
chtype tl, chtype tr,
|
chtype tl, chtype tr,
|
||||||
chtype bl, chtype br) { wborder(m_window, ls, rs, ts, bs, tl, tr, bl, br); }
|
chtype bl, chtype br) { wborder(m_window, ls, rs, ts, bs, tl, tr, bl, br); }
|
||||||
|
|
||||||
// Initialize stdscr.
|
// Initialize stdscr.
|
||||||
static void init();
|
static void init();
|
||||||
@@ -41,28 +42,28 @@ public:
|
|||||||
|
|
||||||
static void do_update() { doupdate(); }
|
static void do_update() { doupdate(); }
|
||||||
|
|
||||||
void print(int x, int y, const char* str) { mvwprintw(m_window, y, x, str); }
|
void print(int x, int y, const char* str) { mvwprintw(m_window, y, x, str); }
|
||||||
|
|
||||||
template <typename A1>
|
template <typename A1>
|
||||||
void print(int x, int y, const char* str, A1 a1) { mvwprintw(m_window, y, x, str, a1); }
|
void print(int x, int y, const char* str, A1 a1) { mvwprintw(m_window, y, x, str, a1); }
|
||||||
|
|
||||||
template <typename A1, typename A2>
|
template <typename A1, typename A2>
|
||||||
void print(int x, int y, const char* str, A1 a1, A2 a2) { mvwprintw(m_window, y, x, str, a1, a2); }
|
void print(int x, int y, const char* str, A1 a1, A2 a2) { mvwprintw(m_window, y, x, str, a1, a2); }
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3>
|
template <typename A1, typename A2, typename A3>
|
||||||
void print(int x, int y, const char* str,
|
void print(int x, int y, const char* str,
|
||||||
A1 a1, A2 a2, A3 a3) { mvwprintw(m_window, y, x, str, a1, a2, a3); }
|
A1 a1, A2 a2, A3 a3) { mvwprintw(m_window, y, x, str, a1, a2, a3); }
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4>
|
template <typename A1, typename A2, typename A3, typename A4>
|
||||||
void print(int x, int y, const char* str,
|
void print(int x, int y, const char* str,
|
||||||
A1 a1, A2 a2, A3 a3, A4 a4) { mvwprintw(m_window, y, x, str, a1, a2, a3, a4); }
|
A1 a1, A2 a2, A3 a3, A4 a4) { mvwprintw(m_window, y, x, str, a1, a2, a3, a4); }
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4, typename A5>
|
template <typename A1, typename A2, typename A3, typename A4, typename A5>
|
||||||
void print(int x, int y, const char* str,
|
void print(int x, int y, const char* str,
|
||||||
A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { mvwprintw(m_window, y, x, str, a1, a2, a3, a4, a5); }
|
A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { mvwprintw(m_window, y, x, str, a1, a2, a3, a4, a5); }
|
||||||
|
|
||||||
template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
|
template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
|
||||||
void print(int x, int y, const char* str,
|
void print(int x, int y, const char* str,
|
||||||
A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { mvwprintw(m_window, y, x, str, a1, a2, a3, a4, a5, a6); }
|
A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { mvwprintw(m_window, y, x, str, a1, a2, a3, a4, a5, a6); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ Manager::adjust_layout() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
Manager::do_update() {
|
Manager::do_update() {
|
||||||
wnoutrefresh(stdscr);
|
Canvas::refresh_std();
|
||||||
|
|
||||||
std::for_each(begin(), end(), std::mem_fun(&Window::redraw));
|
std::for_each(begin(), end(), std::mem_fun(&Window::redraw));
|
||||||
std::for_each(begin(), end(), std::mem_fun(&Window::refresh));
|
std::for_each(begin(), end(), std::mem_fun(&Window::refresh));
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
#include <torrent/torrent.h>
|
#include <torrent/torrent.h>
|
||||||
#include <sigc++/bind.h>
|
#include <sigc++/bind.h>
|
||||||
|
|
||||||
#define USE_EXECINFO
|
|
||||||
|
|
||||||
#ifdef USE_EXECINFO
|
#ifdef USE_EXECINFO
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user