build: slightly speed up the compilation of the tiny version

Don't include header files when they won't actually be needed.

(Also, remove a superfluous #ifdef.)
master
Benno Schulenberg 2019-10-13 18:51:15 +02:00
parent f551c07e7a
commit 31d5cb1118
5 changed files with 11 additions and 12 deletions

View File

@ -21,13 +21,13 @@
#include "proto.h"
#ifdef ENABLE_BROWSER
#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#ifdef ENABLE_BROWSER
static char **filelist = NULL;
/* The list of files to display in the file browser. */
static size_t filelist_len = 0;

View File

@ -21,14 +21,14 @@
#include "proto.h"
#ifdef ENABLE_COLOR
#include <errno.h>
#ifdef HAVE_MAGIC_H
#include <magic.h>
#endif
#include <string.h>
#ifdef ENABLE_COLOR
/* For early versions of ncurses-6.0, use an additional A_PROTECT attribute
* for all colors, in order to work around an ncurses miscoloring bug. */
#if defined(NCURSES_VERSION_MAJOR) && (NCURSES_VERSION_MAJOR == 6) && \

View File

@ -22,11 +22,11 @@
#include "proto.h"
#ifdef ENABLE_HELP
#include <errno.h>
#include <string.h>
#ifdef ENABLE_HELP
static char *help_text = NULL;
/* The text displayed in the help window. */

View File

@ -21,11 +21,11 @@
#include "proto.h"
#ifdef ENABLE_HISTORIES
#include <errno.h>
#include <string.h>
#ifdef ENABLE_HISTORIES
#ifndef SEARCH_HISTORY
#define SEARCH_HISTORY "search_history"
#endif

View File

@ -23,14 +23,14 @@
#include "proto.h"
#ifdef ENABLE_NANORC
#include <ctype.h>
#include <errno.h>
#include <glob.h>
#include <string.h>
#include <unistd.h>
#ifdef ENABLE_NANORC
#ifndef RCFILE_NAME
#define HOME_RC_NAME ".nanorc"
#define RCFILE_NAME "nanorc"
@ -501,11 +501,10 @@ void parse_binding(char *ptr, bool dobind)
if (newsc->func == do_toggle_void)
mask = MMAIN;
#endif
#ifdef ENABLE_NANORC
/* Handle the special case of a key defined as a string. */
if (newsc->func == (functionptrtype)implant)
mask = MMOST | MHELP;
#endif
/* Now limit the given menu to those where the function exists. */
menu = menu & (is_universal(newsc->func) ? MMOST : mask);