Compile modules based on HAVE_* features
authorArkadiy Illarionov <qarkai@gmail.com>
Sun, 3 Mar 2024 12:39:51 +0000 (15:39 +0300)
committerColin Clark <colin.clark@cclark.uk>
Mon, 4 Mar 2024 12:59:00 +0000 (12:59 +0000)
41 files changed:
src/bar-gps.cc
src/bar.cc
src/exif.cc
src/exif.h
src/exiv2.cc
src/format-canon.cc
src/format-canon.h
src/format-fuji.cc
src/format-fuji.h
src/format-nikon.cc
src/format-nikon.h
src/format-olympus.cc
src/format-olympus.h
src/format-raw.cc
src/format-raw.h
src/glua.h
src/image-load-cr3.cc
src/image-load-cr3.h
src/image-load-djvu.cc
src/image-load-djvu.h
src/image-load-ffmpegthumbnailer.cc
src/image-load-ffmpegthumbnailer.h
src/image-load-heif.cc
src/image-load-heif.h
src/image-load-j2k.cc
src/image-load-j2k.h
src/image-load-jpeg.cc
src/image-load-jpeg.h
src/image-load-jpegxl.cc
src/image-load-jpegxl.h
src/image-load-pdf.cc
src/image-load-pdf.h
src/image-load-tiff.cc
src/image-load-tiff.h
src/image-load-webp.cc
src/image-load-webp.h
src/layout-util.cc
src/lua.cc
src/main-defines.h
src/meson.build
src/rcfile.cc

index 7a81939..f5e036f 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if HAVE_LIBCHAMPLAIN
-#if HAVE_LIBCHAMPLAIN_GTK
-
 #include "bar-gps.h"
 
 #include <cstring>
@@ -38,6 +33,8 @@
 #include <glib-object.h>
 #include <pango/pango.h>
 
+#include <config.h>
+
 #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: */
index bba0d9e..6c396b3 100644 (file)
@@ -188,8 +188,7 @@ static const gchar default_config_copyright[] =
 "    </layout>"
 "</gq>";
 
-#if HAVE_LIBCHAMPLAIN
-#if HAVE_LIBCHAMPLAIN_GTK
+#if HAVE_LIBCHAMPLAIN && HAVE_LIBCHAMPLAIN_GTK
 static const gchar default_config_gps[] =
 "<gq>"
 "    <layout id = '_current_'>"
@@ -203,7 +202,6 @@ static const gchar default_config_gps[] =
 "    </layout>"
 "</gq>";
 #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}
 };
index cf47622..1f84d5b 100644 (file)
  *     Add support for marker tag 0x0000
  */
 
-#include <config.h>
+#include "exif.h"
 
-#if !HAVE_EXIV2
-
-#include <cmath>
-#include <cstdio>
-#include <cstring>
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
+#include <cstdio>
+#include <cstring>
+
 #include <glib.h>
 #include <glib/gprintf.h>
 
-#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: */
index bbc02ec..a10f801 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef __EXIF_H
 #define __EXIF_H
 
+#include <glib.h>
+
 #include "typedefs.h"
 
 struct ExifData;
index 2aab782..e42f1af 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if HAVE_EXIV2
-
 #include "exif.h"
 
 #include <algorithm>
@@ -34,6 +30,8 @@
 #include <utility>
 #include <vector>
 
+#include <config.h>
+
 #include <exiv2/exiv2.hpp>
 #include <glib.h>
 #ifdef ENABLE_NLS
@@ -1131,5 +1129,4 @@ void exif_free_preview(const guchar *buf)
        delete[] static_cast<const Exiv2::byte*>(buf);
 }
 
-#endif /* HAVE_EXIV2 */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 52cd0be..d1ff9dc 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if !HAVE_EXIV2
-
 #include "format-canon.h"
 
-#include <cstdio>
 #include <cstring>
-#include <unistd.h>
 
 #include <glib.h>
 
@@ -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: */
index c65188a..a924777 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef __FORMAT_CANON_H
 #define __FORMAT_CANON_H
 
+#include <glib.h>
 
 #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 }
 
 
index d6a2495..5a63138 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if !HAVE_EXIV2
-
 #include "format-fuji.h"
 
-#include <cstdio>
 #include <cstring>
-#include <unistd.h>
 
 #include <glib.h>
 
@@ -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: */
index f4d0d3a..dfaf891 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef __FORMAT_FUJI_H
 #define __FORMAT_FUJI_H
 
+#include <glib.h>
 
 #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 }
 
 
index fbb81c3..7a0bf0a 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if !HAVE_EXIV2
-
 #include "format-nikon.h"
 
-#include <cstdio>
 #include <cstring>
-#include <unistd.h>
 
 #include <glib.h>
 
@@ -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: */
index ee152f3..d0b3bfc 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef __FORMAT_NIKON_H
 #define __FORMAT_NIKON_H
 
+#include <glib.h>
 
 #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,
index 00a2aac..a51e96d 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if !HAVE_EXIV2
-
 #include "format-olympus.h"
 
-#include <cstdio>
 #include <cstring>
-#include <unistd.h>
 
 #include <glib.h>
 
@@ -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: */
index 09fa11c..d793c6c 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef __FORMAT_OLYMPUS_H
 #define __FORMAT_OLYMPUS_H
 
+#include <glib.h>
 
 #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 }
 
 
index 8c6a7f2..920fa81 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if !HAVE_EXIV2
-
 #include "format-raw.h"
 
-#include <cstdio>
-#include <cstring>
 #include <sys/mman.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
+#include <cstdio>
+#include <cstring>
+
 #include <glib.h>
 
 #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: */
index b866b87..4e160b2 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef __FORMAT_RAW_H
 #define __FORMAT_RAW_H
 
+#include <glib.h>
+
 #include "exif-int.h"
 
 
index 4be0f06..137ea7b 100644 (file)
 #ifndef __GLUA_H
 #define __GLUA_H
 
-#include <config.h>
-
-#if HAVE_LUA
-
 #include <glib.h>
 
 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: */
index ba91fdd..926bff4 100644 (file)
@@ -21,9 +21,6 @@
 /** This is a Will Not Fix */
 #pragma GCC diagnostic ignored "-Wclobbered"
 
-#include <config.h>
-
-#if HAVE_JPEG && !HAVE_RAW
 #include "image-load-cr3.h"
 
 #include <cstring>
@@ -112,6 +109,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_cr3()
        return std::make_unique<ImageLoaderCr3>();
 }
 
-#endif // HAVE_JPEG && !HAVE_RAW
-
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 99d79a2..39f2f74 100644 (file)
 #ifndef IMAGE_LOAD_CR3_H
 #define IMAGE_LOAD_CR3_H
 
-#include <config.h>
-
-#if HAVE_JPEG && !HAVE_RAW
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> 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: */
index 99eb761..1b8c70d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 20019 - The Geeqie Team
+ * Copyright (C) 2019 - The Geeqie Team
  *
  * Author: Colin Clark
  *
 
 #include "image-load-djvu.h"
 
-#include <config.h>
-
-#if HAVE_DJVU
-
 #include <cairo.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <glib-object.h>
@@ -172,5 +168,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_djvu()
        return std::make_unique<ImageLoaderDJVU>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index ead0a78..6b0d7e1 100644 (file)
 #ifndef IMAGE_LOAD_DJVU_H
 #define IMAGE_LOAD_DJVU_H
 
-#include <config.h>
-
-#if HAVE_DJVU
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_djvu();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_DJVU_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index a1334dd..f9a9f62 100644 (file)
@@ -21,9 +21,6 @@
 
 #include "image-load-ffmpegthumbnailer.h"
 
-#include <config.h>
-
-#if HAVE_FFMPEGTHUMBNAILER
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <glib-object.h>
 #include <glib.h>
@@ -31,6 +28,8 @@
 #include <libffmpegthumbnailer/imagetypes.h>
 #include <libffmpegthumbnailer/videothumbnailerc.h> //TODO Use videothumbnailer.h?
 
+#include <config.h>
+
 #include "debug.h"
 #include "filedata.h"
 #include "image-load.h"
@@ -194,5 +193,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_ft()
        return std::make_unique<ImageLoaderFT>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 56ebe38..cb56b97 100644 (file)
 #ifndef IMAGE_LOAD_FT_H
 #define IMAGE_LOAD_FT_H
 
-#include <config.h>
-
-#if HAVE_FFMPEGTHUMBNAILER
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_ft();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_FT_H */
 
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 6c57a7a..aa882a1 100644 (file)
@@ -20,9 +20,6 @@
 
 #include "image-load-heif.h"
 
-#include <config.h>
-
-#if HAVE_HEIF
 #include <vector>
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
@@ -171,5 +168,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_heif()
        return std::make_unique<ImageLoaderHEIF>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 514b4c5..1c16003 100644 (file)
 #ifndef IMAGE_LOAD_HEIF_H
 #define IMAGE_LOAD_HEIF_H
 
-#include <config.h>
-
-#if HAVE_HEIF
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_heif();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_HEIF_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index dd19af9..02199c9 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if HAVE_J2K
-
 #include "image-load-j2k.h"
 
 #include <cstdlib>
@@ -339,5 +335,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_j2k()
        return std::make_unique<ImageLoaderJ2K>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index f0416b3..5d7d22d 100644 (file)
 #ifndef IMAGE_LOAD_J2K_H
 #define IMAGE_LOAD_J2K_H
 
-#include <config.h>
-
-#if HAVE_J2K
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_j2k();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_J2K_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 8573bc2..2514a16 100644 (file)
 /** This is a Will Not Fix */
 #pragma GCC diagnostic ignored "-Wclobbered"
 
-#include <config.h>
-
-#if HAVE_JPEG
-
 #include "image-load-jpeg.h"
 
 #include <csetjmp>
@@ -460,6 +456,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_jpeg()
        return std::make_unique<ImageLoaderJpeg>();
 }
 
-#endif
-
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 8bb5091..a4948ac 100644 (file)
@@ -22,9 +22,6 @@
 #ifndef IMAGE_LOAD_JPEG_H
 #define IMAGE_LOAD_JPEG_H
 
-#include <config.h>
-
-#if HAVE_JPEG
 #include <memory>
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
@@ -61,8 +58,7 @@ private:
 };
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_jpeg();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_JPEG_H */
 
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 8d4ed3b..a2b3e2f 100644 (file)
  *
  */
 
-#include <config.h>
-
-#if HAVE_JPEGXL
-
 #include "image-load-jpegxl.h"
 
 #include <cstdint>
@@ -236,5 +232,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_jpegxl()
        return std::make_unique<ImageLoaderJPEGXL>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 071725d..9cbe355 100644 (file)
 #ifndef IMAGE_LOAD_JPEGXL_H
 #define IMAGE_LOAD_JPEGXL_H
 
-#include <config.h>
-
-#if HAVE_JPEGXL
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_jpegxl();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_JPEGXL_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 263a368..a57566e 100644 (file)
@@ -18,9 +18,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if HAVE_PDF
 #include "image-load-pdf.h"
 
 #include <cairo.h>
@@ -164,5 +161,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_pdf()
        return std::make_unique<ImageLoaderPDF>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 052e5b2..de390d8 100644 (file)
 #ifndef IMAGE_LOAD_PDF_H
 #define IMAGE_LOAD_PDF_H
 
-#include <config.h>
-
-#if HAVE_PDF
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_pdf();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_PDF_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 263f01a..e85f46a 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if HAVE_TIFF
-
 #include "image-load-tiff.h"
 
 #include <cstddef>
@@ -406,5 +402,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_tiff()
        return std::make_unique<ImageLoaderTiff>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 2185e77..28a9b05 100644 (file)
 #ifndef IMAGE_LOAD_TIFF_H
 #define IMAGE_LOAD_TIFF_H
 
-#include <config.h>
-
-#if HAVE_TIFF
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_tiff();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_TIFF_H */
 
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 24a52d5..eaf3af6 100644 (file)
@@ -18,9 +18,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#if HAVE_WEBP
 #include "image-load-webp.h"
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
@@ -133,5 +130,4 @@ std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_webp()
        return std::make_unique<ImageLoaderWEBP>();
 }
 
-#endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index abc37d1..7603606 100644 (file)
 #ifndef IMAGE_LOAD_WEBP_H
 #define IMAGE_LOAD_WEBP_H
 
-#include <config.h>
-
-#if HAVE_WEBP
 #include <memory>
 
 struct ImageLoaderBackend;
 
 std::unique_ptr<ImageLoaderBackend> get_image_loader_backend_webp();
-#endif
 
-#endif
+#endif /* IMAGE_LOAD_WEBP_H */
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 754ae20..4b0ec52 100644 (file)
@@ -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<LayoutWindow *>(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<LayoutWindow *>(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()
 {
 }
index 51b6f39..ca6c053 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
-
-#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: */
index ca5d4e5..9245ace 100644 (file)
 // 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: */
index 799213b..67330e3 100644 (file)
@@ -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')
index 934094d..7b00c8a 100644 (file)
@@ -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)
                {