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" #include "proto.h"
#ifdef ENABLE_BROWSER
#include <errno.h> #include <errno.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef ENABLE_BROWSER
static char **filelist = NULL; static char **filelist = NULL;
/* The list of files to display in the file browser. */ /* The list of files to display in the file browser. */
static size_t filelist_len = 0; static size_t filelist_len = 0;

View File

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

View File

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

View File

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

View File

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