merge autoreload_{inotify,nop}.c into autoreload.c (#263)

This commit is contained in:
explosion-mental 2022-04-26 20:43:27 -05:00 committed by GitHub
parent 29c6b1456e
commit f9662efb1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 45 deletions

View File

@ -32,7 +32,7 @@ inc_fonts_1 = -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2
CPPFLAGS = -D_XOPEN_SOURCE=700 \
-DHAVE_LIBGIF=$(HAVE_LIBGIF) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) \
-DHAVE_LIBWEBP=$(HAVE_LIBWEBP) -DHAVE_LIBFONTS=$(HAVE_LIBFONTS) \
$(inc_fonts_$(HAVE_LIBFONTS))
-DHAVE_INOTIFY=$(HAVE_INOTIFY) $(inc_fonts_$(HAVE_LIBFONTS))
lib_fonts_0 =
lib_fonts_1 = -lXft -lfontconfig
@ -42,14 +42,12 @@ lib_gif_0 =
lib_gif_1 = -lgif
lib_webp_0 =
lib_webp_1 = -lwebpdemux -lwebp
autoreload_0 = nop
autoreload_1 = inotify
NSXIV_LDLIBS = -lImlib2 -lX11 \
$(lib_exif_$(HAVE_LIBEXIF)) $(lib_gif_$(HAVE_LIBGIF)) \
$(lib_webp_$(HAVE_LIBWEBP)) $(lib_fonts_$(HAVE_LIBFONTS))
OBJS = autoreload_$(autoreload_$(HAVE_INOTIFY)).o commands.o image.o main.o options.o \
OBJS = autoreload.o commands.o image.o main.o options.o \
thumbs.o util.o window.o
.SUFFIXES:

View File

@ -18,6 +18,8 @@
#include "nsxiv.h"
#if HAVE_INOTIFY
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@ -109,3 +111,29 @@ bool arl_handle(arl_t *arl)
}
return reload;
}
#else
void arl_init(arl_t *arl)
{
arl->fd = -1;
}
void arl_cleanup(arl_t *arl)
{
(void) arl;
}
void arl_setup(arl_t *arl, const char *filepath)
{
(void) arl;
(void) filepath;
}
bool arl_handle(arl_t *arl)
{
(void) arl;
return false;
}
#endif /* HAVE_INOTIFY */

View File

@ -1,41 +0,0 @@
/* Copyright 2017 Max Voit
*
* This file is a part of nsxiv.
*
* nsxiv is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* nsxiv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with nsxiv. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nsxiv.h"
void arl_init(arl_t *arl)
{
arl->fd = -1;
}
void arl_cleanup(arl_t *arl)
{
(void) arl;
}
void arl_setup(arl_t *arl, const char *filepath)
{
(void) arl;
(void) filepath;
}
bool arl_handle(arl_t *arl)
{
(void) arl;
return false;
}