From e0b023ebd7ca6bc641dd3c2eee8b0e86cfe0f5e2 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sun, 3 Mar 2024 15:39:51 +0300 Subject: [PATCH] Compile modules based on HAVE_* features --- src/bar-gps.cc | 12 +-- src/bar.cc | 8 +- src/exif.cc | 23 ++--- src/exif.h | 2 + src/exiv2.cc | 7 +- src/format-canon.cc | 10 -- src/format-canon.h | 5 +- src/format-fuji.cc | 11 +-- src/format-fuji.h | 3 +- src/format-nikon.cc | 10 -- src/format-nikon.h | 7 +- src/format-olympus.cc | 10 -- src/format-olympus.h | 3 +- src/format-raw.cc | 15 +-- src/format-raw.h | 2 + src/glua.h | 7 +- src/image-load-cr3.cc | 5 - src/image-load-cr3.h | 6 +- src/image-load-djvu.cc | 7 +- src/image-load-djvu.h | 6 +- src/image-load-ffmpegthumbnailer.cc | 6 +- src/image-load-ffmpegthumbnailer.h | 6 +- src/image-load-heif.cc | 4 - src/image-load-heif.h | 6 +- src/image-load-j2k.cc | 5 - src/image-load-j2k.h | 6 +- src/image-load-jpeg.cc | 6 -- src/image-load-jpeg.h | 6 +- src/image-load-jpegxl.cc | 5 - src/image-load-jpegxl.h | 6 +- src/image-load-pdf.cc | 4 - src/image-load-pdf.h | 6 +- src/image-load-tiff.cc | 5 - src/image-load-tiff.h | 6 +- src/image-load-webp.cc | 4 - src/image-load-webp.h | 6 +- src/layout-util.cc | 20 ++-- src/lua.cc | 8 +- src/main-defines.h | 2 +- src/meson.build | 148 ++++++++++++++++++++-------- src/rcfile.cc | 4 +- 41 files changed, 169 insertions(+), 259 deletions(-) diff --git a/src/bar-gps.cc b/src/bar-gps.cc index 7a819395..f5e036f3 100644 --- a/src/bar-gps.cc +++ b/src/bar-gps.cc @@ -19,11 +19,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if HAVE_LIBCHAMPLAIN -#if HAVE_LIBCHAMPLAIN_GTK - #include "bar-gps.h" #include @@ -38,6 +33,8 @@ #include #include +#include + #include "bar.h" #include "compat.h" #include "debug.h" @@ -138,7 +135,7 @@ static void bar_pane_gps_close_save_cb(GenericDialog *, gpointer data) g_list_free(pgd->geocode_list); } - static void bar_pane_gps_dnd_receive(GtkWidget *pane, GdkDragContext *, +static void bar_pane_gps_dnd_receive(GtkWidget *pane, GdkDragContext *, gint x, gint y, GtkSelectionData *selection_data, guint info, guint, gpointer) @@ -1159,7 +1156,4 @@ void bar_pane_gps_update_from_config(GtkWidget *pane, const gchar **attribute_na bar_update_expander(pane); } -#endif // HAVE_LIBCHAMPLAIN_GTK -#endif // HAVE_LIBCHAMPLAIN - /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/bar.cc b/src/bar.cc index bba0d9e3..6c396b3b 100644 --- a/src/bar.cc +++ b/src/bar.cc @@ -188,8 +188,7 @@ static const gchar default_config_copyright[] = " " ""; -#if HAVE_LIBCHAMPLAIN -#if HAVE_LIBCHAMPLAIN_GTK +#if HAVE_LIBCHAMPLAIN && HAVE_LIBCHAMPLAIN_GTK static const gchar default_config_gps[] = "" " " @@ -203,7 +202,6 @@ static const gchar default_config_gps[] = " " ""; #endif -#endif static const KnownPanes known_panes[] = { /* default sidebar */ @@ -218,10 +216,8 @@ static const KnownPanes known_panes[] = { {PANE_EXIF, "file_info", N_("File info"), default_config_file_info}, {PANE_EXIF, "location", N_("Location and GPS"), default_config_location}, {PANE_EXIF, "copyright", N_("Copyright"), default_config_copyright}, -#if HAVE_LIBCHAMPLAIN -#if HAVE_LIBCHAMPLAIN_GTK +#if HAVE_LIBCHAMPLAIN && HAVE_LIBCHAMPLAIN_GTK {PANE_GPS, "gps", N_("GPS Map"), default_config_gps}, -#endif #endif {PANE_UNDEF, nullptr, nullptr, nullptr} }; diff --git a/src/exif.cc b/src/exif.cc index cf476225..1f84d5be 100644 --- a/src/exif.cc +++ b/src/exif.cc @@ -45,30 +45,28 @@ * Add support for marker tag 0x0000 */ -#include +#include "exif.h" -#if !HAVE_EXIV2 - -#include -#include -#include #include #include #include -#include #include +#include +#include + #include #include -#include "exif-int.h" -#include "jpeg-parser.h" - #include "debug.h" +#include "exif-int.h" #include "format-raw.h" #include "intl.h" +#include "jpeg-parser.h" +#include "typedefs.h" #include "ui-fileops.h" +struct FileData; /* *----------------------------------------------------------------------------- @@ -1694,8 +1692,5 @@ void exif_free_preview(const guchar *buf) void exif_init() { } -#else -using dummy_variable = int; -#endif -/* not HAVE_EXIV2 */ + /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/exif.h b/src/exif.h index bbc02ec0..a10f8011 100644 --- a/src/exif.h +++ b/src/exif.h @@ -22,6 +22,8 @@ #ifndef __EXIF_H #define __EXIF_H +#include + #include "typedefs.h" struct ExifData; diff --git a/src/exiv2.cc b/src/exiv2.cc index 2aab7823..e42f1af8 100644 --- a/src/exiv2.cc +++ b/src/exiv2.cc @@ -18,10 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if HAVE_EXIV2 - #include "exif.h" #include @@ -34,6 +30,8 @@ #include #include +#include + #include #include #ifdef ENABLE_NLS @@ -1131,5 +1129,4 @@ void exif_free_preview(const guchar *buf) delete[] static_cast(buf); } -#endif /* HAVE_EXIV2 */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/format-canon.cc b/src/format-canon.cc index 52cd0be6..d1ff9dcc 100644 --- a/src/format-canon.cc +++ b/src/format-canon.cc @@ -19,15 +19,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if !HAVE_EXIV2 - #include "format-canon.h" -#include #include -#include #include @@ -524,8 +518,4 @@ gboolean format_canon_makernote(ExifData *exif, guchar *tiff, guint offset, return TRUE; } -#else -using dummy_variable = int; -#endif -/* not HAVE_EXIV2 */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/format-canon.h b/src/format-canon.h index c65188a5..a924777a 100644 --- a/src/format-canon.h +++ b/src/format-canon.h @@ -22,6 +22,7 @@ #ifndef __FORMAT_CANON_H #define __FORMAT_CANON_H +#include #include "exif-int.h" @@ -34,11 +35,11 @@ gboolean format_canon_raw_cr2(guchar *data, guint len, #define FORMAT_RAW_CANON { "crw", \ FORMAT_RAW_MATCH_MAGIC, 6, "HEAPCCDR", 8, \ - FORMAT_RAW_EXIF_NONE, NULL, \ + FORMAT_RAW_EXIF_NONE, nullptr, \ "Canon crw", format_canon_raw_crw }, \ { "cr2", \ FORMAT_RAW_MATCH_TIFF_MAKE, 0, "Canon", 5, \ - FORMAT_RAW_EXIF_TIFF, NULL, \ + FORMAT_RAW_EXIF_TIFF, nullptr, \ "Canon cr2", format_canon_raw_cr2 } diff --git a/src/format-fuji.cc b/src/format-fuji.cc index d6a2495b..5a63138b 100644 --- a/src/format-fuji.cc +++ b/src/format-fuji.cc @@ -20,15 +20,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if !HAVE_EXIV2 - #include "format-fuji.h" -#include #include -#include #include @@ -197,8 +191,5 @@ gboolean format_fuji_makernote(ExifData *exif, guchar *tiff, guint offset, return TRUE; } -#else -using dummy_variable = int; -#endif -/* not HAVE_EXIV2 */ + /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/format-fuji.h b/src/format-fuji.h index f4d0d3ad..dfaf8916 100644 --- a/src/format-fuji.h +++ b/src/format-fuji.h @@ -23,6 +23,7 @@ #ifndef __FORMAT_FUJI_H #define __FORMAT_FUJI_H +#include #include "exif-int.h" @@ -33,7 +34,7 @@ gboolean format_fuji_raw(guchar *data, guint len, #define FORMAT_RAW_FUJI { "raf", \ FORMAT_RAW_MATCH_MAGIC, 0, "FUJIFILM", 8, \ - FORMAT_RAW_EXIF_JPEG, NULL, \ + FORMAT_RAW_EXIF_JPEG, nullptr, \ "Fuji raw", format_fuji_raw } diff --git a/src/format-nikon.cc b/src/format-nikon.cc index fbb81c30..7a0bf0ae 100644 --- a/src/format-nikon.cc +++ b/src/format-nikon.cc @@ -19,15 +19,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if !HAVE_EXIV2 - #include "format-nikon.h" -#include #include -#include #include @@ -428,8 +422,4 @@ gboolean format_nikon_makernote(ExifData *exif, guchar *tiff, guint offset, return TRUE; } -#else -using dummy_variable = int; -#endif -/* not HAVE_EXIV2 */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/format-nikon.h b/src/format-nikon.h index ee152f32..d0b3bfc7 100644 --- a/src/format-nikon.h +++ b/src/format-nikon.h @@ -20,6 +20,7 @@ #ifndef __FORMAT_NIKON_H #define __FORMAT_NIKON_H +#include #include "exif-int.h" @@ -28,7 +29,7 @@ gboolean format_nikon_raw(guchar *data, guint len, #define FORMAT_RAW_NIKON { "nef", \ FORMAT_RAW_MATCH_TIFF_MAKE, 0, "NIKON CORPORATION", 17, \ - FORMAT_RAW_EXIF_TIFF, NULL, \ + FORMAT_RAW_EXIF_TIFF, nullptr, \ "Nikon raw", format_nikon_raw } /* If your format is basically just TIFF with an embedded jpeg, @@ -36,12 +37,12 @@ gboolean format_nikon_raw(guchar *data, guint len, */ #define FORMAT_RAW_PENTAX { "pef", \ FORMAT_RAW_MATCH_TIFF_MAKE, 0, "PENTAX Corporation", 18, \ - FORMAT_RAW_EXIF_TIFF, NULL, \ + FORMAT_RAW_EXIF_TIFF, nullptr, \ "Pentax raw", format_nikon_raw } #define FORMAT_RAW_SAMSUNG { "pef", \ FORMAT_RAW_MATCH_TIFF_MAKE, 0, "SAMSUNG TECHWIN", 15, \ - FORMAT_RAW_EXIF_TIFF, NULL, \ + FORMAT_RAW_EXIF_TIFF, nullptr, \ "Samsung raw", format_nikon_raw } gboolean format_nikon_makernote(ExifData *exif, guchar *tiff, guint offset, diff --git a/src/format-olympus.cc b/src/format-olympus.cc index 00a2aac0..a51e96d8 100644 --- a/src/format-olympus.cc +++ b/src/format-olympus.cc @@ -17,15 +17,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if !HAVE_EXIV2 - #include "format-olympus.h" -#include #include -#include #include @@ -376,8 +370,4 @@ gboolean format_olympus_makernote(ExifData *exif, guchar *tiff, guint offset, return TRUE; } -#else -using dummy_variable = int; -#endif -/* not HAVE_EXIV2 */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/format-olympus.h b/src/format-olympus.h index 09fa11cd..d793c6c9 100644 --- a/src/format-olympus.h +++ b/src/format-olympus.h @@ -20,6 +20,7 @@ #ifndef __FORMAT_OLYMPUS_H #define __FORMAT_OLYMPUS_H +#include #include "exif-int.h" @@ -30,7 +31,7 @@ gboolean format_olympus_raw(guchar *data, guint len, #define FORMAT_RAW_OLYMPUS { "orf", \ FORMAT_RAW_MATCH_MAGIC, 0, "IIR", 3, \ - FORMAT_RAW_EXIF_IFD_II, NULL, \ + FORMAT_RAW_EXIF_IFD_II, nullptr, \ "Olympus raw", format_olympus_raw } diff --git a/src/format-raw.cc b/src/format-raw.cc index 8c6a7f2b..920fa815 100644 --- a/src/format-raw.cc +++ b/src/format-raw.cc @@ -19,22 +19,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if !HAVE_EXIV2 - #include "format-raw.h" -#include -#include #include #include -#include #include +#include +#include + #include #include "debug.h" +#include "exif.h" #include "format-canon.h" #include "format-fuji.h" #include "format-nikon.h" @@ -564,8 +561,4 @@ gboolean format_debug_tiff_raw(guchar *data, const guint len, return FALSE; } #endif -#else -using dummy_variable = int; -#endif -/* not HAVE_EXIV2 */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/format-raw.h b/src/format-raw.h index b866b876..4e160b2e 100644 --- a/src/format-raw.h +++ b/src/format-raw.h @@ -22,6 +22,8 @@ #ifndef __FORMAT_RAW_H #define __FORMAT_RAW_H +#include + #include "exif-int.h" diff --git a/src/glua.h b/src/glua.h index 4be0f06a..137ea7b4 100644 --- a/src/glua.h +++ b/src/glua.h @@ -21,10 +21,6 @@ #ifndef __GLUA_H #define __GLUA_H -#include - -#if HAVE_LUA - #include struct FileData; @@ -33,6 +29,5 @@ void lua_init(); gchar *lua_callvalue(FileData *fd, const gchar *file, const gchar *function); -#endif -#endif +#endif /* __GLUA_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-cr3.cc b/src/image-load-cr3.cc index ba91fdd8..926bff4a 100644 --- a/src/image-load-cr3.cc +++ b/src/image-load-cr3.cc @@ -21,9 +21,6 @@ /** This is a Will Not Fix */ #pragma GCC diagnostic ignored "-Wclobbered" -#include - -#if HAVE_JPEG && !HAVE_RAW #include "image-load-cr3.h" #include @@ -112,6 +109,4 @@ std::unique_ptr get_image_loader_backend_cr3() return std::make_unique(); } -#endif // HAVE_JPEG && !HAVE_RAW - /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-cr3.h b/src/image-load-cr3.h index 99d79a2d..39f2f742 100644 --- a/src/image-load-cr3.h +++ b/src/image-load-cr3.h @@ -21,16 +21,12 @@ #ifndef IMAGE_LOAD_CR3_H #define IMAGE_LOAD_CR3_H -#include - -#if HAVE_JPEG && !HAVE_RAW #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_cr3(); -#endif -#endif // IMAGE_LOAD_CR3_H +#endif /* IMAGE_LOAD_CR3_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-djvu.cc b/src/image-load-djvu.cc index 99eb7617..1b8c70da 100644 --- a/src/image-load-djvu.cc +++ b/src/image-load-djvu.cc @@ -1,5 +1,5 @@ /* - * Copyright (C) 20019 - The Geeqie Team + * Copyright (C) 2019 - The Geeqie Team * * Author: Colin Clark * @@ -20,10 +20,6 @@ #include "image-load-djvu.h" -#include - -#if HAVE_DJVU - #include #include #include @@ -172,5 +168,4 @@ std::unique_ptr get_image_loader_backend_djvu() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-djvu.h b/src/image-load-djvu.h index ead0a783..6b0d7e15 100644 --- a/src/image-load-djvu.h +++ b/src/image-load-djvu.h @@ -21,15 +21,11 @@ #ifndef IMAGE_LOAD_DJVU_H #define IMAGE_LOAD_DJVU_H -#include - -#if HAVE_DJVU #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_djvu(); -#endif -#endif +#endif /* IMAGE_LOAD_DJVU_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-ffmpegthumbnailer.cc b/src/image-load-ffmpegthumbnailer.cc index a1334dd3..f9a9f62c 100644 --- a/src/image-load-ffmpegthumbnailer.cc +++ b/src/image-load-ffmpegthumbnailer.cc @@ -21,9 +21,6 @@ #include "image-load-ffmpegthumbnailer.h" -#include - -#if HAVE_FFMPEGTHUMBNAILER #include #include #include @@ -31,6 +28,8 @@ #include #include //TODO Use videothumbnailer.h? +#include + #include "debug.h" #include "filedata.h" #include "image-load.h" @@ -194,5 +193,4 @@ std::unique_ptr get_image_loader_backend_ft() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-ffmpegthumbnailer.h b/src/image-load-ffmpegthumbnailer.h index 56ebe38b..cb56b97f 100644 --- a/src/image-load-ffmpegthumbnailer.h +++ b/src/image-load-ffmpegthumbnailer.h @@ -22,16 +22,12 @@ #ifndef IMAGE_LOAD_FT_H #define IMAGE_LOAD_FT_H -#include - -#if HAVE_FFMPEGTHUMBNAILER #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_ft(); -#endif -#endif +#endif /* IMAGE_LOAD_FT_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-heif.cc b/src/image-load-heif.cc index 6c57a7a2..aa882a10 100644 --- a/src/image-load-heif.cc +++ b/src/image-load-heif.cc @@ -20,9 +20,6 @@ #include "image-load-heif.h" -#include - -#if HAVE_HEIF #include #include @@ -171,5 +168,4 @@ std::unique_ptr get_image_loader_backend_heif() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-heif.h b/src/image-load-heif.h index 514b4c5a..1c160037 100644 --- a/src/image-load-heif.h +++ b/src/image-load-heif.h @@ -21,15 +21,11 @@ #ifndef IMAGE_LOAD_HEIF_H #define IMAGE_LOAD_HEIF_H -#include - -#if HAVE_HEIF #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_heif(); -#endif -#endif +#endif /* IMAGE_LOAD_HEIF_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-j2k.cc b/src/image-load-j2k.cc index dd19af92..02199c9d 100644 --- a/src/image-load-j2k.cc +++ b/src/image-load-j2k.cc @@ -18,10 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if HAVE_J2K - #include "image-load-j2k.h" #include @@ -339,5 +335,4 @@ std::unique_ptr get_image_loader_backend_j2k() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-j2k.h b/src/image-load-j2k.h index f0416b37..5d7d22db 100644 --- a/src/image-load-j2k.h +++ b/src/image-load-j2k.h @@ -21,15 +21,11 @@ #ifndef IMAGE_LOAD_J2K_H #define IMAGE_LOAD_J2K_H -#include - -#if HAVE_J2K #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_j2k(); -#endif -#endif +#endif /* IMAGE_LOAD_J2K_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-jpeg.cc b/src/image-load-jpeg.cc index 8573bc22..2514a167 100644 --- a/src/image-load-jpeg.cc +++ b/src/image-load-jpeg.cc @@ -27,10 +27,6 @@ /** This is a Will Not Fix */ #pragma GCC diagnostic ignored "-Wclobbered" -#include - -#if HAVE_JPEG - #include "image-load-jpeg.h" #include @@ -460,6 +456,4 @@ std::unique_ptr get_image_loader_backend_jpeg() return std::make_unique(); } -#endif - /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-jpeg.h b/src/image-load-jpeg.h index 8bb5091c..a4948ac7 100644 --- a/src/image-load-jpeg.h +++ b/src/image-load-jpeg.h @@ -22,9 +22,6 @@ #ifndef IMAGE_LOAD_JPEG_H #define IMAGE_LOAD_JPEG_H -#include - -#if HAVE_JPEG #include #include @@ -61,8 +58,7 @@ private: }; std::unique_ptr get_image_loader_backend_jpeg(); -#endif -#endif +#endif /* IMAGE_LOAD_JPEG_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-jpegxl.cc b/src/image-load-jpegxl.cc index 8d4ed3b0..a2b3e2fc 100644 --- a/src/image-load-jpegxl.cc +++ b/src/image-load-jpegxl.cc @@ -50,10 +50,6 @@ * */ -#include - -#if HAVE_JPEGXL - #include "image-load-jpegxl.h" #include @@ -236,5 +232,4 @@ std::unique_ptr get_image_loader_backend_jpegxl() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-jpegxl.h b/src/image-load-jpegxl.h index 071725d4..9cbe3556 100644 --- a/src/image-load-jpegxl.h +++ b/src/image-load-jpegxl.h @@ -21,15 +21,11 @@ #ifndef IMAGE_LOAD_JPEGXL_H #define IMAGE_LOAD_JPEGXL_H -#include - -#if HAVE_JPEGXL #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_jpegxl(); -#endif -#endif +#endif /* IMAGE_LOAD_JPEGXL_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-pdf.cc b/src/image-load-pdf.cc index 263a368a..a57566ed 100644 --- a/src/image-load-pdf.cc +++ b/src/image-load-pdf.cc @@ -18,9 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if HAVE_PDF #include "image-load-pdf.h" #include @@ -164,5 +161,4 @@ std::unique_ptr get_image_loader_backend_pdf() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-pdf.h b/src/image-load-pdf.h index 052e5b27..de390d8b 100644 --- a/src/image-load-pdf.h +++ b/src/image-load-pdf.h @@ -21,15 +21,11 @@ #ifndef IMAGE_LOAD_PDF_H #define IMAGE_LOAD_PDF_H -#include - -#if HAVE_PDF #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_pdf(); -#endif -#endif +#endif /* IMAGE_LOAD_PDF_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-tiff.cc b/src/image-load-tiff.cc index 263f01a0..e85f46aa 100644 --- a/src/image-load-tiff.cc +++ b/src/image-load-tiff.cc @@ -25,10 +25,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if HAVE_TIFF - #include "image-load-tiff.h" #include @@ -406,5 +402,4 @@ std::unique_ptr get_image_loader_backend_tiff() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-tiff.h b/src/image-load-tiff.h index 2185e77d..28a9b056 100644 --- a/src/image-load-tiff.h +++ b/src/image-load-tiff.h @@ -22,16 +22,12 @@ #ifndef IMAGE_LOAD_TIFF_H #define IMAGE_LOAD_TIFF_H -#include - -#if HAVE_TIFF #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_tiff(); -#endif -#endif +#endif /* IMAGE_LOAD_TIFF_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-webp.cc b/src/image-load-webp.cc index 24a52d50..eaf3af60 100644 --- a/src/image-load-webp.cc +++ b/src/image-load-webp.cc @@ -18,9 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if HAVE_WEBP #include "image-load-webp.h" #include @@ -133,5 +130,4 @@ std::unique_ptr get_image_loader_backend_webp() return std::make_unique(); } -#endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/image-load-webp.h b/src/image-load-webp.h index abc37d13..76036069 100644 --- a/src/image-load-webp.h +++ b/src/image-load-webp.h @@ -21,15 +21,11 @@ #ifndef IMAGE_LOAD_WEBP_H #define IMAGE_LOAD_WEBP_H -#include - -#if HAVE_WEBP #include struct ImageLoaderBackend; std::unique_ptr get_image_loader_backend_webp(); -#endif -#endif +#endif /* IMAGE_LOAD_WEBP_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/layout-util.cc b/src/layout-util.cc index 754ae203..4b0ec524 100644 --- a/src/layout-util.cc +++ b/src/layout-util.cc @@ -1942,13 +1942,7 @@ static void layout_color_menu_enable_cb(GtkToggleAction *action, gpointer data) layout_util_sync_color(lw); layout_image_refresh(lw); } -#else -static void layout_color_menu_enable_cb() -{ -} -#endif -#if HAVE_LCMS static void layout_color_menu_use_image_cb(GtkToggleAction *action, gpointer data) { auto lw = static_cast(data); @@ -1961,13 +1955,7 @@ static void layout_color_menu_use_image_cb(GtkToggleAction *action, gpointer dat layout_util_sync_color(lw); layout_image_refresh(lw); } -#else -static void layout_color_menu_use_image_cb() -{ -} -#endif -#if HAVE_LCMS static void layout_color_menu_input_cb(GtkRadioAction *action, GtkRadioAction *, gpointer data) { auto lw = static_cast(data); @@ -1985,6 +1973,14 @@ static void layout_color_menu_input_cb(GtkRadioAction *action, GtkRadioAction *, layout_image_refresh(lw); } #else +static void layout_color_menu_enable_cb() +{ +} + +static void layout_color_menu_use_image_cb() +{ +} + static void layout_color_menu_input_cb() { } diff --git a/src/lua.cc b/src/lua.cc index 51b6f39b..ca6c053c 100644 --- a/src/lua.cc +++ b/src/lua.cc @@ -18,10 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include - -#if HAVE_LUA - #define _XOPEN_SOURCE #include "glua.h" @@ -413,7 +409,5 @@ gchar *lua_callvalue(FileData *fd, const gchar *file, const gchar *function) g_free(tmp); return data; } -#else -using dummy_variable = int; -#endif + /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/main-defines.h b/src/main-defines.h index ca5d4e58..9245aced 100644 --- a/src/main-defines.h +++ b/src/main-defines.h @@ -176,5 +176,5 @@ // PIXBUF_INLINE_ICON_ZOOMFILLHOR // PIXBUF_INLINE_ICON_ZOOMFILLVERT -#endif // _MAIN_DEFINES_H +#endif /* _MAIN_DEFINES_H */ /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/meson.build b/src/meson.build index 799213bf..67330e30 100644 --- a/src/meson.build +++ b/src/meson.build @@ -21,8 +21,6 @@ main_sources = files('advanced-exif.cc', 'bar-comment.h', 'bar-exif.cc', 'bar-exif.h', -'bar-gps.cc', -'bar-gps.h', 'bar-histogram.cc', 'bar-histogram.h', 'bar-keywords.cc', @@ -40,9 +38,9 @@ main_sources = files('advanced-exif.cc', 'cellrenderericon.cc', 'cellrenderericon.h', 'collect.cc', +'collect.h', 'collect-dlg.cc', 'collect-dlg.h', -'collect.h', 'collect-io.cc', 'collect-io.h', 'collect-table.cc', @@ -61,30 +59,16 @@ main_sources = files('advanced-exif.cc', 'dupe.h', 'editors.cc', 'editors.h', -'exif.cc', 'exif-common.cc', 'exif.h', -'exif-int.h', -'exiv2.cc', 'filecache.cc', 'filecache.h', 'filedata.cc', 'filedata.h', 'filefilter.cc', 'filefilter.h', -'format-canon.cc', -'format-canon.h', -'format-fuji.cc', -'format-fuji.h', -'format-nikon.cc', -'format-nikon.h', -'format-olympus.cc', -'format-olympus.h', -'format-raw.cc', -'format-raw.h', 'fullscreen.cc', 'fullscreen.h', -'glua.h', 'histogram.cc', 'histogram.h', 'history-list.cc', @@ -92,41 +76,21 @@ main_sources = files('advanced-exif.cc', 'image.cc', 'image.h', 'image-load.cc', +'image-load.h', 'image-load-collection.cc', 'image-load-collection.h', -'image-load-cr3.cc', -'image-load-cr3.h', 'image-load-dds.cc', 'image-load-dds.h', -'image-load-djvu.cc', -'image-load-djvu.h', 'image-load-external.cc', 'image-load-external.h', -'image-load-ffmpegthumbnailer.cc', -'image-load-ffmpegthumbnailer.h', 'image-load-gdk.cc', 'image-load-gdk.h', -'image-load.h', -'image-load-heif.cc', -'image-load-heif.h', -'image-load-j2k.cc', -'image-load-j2k.h', -'image-load-jpeg.cc', -'image-load-jpeg.h', -'image-load-jpegxl.cc', -'image-load-jpegxl.h', 'image-load-libraw.cc', 'image-load-libraw.h', -'image-load-pdf.cc', -'image-load-pdf.h', 'image-load-psd.cc', 'image-load-psd.h', 'image-load-svgz.cc', 'image-load-svgz.h', -'image-load-tiff.cc', -'image-load-tiff.h', -'image-load-webp.cc', -'image-load-webp.h', 'image-load-zxscr.cc', 'image-load-zxscr.h', 'image-overlay.cc', @@ -139,16 +103,15 @@ main_sources = files('advanced-exif.cc', 'keymap-template.cc', 'keymap-template.h', 'layout.cc', +'layout.h', 'layout-config.cc', 'layout-config.h', -'layout.h', 'layout-image.cc', 'layout-image.h', 'layout-util.cc', 'layout-util.h', 'logwindow.cc', 'logwindow.h', -'lua.cc', 'main.cc', 'main.h', 'main-defines.h', @@ -232,6 +195,111 @@ main_sources = files('advanced-exif.cc', 'window.cc', 'window.h') +if conf_data.get('HAVE_DJVU', 0) == 1 + main_sources += files( + 'image-load-djvu.cc', + 'image-load-djvu.h', + ) +endif + +if conf_data.get('HAVE_EXIV2', 0) == 1 + main_sources += files( + 'exiv2.cc', + ) +else + main_sources += files( + 'exif.cc', + 'exif-int.h', + 'format-canon.cc', + 'format-canon.h', + 'format-fuji.cc', + 'format-fuji.h', + 'format-nikon.cc', + 'format-nikon.h', + 'format-olympus.cc', + 'format-olympus.h', + 'format-raw.cc', + 'format-raw.h', + ) +endif + +if conf_data.get('HAVE_FFMPEGTHUMBNAILER', 0) == 1 + main_sources += files( + 'image-load-ffmpegthumbnailer.cc', + 'image-load-ffmpegthumbnailer.h', + ) +endif + +if conf_data.get('HAVE_HEIF', 0) == 1 + main_sources += files( + 'image-load-heif.cc', + 'image-load-heif.h', + ) +endif + +if conf_data.get('HAVE_J2K', 0) == 1 + main_sources += files( + 'image-load-j2k.cc', + 'image-load-j2k.h', + ) +endif + +if conf_data.get('HAVE_JPEG', 0) == 1 + main_sources += files( + 'image-load-jpeg.cc', + 'image-load-jpeg.h', + ) + + if conf_data.get('HAVE_RAW', 0) == 0 + main_sources += files( + 'image-load-cr3.cc', + 'image-load-cr3.h', + ) + endif +endif + +if conf_data.get('HAVE_JPEGXL', 0) == 1 + main_sources += files( + 'image-load-jpegxl.cc', + 'image-load-jpegxl.h', + ) +endif + +if conf_data.get('HAVE_LIBCHAMPLAIN', 0) == 1 and conf_data.get('HAVE_LIBCHAMPLAIN_GTK', 0) == 1 + main_sources += files( + 'bar-gps.cc', + 'bar-gps.h', + ) +endif + +if conf_data.get('HAVE_LUA', 0) == 1 + main_sources += files( + 'glua.h', + 'lua.cc', + ) +endif + +if conf_data.get('HAVE_PDF', 0) == 1 + main_sources += files( + 'image-load-pdf.cc', + 'image-load-pdf.h', + ) +endif + +if conf_data.get('HAVE_TIFF', 0) == 1 + main_sources += files( + 'image-load-tiff.cc', + 'image-load-tiff.h', + ) +endif + +if conf_data.get('HAVE_WEBP', 0) == 1 + main_sources += files( + 'image-load-webp.cc', + 'image-load-webp.h', + ) +endif + project_sources += main_sources subdir('authors') diff --git a/src/rcfile.cc b/src/rcfile.cc index 934094d0..7b00c8a2 100644 --- a/src/rcfile.cc +++ b/src/rcfile.cc @@ -1469,8 +1469,7 @@ static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *, } options_parse_func_push(parser_data, options_parse_leaf, nullptr, nullptr); } -#if HAVE_LIBCHAMPLAIN -#if HAVE_LIBCHAMPLAIN_GTK +#if HAVE_LIBCHAMPLAIN && HAVE_LIBCHAMPLAIN_GTK else if (g_ascii_strcasecmp(element_name, "pane_gps") == 0) { /* Use this flag to determine if --disable-clutter has been issued */ @@ -1489,7 +1488,6 @@ static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *, options_parse_func_push(parser_data, options_parse_leaf, nullptr, nullptr); } } -#endif #endif else if (g_ascii_strcasecmp(element_name, "pane_exif") == 0) { -- 2.20.1