From 5dc8c56b2dfbedfc5dd5f8b77ae31c62505cda9f Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 13 Sep 2020 16:12:57 +0200 Subject: [PATCH] [meson] Fixed bittorrent build --- meson.build | 2 +- src/dialogs/download.c | 16 ++++++++-------- src/protocol/meson.build | 2 +- src/util/meson.build | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index c80182bb..2e014508 100644 --- a/meson.build +++ b/meson.build @@ -24,7 +24,7 @@ conf_data.set('CONFIG_GLOBHIST', get_option('globhist')) conf_data.set('CONFIG_MAILCAP', get_option('mailcap')) conf_data.set('CONFIG_MIMETYPES', get_option('mimetypes')) conf_data.set('CONFIG_IPV6', get_option('ipv6')) -conf_data.set10('CONFIG_BITTORRENT', get_option('bittorrent')) +conf_data.set('CONFIG_BITTORRENT', get_option('bittorrent')) conf_data.set('CONFIG_DATA', get_option('data')) conf_data.set('CONFIG_URI_REWRITE', get_option('uri-rewrite')) diff --git a/src/dialogs/download.c b/src/dialogs/download.c index a2338cbd..38a53fc7 100644 --- a/src/dialogs/download.c +++ b/src/dialogs/download.c @@ -70,7 +70,7 @@ dlg_set_notify(struct dialog_data *dlg_data, struct widget_data *widget_data) if (!file_download->external_handler) file_download->term = dlg_data->win->term; -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT if (file_download->uri->protocol == PROTOCOL_BITTORRENT) set_bittorrent_notify_on_completion(&file_download->download, file_download->term); @@ -95,7 +95,7 @@ push_delete_button(struct dialog_data *dlg_data, struct widget_data *widget_data struct file_download *file_download = dlg_data->dlg->udata; file_download->delete_ = 1; -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT if (file_download->uri->protocol == PROTOCOL_BITTORRENT) set_bittorrent_files_for_deletion(&file_download->download); #endif @@ -139,7 +139,7 @@ download_dialog_layouter(struct dialog_data *dlg_data) unsigned char *msg = get_download_msg(download, term, 1, 1, "\n"); int show_meter = (download_is_progressing(download) && download->progress->size >= 0); -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT int bittorrent = (file_download->uri->protocol == PROTOCOL_BITTORRENT && (show_meter || is_in_state(download->state, S_RESUME))); #endif @@ -172,7 +172,7 @@ download_dialog_layouter(struct dialog_data *dlg_data) y++; if (show_meter) y += 2; -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT if (bittorrent) y += 2; #endif dlg_format_text_do(dlg_data, msg, 0, &y, w, &rw, @@ -208,7 +208,7 @@ download_dialog_layouter(struct dialog_data *dlg_data) y++; } -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT if (bittorrent) { y++; draw_bittorrent_piece_progress(download, term, x, y, w, NULL, NULL); @@ -238,7 +238,7 @@ display_download(struct terminal *term, struct file_download *file_download, if (!is_in_downloads_list(file_download)) return; -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT #define DOWNLOAD_WIDGETS_COUNT 5 #else #define DOWNLOAD_WIDGETS_COUNT 4 @@ -259,7 +259,7 @@ display_download(struct terminal *term, struct file_download *file_download, add_dlg_button(dlg, _("~Background", term), B_ENTER | B_ESC, dlg_undisplay_download, NULL); add_dlg_button(dlg, _("Background with ~notify", term), B_ENTER | B_ESC, dlg_set_notify, NULL); -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT if (file_download->uri->protocol == PROTOCOL_BITTORRENT) add_dlg_button(dlg, _("~Info", term), B_ENTER | B_ESC, dlg_show_bittorrent_info, NULL); #endif @@ -272,7 +272,7 @@ display_download(struct terminal *term, struct file_download *file_download, add_dlg_button(dlg, _("Abort and ~delete file", term), 0, push_delete_button, NULL); } -#if CONFIG_BITTORRENT +#ifdef CONFIG_BITTORRENT add_dlg_end(dlg, DOWNLOAD_WIDGETS_COUNT - !!file_download->external_handler - (file_download->uri->protocol != PROTOCOL_BITTORRENT)); #else diff --git a/src/protocol/meson.build b/src/protocol/meson.build index cf433bda..b83c51d4 100644 --- a/src/protocol/meson.build +++ b/src/protocol/meson.build @@ -1,4 +1,4 @@ -if conf_data.get('CONFIG_BITTORRENT') == 1 +if conf_data.get('CONFIG_BITTORRENT') subdir('bittorrent') endif if conf_data.get('CONFIG_FINGER') diff --git a/src/util/meson.build b/src/util/meson.build index ccd1c0d3..a270aa83 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -15,7 +15,7 @@ endif if conf_data.get('CONFIG_OWN_LIBC') or (not conf_data.get('CONFIG_GNUTLS_OPENSSL_COMPAT') and not conf_data.get('CONFIG_OPENSSL')) srcs += files('md5.c') endif -if conf_data.get('CONFIG_BITTORRENT') == 1 +if conf_data.get('CONFIG_BITTORRENT') if conf_data.get('CONFIG_OWN_LIBC') or not conf_data.get('CONFIG_OPENSSL') srcs += files('sha1.c') endif