]> granicus.if.org Git - neomutt/commitdiff
use #ifdef for potentially missing symbols
authorRichard Russon <rich@flatcap.org>
Mon, 13 Mar 2017 02:08:05 +0000 (02:08 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 16 Mar 2017 23:39:54 +0000 (23:39 +0000)
Some preprocessor symbols might not exist
They should be tested with #ifdef, not #if

36 files changed:
browser.c
color.c
cryptglue.c
crypthash.h
enter.c
getdomain.c
globals.h
hcache.c
imap/imap.c
imap/imap_private.h
imap/message.c
init.c
init.h
main.c
md5.c
md5.h
mh.c
mutt.h
mutt_curses.h
mutt_notmuch.c
mutt_socket.c
mutt_ssl.h
mutt_ssl_gnutls.c
muttlib.c
mx.c
newsrc.c
nntp.c
nntp.h
pop.c
pop_lib.c
protos.h
rfc3676.c
send.c
sendlib.c
signal.c
system.c

index 03cabf11e9daf8a2f105b8a1c4e7ce8471f6f8e9..9e9517c1f1898d75bbae1e17be17d68728695990 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -1953,7 +1953,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
        break;
 #endif /* USE_NNTP */
 
-#if defined USE_IMAP || defined USE_NNTP
+#if defined(USE_IMAP) || defined(USE_NNTP)
       case OP_BROWSER_SUBSCRIBE:
       case OP_BROWSER_UNSUBSCRIBE:
 #endif
diff --git a/color.c b/color.c
index 2f217c2fe6872bb5d71302041a8df92a842725d9..b67674368b1076162536c3a641fed179034abee4 100644 (file)
--- a/color.c
+++ b/color.c
@@ -233,7 +233,7 @@ int mutt_alloc_color (int fg, int bg)
   COLOR_LIST *p = ColorList;
   int i;
 
-#if defined (USE_SLANG_CURSES)
+#ifdef USE_SLANG_CURSES
   char fgc[SHORT_STRING], bgc[SHORT_STRING];
 #endif
 
@@ -274,7 +274,7 @@ int mutt_alloc_color (int fg, int bg)
   p->bg = bg;
   p->fg = fg;
 
-#if defined (USE_SLANG_CURSES)
+#ifdef USE_SLANG_CURSES
   if (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT)
     SLtt_set_color (i, NULL, get_color_name (fgc, sizeof (fgc), fg), get_color_name (bgc, sizeof (bgc), bg));
   else
index 06c7974971ad41b525c5eacd7f750cc436b1c0e6..419e3b729238bf523d264bca0ab13cd1e8266ba8 100644 (file)
@@ -91,7 +91,7 @@ void crypt_init (void)
 #endif
     }
 
-#if defined CRYPT_BACKEND_CLASSIC_PGP || defined CRYPT_BACKEND_CLASSIC_SMIME || defined CRYPT_BACKEND_GPGME
+#if defined(CRYPT_BACKEND_CLASSIC_PGP) || defined(CRYPT_BACKEND_CLASSIC_SMIME) || defined(CRYPT_BACKEND_GPGME)
   if (CRYPT_MOD_CALL_CHECK (PGP, init))
     (CRYPT_MOD_CALL (PGP, init)) ();
 
index 0d1ededdbc366cafd57dbc474b1bfd178d1f79b6..7d9c1e4fbe9d172246b7a3c5532753727694b255 100644 (file)
@@ -3,10 +3,10 @@
 
 
 # include <sys/types.h>
-# if HAVE_INTTYPES_H
+# ifdef HAVE_INTTYPES_H
 #  include <inttypes.h>
 # else
-#  if HAVE_STDINT_H
+#  ifdef HAVE_STDINT_H
 #   include <stdint.h>
 #  endif
 # endif
diff --git a/enter.c b/enter.c
index c3137506353e2f7dcfe733c75e726ece5614bb5e..b2db56fb64ed23dcba7145b1a05a856a32dfe7da 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -665,7 +665,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col,
              BEEP (); /* let the user know that nothing matched */
            replace_part (state, 0, buf);
          }
-#if USE_NOTMUCH
+#ifdef USE_NOTMUCH
          else if (flags & MUTT_NM_QUERY)
          {
            my_wcstombs (buf, buflen, state->wbuf, state->curpos);
index 730b195760d6d0ff9dd75162a89c174283340053..6634c09055a1f5c6b4db51246ffd6aea15b4f3f6 100644 (file)
@@ -31,7 +31,7 @@ int getdnsdomainname (char *d, size_t len)
 {
   int ret = -1;
 
-#if defined HAVE_GETADDRINFO || defined HAVE_GETADDRINFO_A
+#if defined(HAVE_GETADDRINFO) || defined(HAVE_GETADDRINFO_A)
   char node[STRING];
   if (gethostname(node, sizeof(node)))
     return ret;
index 994340a6bafdd3112c4313d24f14d58995247b53..4ad79ba3c9ff0a15af65d3ac6db056f220a66173 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -75,10 +75,10 @@ WHERE char *Maildir;
 #if defined(USE_IMAP) || defined(USE_POP) || defined(USE_NNTP)
 WHERE char *MessageCachedir;
 #endif
-#if USE_HCACHE
+#ifdef USE_HCACHE
 WHERE char *HeaderCache;
 WHERE char *HeaderCacheBackend;
-#if HAVE_GDBM || HAVE_BDB
+#if defined(HAVE_GDBM) || defined(HAVE_BDB)
 WHERE char *HeaderCachePageSize;
 #endif /* HAVE_GDBM || HAVE_BDB */
 #endif /* USE_HCACHE */
@@ -144,14 +144,14 @@ WHERE char *SidebarIndentString;
 #endif
 WHERE char *Signature;
 WHERE char *SimpleSearch;
-#if USE_SMTP
+#ifdef USE_SMTP
 WHERE char *SmtpAuthenticators INITVAL (NULL);
 WHERE char *SmtpPass INITVAL (NULL);
 WHERE char *SmtpUrl INITVAL (NULL);
 #endif /* USE_SMTP */
 WHERE char *Spoolfile;
 WHERE char *SpamSep;
-#if defined(USE_SSL)
+#ifdef USE_SSL
 WHERE char *SslCertFile INITVAL (NULL);
 WHERE char *SslClientCert INITVAL (NULL);
 WHERE char *SslEntropyFile INITVAL (NULL);
index 687790977e3398c3e1fb71ea30a5353122b38456..eb2aa8ba8fadf88064e1565e87b3b1dcee8468e6 100644 (file)
--- a/hcache.c
+++ b/hcache.c
 
 #include "config.h"
 
-#if !(HAVE_BDB || HAVE_GDBM || HAVE_KC || HAVE_LMDB || HAVE_QDBM || HAVE_TC)
+#if !(defined(HAVE_BDB) || defined(HAVE_GDBM) || defined(HAVE_KC) || defined(HAVE_LMDB) || defined(HAVE_QDBM) || defined(HAVE_TC))
 #error "No hcache backend defined"
 #endif
 
 #include <errno.h>
-#if HAVE_SYS_TIME_H
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 #include "hcache.h"
@@ -64,22 +64,22 @@ HCACHE_BACKEND_LIST
 /* Keep this list sorted as it is in configure.ac to avoid user surprise if no
  * header_cache_backend is specified. */
 const hcache_ops_t *hcache_ops[] = {
-#if defined(HAVE_TC)
+#ifdef HAVE_TC
   &hcache_tokyocabinet_ops,
 #endif
-#if defined(HAVE_KC)
+#ifdef HAVE_KC
   &hcache_kyotocabinet_ops,
 #endif
-#if defined(HAVE_QDBM)
+#ifdef HAVE_QDBM
   &hcache_qdbm_ops,
 #endif
-#if defined(HAVE_GDBM)
+#ifdef HAVE_GDBM
   &hcache_gdbm_ops,
 #endif
-#if defined(HAVE_BDB)
+#ifdef HAVE_BDB
   &hcache_bdb_ops,
 #endif
-#if defined(HAVE_LMDB)
+#ifdef HAVE_LMDB
   &hcache_lmdb_ops,
 #endif
   NULL
@@ -680,7 +680,7 @@ mutt_hcache_dump(header_cache_t *h, HEADER * header, int *off,
 #ifdef MIXMASTER
   nh.chain = NULL;
 #endif
-#if defined USE_POP || defined USE_IMAP
+#if defined(USE_POP) || defined(USE_IMAP)
   nh.data = NULL;
 #endif
 
index dec521bad4ffc057013966f69cb77c3410746a42..a6632e2b4933cb29563328305a134cd14a974af0 100644 (file)
 #include "sort.h"
 #include "browser.h"
 #include "imap_private.h"
-#if defined(USE_SSL)
+#ifdef USE_SSL
 # include "mutt_ssl.h"
 #endif
 #include "buffy.h"
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #include "hcache.h"
 #endif
 
@@ -265,7 +265,7 @@ void imap_expunge_mailbox (IMAP_DATA* idata)
       idata->ctx->size -= h->content->length;
 
       imap_cache_del (idata, h);
-#if USE_HCACHE
+#ifdef USE_HCACHE
       imap_hcache_del (idata, HEADER_DATA(h)->uid);
 #endif
 
@@ -284,7 +284,7 @@ void imap_expunge_mailbox (IMAP_DATA* idata)
     }
   }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   imap_hcache_close (idata);
 #endif
 
@@ -421,7 +421,7 @@ int imap_open_connection (IMAP_DATA* idata)
     if (ascii_strncasecmp ("* OK [CAPABILITY", idata->buf, 16)
         && imap_check_capabilities (idata))
       goto bail;
-#if defined(USE_SSL)
+#ifdef USE_SSL
     /* Attempt STARTTLS if available and desired. */
     if (!idata->conn->ssf && (option(OPTSSLFORCETLS) ||
                               mutt_bit_isset (idata->capabilities, STARTTLS)))
@@ -477,7 +477,7 @@ int imap_open_connection (IMAP_DATA* idata)
 
   return 0;
 
-#if defined(USE_SSL)
+#ifdef USE_SSL
  err_close_conn:
   imap_close_connection (idata);
 #endif
@@ -1211,7 +1211,7 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge)
     }
   }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   idata->hcache = imap_hcache_open (idata, NULL);
 #endif
 
@@ -1223,14 +1223,14 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge)
     if (h->deleted)
     {
       imap_cache_del (idata, h);
-#if USE_HCACHE
+#ifdef USE_HCACHE
       imap_hcache_del (idata, HEADER_DATA(h)->uid);
 #endif
     }
 
     if (h->active && h->changed)
     {
-#if USE_HCACHE
+#ifdef USE_HCACHE
       imap_hcache_put (idata, h);
 #endif
       /* if the message has been rethreaded or attachments have been deleted
@@ -1252,7 +1252,7 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge)
     }
   }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   imap_hcache_close (idata);
 #endif
 
index 210cef4dfd77e400e298e33ad1da210835ed56ad..81ba2522dd9a5d335f600dc89c5be7624cd73a18 100644 (file)
@@ -307,7 +307,7 @@ int imap_wordcasecmp(const char *a, const char *b);
 void imap_utf_encode (IMAP_DATA *idata, char **s);
 void imap_utf_decode (IMAP_DATA *idata, char **s);
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 /* typedef size_t (*hcache_keylen_t)(const char* fn); */
 #define imap_hcache_keylen mutt_strlen
 #endif /* USE_HCACHE */
index 7363fc12c251c95b19bca5fed900175b9886f0de..4cf71f494020bef90e2fb80136a3ab171f162100 100644 (file)
@@ -34,7 +34,7 @@
 #include "pgp.h"
 #endif
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #include "hcache.h"
 #endif
 
@@ -88,7 +88,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
   progress_t progress;
   int retval = -1;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   char buf[LONG_STRING];
   void *uid_validity = NULL;
   void *puidnext = NULL;
@@ -134,7 +134,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
   idata->reopen &= ~(IMAP_REOPEN_ALLOW|IMAP_NEWMAIL_PENDING);
   idata->newMailCount = 0;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   idata->hcache = imap_hcache_open (idata, NULL);
 
   if (idata->hcache && !msgbegin)
@@ -340,7 +340,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
       ctx->hdrs[idx]->content->length = h.content_length;
       ctx->size += h.content_length;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
       imap_hcache_put (idata, ctx->hdrs[idx]);
 #endif /* USE_HCACHE */
 
@@ -352,7 +352,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
     if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK)))
     {
       imap_free_header_data (&h.data);
-#if USE_HCACHE
+#ifdef USE_HCACHE
       imap_hcache_close (idata);
 #endif
       goto error_out_1;
@@ -373,7 +373,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
       (status->uidnext < maxuid + 1))
     status->uidnext = maxuid + 1;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   mutt_hcache_store_raw (idata->hcache, "/UIDVALIDITY", 12,
           &idata->uid_validity, sizeof (idata->uid_validity));
   if (maxuid && idata->uidnext < maxuid + 1)
diff --git a/init.c b/init.c
index bd3fe62400c78c4b4c5923cbc78183797528e6e3..3b03d68857e91f69141aaf7b68d5fb8b282c2c12 100644 (file)
--- a/init.c
+++ b/init.c
 #include "group.h"
 #include "version.h"
 
-#if defined(USE_SSL)
+#ifdef USE_SSL
 #include "mutt_ssl.h"
 #endif
 
-#if USE_NOTMUCH
+#ifdef USE_NOTMUCH
 #include "mutt_notmuch.h"
 #endif
 
@@ -76,7 +76,7 @@ static myvar_t* MyVars;
 static void myvar_set (const char* var, const char* val);
 static void myvar_del (const char* var);
 
-#if USE_NOTMUCH
+#ifdef USE_NOTMUCH
 /* List of tags found in last call to mutt_nm_query_complete(). */
 static char **nm_tags;
 #endif
@@ -3205,7 +3205,7 @@ int mutt_var_value_complete (char *buffer, size_t len, int pos)
   return 0;
 }
 
-#if USE_NOTMUCH
+#ifdef USE_NOTMUCH
 
 /* Fetch a list of all notmuch tags and insert them into the completion
  * machinery.
diff --git a/init.h b/init.h
index f5d49b36290d7a71081f0535bb0ff13e28140089..97b00f65dc7f12509dfb465cb67eccd1a2767aa9 100644 (file)
--- a/init.h
+++ b/init.h
@@ -362,7 +362,7 @@ struct option_t MuttVars[] = {
   ** as read when you quit the newsgroup (catchup newsgroup).
   */
 #endif
-#if defined(USE_SSL)
+#ifdef USE_SSL
   { "certificate_file",        DT_PATH, R_NONE, UL &SslCertFile, UL "~/.mutt_certificates" },
   /*
   ** .pp
@@ -792,7 +792,7 @@ struct option_t MuttVars[] = {
   ** agents tend to do with messages (in order to prevent tools from
   ** misinterpreting the line as a mbox message separator).
   */
-#if defined(USE_SSL_OPENSSL)
+#ifdef USE_SSL_OPENSSL
   { "entropy_file",    DT_PATH, R_NONE, UL &SslEntropyFile, 0 },
   /*
   ** .pp
@@ -3697,7 +3697,7 @@ struct option_t MuttVars[] = {
   ** initially set this variable to the value of the environment
   ** variable \fC$$$MAIL\fP or \fC$$$MAILDIR\fP if either is defined.
   */
-#if defined(USE_SSL)
+#ifdef USE_SSL
 #ifdef USE_SSL_GNUTLS
   { "ssl_ca_certificates_file", DT_PATH, R_NONE, UL &SslCACertFile, 0 },
   /*
diff --git a/main.c b/main.c
index 840b5d9411974e3130a8baa5a7f87ab2386b0e72..ff04d4baae4be4f6ef48ee24947cc0298314cef0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -101,7 +101,7 @@ options:\n\
   -D\t\tprint the value of all variables to stdout\n\
   -D -S\t\tlike -D, but hide the value of sensitive variables\n\
   -B\t\trun in batch mode (do not start the ncurses UI)"));
-#if DEBUG
+#ifdef DEBUG
   puts (_("  -d <level>\tlog debugging output to ~/.muttdebug0"));
 #endif
   puts (_(
@@ -161,10 +161,10 @@ static void start_curses (void)
   cbreak ();
   noecho ();
   nonl ();
-#if HAVE_TYPEAHEAD
+#ifdef HAVE_TYPEAHEAD
   typeahead (-1);       /* simulate smooth scrolling */
 #endif
-#if HAVE_META
+#ifdef HAVE_META
   meta (stdscr, true);
 #endif
 init_extended_keys();
diff --git a/md5.c b/md5.c
index b40fe11093aff9695a3b329ec2ad0b22b5737c8a..e6018a5b14a4d0f6ac1b662216b4d8b35b9b1a8f 100644 (file)
--- a/md5.c
+++ b/md5.c
 #include <stddef.h>
 #include <string.h>
 
-#if USE_UNLOCKED_IO
+#ifdef USE_UNLOCKED_IO
 # include "unlocked-io.h"
 #endif
 
 #ifdef _LIBC
 # include <endian.h>
-# if __BYTE_ORDER == __BIG_ENDIAN
+# if (__BYTE_ORDER == __BIG_ENDIAN)
 #  define WORDS_BIGENDIAN 1
 # endif
 /* We need to keep the namespace clean so define the MD5 function
@@ -55,7 +55,7 @@
 #endif
 
 #define BLOCKSIZE 4096
-#if BLOCKSIZE % 64 != 0
+#if ((BLOCKSIZE % 64) != 0)
 # error "invalid BLOCKSIZE"
 #endif
 
@@ -244,7 +244,7 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
   /* Process available complete blocks.  */
   if (len >= 64)
     {
-#if !_STRING_ARCH_unaligned
+#if !defined(_STRING_ARCH_unaligned)
 # define alignof(type) offsetof (struct { char c; type x; }, x)
 # define UNALIGNED_P(p) (((size_t) p) % alignof (md5_uint32) != 0)
       if (UNALIGNED_P (buffer))
diff --git a/md5.h b/md5.h
index c8dee0de92cee57e94f4da84094f965ba9969dd1..7a9bc6133dbb49ed43d0be991addb12274169288 100644 (file)
--- a/md5.h
+++ b/md5.h
 
 #include <stdio.h>
 
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
 #endif
-#if HAVE_STDINT_H || _LIBC
+#if defined(HAVE_STDINT_H) || defined(_LIBC)
 # include <stdint.h>
 #endif
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
 
 #ifndef __GNUC_PREREQ
-# if defined __GNUC__ && defined __GNUC_MINOR__
+# if defined(__GNUC__) && defined(__GNUC_MINOR__)
 #  define __GNUC_PREREQ(maj, min) \
        ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
 # else
@@ -45,7 +45,7 @@
 #endif
 
 #ifndef __THROW
-# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# if defined(__cplusplus) && __GNUC_PREREQ (2,8)
 #  define __THROW      throw ()
 # else
 #  define __THROW
diff --git a/mh.c b/mh.c
index e684fabdfbcdda48b453bf77c036d84f02c0ccb3..9267de938e2a9c95e70b6368370104096518a2bf 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -30,7 +30,7 @@
 #include "mx.h"
 #include "copy.h"
 #include "sort.h"
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #include "hcache.h"
 #endif
 #include "mutt_curses.h"
@@ -50,7 +50,7 @@
 #include <string.h>
 #include <utime.h>
 
-#if HAVE_SYS_TIME_H
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 
@@ -939,7 +939,7 @@ static int maildir_move_to_context (CONTEXT * ctx, struct maildir **md)
   return r;
 }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 static size_t maildir_hcache_keylen (const char *fn)
 {
   const char * p = strrchr (fn, ':');
@@ -947,7 +947,7 @@ static size_t maildir_hcache_keylen (const char *fn)
 }
 #endif
 
-#if HAVE_DIRENT_D_INO
+#ifdef HAVE_DIRENT_D_INO
 static int md_cmp_inode (struct maildir *a, struct maildir *b)
 {
   return a->inode - b->inode;
@@ -1096,7 +1096,7 @@ static void mh_sort_natural (CONTEXT *ctx, struct maildir **md)
   *md = maildir_sort (*md, (size_t) -1, md_cmp_path);
 }
 
-#if HAVE_DIRENT_D_INO
+#ifdef HAVE_DIRENT_D_INO
 static struct maildir *skip_duplicates (struct maildir *p, struct maildir **last)
 {
   /*
@@ -1126,10 +1126,10 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
   struct maildir *p, *last = NULL;
   char fn[_POSIX_PATH_MAX];
   int count;
-#if HAVE_DIRENT_D_INO
+#ifdef HAVE_DIRENT_D_INO
   int sort = 0;
 #endif
-#if USE_HCACHE
+#ifdef USE_HCACHE
   header_cache_t *hc = NULL;
   void *data;
   const char *key;
@@ -1139,7 +1139,7 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
   int ret;
 #endif
 
-#if HAVE_DIRENT_D_INO
+#ifdef HAVE_DIRENT_D_INO
 #define DO_SORT()      do { \
   if (!sort) \
   { \
@@ -1158,7 +1158,7 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
 #define DO_SORT()      /* nothing */
 #endif
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   hc = mutt_hcache_open (HeaderCache, ctx->path, NULL);
 #endif
 
@@ -1177,7 +1177,7 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
 
     snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     if (option(OPTHCACHEVERIFY))
     {
        ret = stat(fn, &lastchanged);
@@ -1218,7 +1218,7 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
     if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h))
     {
       p->header_parsed = 1;
-#if USE_HCACHE
+#ifdef USE_HCACHE
       if (ctx->magic == MUTT_MH)
       {
         key = p->h->path;
@@ -1233,13 +1233,13 @@ static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
 #endif
     } else
       mutt_free_header (&p->h);
-#if USE_HCACHE
+#ifdef USE_HCACHE
     }
     mutt_hcache_free(hc, &data);
 #endif
     last = p;
    }
-#if USE_HCACHE
+#ifdef USE_HCACHE
   mutt_hcache_close (hc);
 #endif
 
@@ -1910,13 +1910,13 @@ static int maildir_sync_message (CONTEXT * ctx, int msgno)
   return (0);
 }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 int mh_sync_mailbox_message (CONTEXT * ctx, int msgno, header_cache_t *hc)
 #else
 int mh_sync_mailbox_message (CONTEXT * ctx, int msgno)
 #endif
 {
-#if USE_HCACHE
+#ifdef USE_HCACHE
     const char *key;
     size_t keylen;
 #endif
@@ -1929,7 +1929,7 @@ int mh_sync_mailbox_message (CONTEXT * ctx, int msgno)
       if (ctx->magic == MUTT_MAILDIR
          || (option (OPTMHPURGE) && ctx->magic == MUTT_MH))
       {
-#if USE_HCACHE
+#ifdef USE_HCACHE
         if (hc)
         {
           if (ctx->magic == MUTT_MH)
@@ -1977,7 +1977,7 @@ int mh_sync_mailbox_message (CONTEXT * ctx, int msgno)
       }
     }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     if (hc && h->changed)
     {
       if (ctx->magic == MUTT_MH)
@@ -2000,7 +2000,7 @@ int mh_sync_mailbox_message (CONTEXT * ctx, int msgno)
 static int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
 {
   int i, j;
-#if USE_HCACHE
+#ifdef USE_HCACHE
   header_cache_t *hc = NULL;
 #endif /* USE_HCACHE */
   char msgbuf[STRING];
@@ -2014,7 +2014,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
   if (i != 0)
     return i;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   if (ctx->magic == MUTT_MAILDIR || ctx->magic == MUTT_MH)
     hc = mutt_hcache_open(HeaderCache, ctx->path, NULL);
 #endif /* USE_HCACHE */
@@ -2030,7 +2030,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
     if (!ctx->quiet)
       mutt_progress_update (&progress, i, -1);
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     if (mh_sync_mailbox_message (ctx, i, hc) == -1)
       goto err;
 #else
@@ -2039,7 +2039,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
 #endif
   }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   if (ctx->magic == MUTT_MAILDIR || ctx->magic == MUTT_MH)
     mutt_hcache_close (hc);
 #endif /* USE_HCACHE */
@@ -2066,7 +2066,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
   return 0;
 
 err:
-#if USE_HCACHE
+#ifdef USE_HCACHE
   if (ctx->magic == MUTT_MAILDIR || ctx->magic == MUTT_MH)
     mutt_hcache_close (hc);
 #endif /* USE_HCACHE */
diff --git a/mutt.h b/mutt.h
index 175c0e065e4d37558ce1342fcb98a18235c6ab58..2a049fd465ffe795b8314e316afb5782b1da75b9 100644 (file)
--- a/mutt.h
+++ b/mutt.h
 #define  MUTT_COMMAND (1<<6) /* do command completion */
 #define  MUTT_PATTERN (1<<7) /* pattern mode - only used for history classes */
 #define  MUTT_LABEL   (1<<8) /* do label completion */
-#if USE_NOTMUCH
+#ifdef USE_NOTMUCH
 #define  MUTT_NM_QUERY (1<<9) /* Notmuch query mode. */
 #define  MUTT_NM_TAG   (1<<10) /* Notmuch tag +/- mode. */
 #endif
@@ -300,7 +300,7 @@ enum
   OPT_QUIT,
   OPT_REPLYTO,
   OPT_RECALL,
-#if defined(USE_SSL)
+#ifdef USE_SSL
   OPT_SSLSTARTTLS,
 #endif
   OPT_SUBJECT,
@@ -413,7 +413,7 @@ enum
   OPTIMAPPEEK,
   OPTIMAPSERVERNOISE,
 #endif
-#if defined(USE_SSL)
+#ifdef USE_SSL
 # ifndef USE_SSL_GNUTLS
   OPTSSLSYSTEMCERTS,
   OPTSSLV2,
@@ -908,7 +908,7 @@ typedef struct header
   int refno;                   /* message number on server */
 #endif
 
-#if defined USE_POP || defined USE_IMAP || defined USE_NNTP || defined USE_NOTMUCH
+#if defined(USE_POP) || defined(USE_IMAP) || defined(USE_NNTP) || defined(USE_NOTMUCH)
   void *data;                  /* driver-specific data */
   void (*free_cb)(struct header *); /* driver-specific data free function */
 #endif
index 6ea1232afe61a5254817350e2261553d410c2017..c096aaab97e7b79ad4089808e9bcbc848ed0e904 100644 (file)
@@ -39,7 +39,7 @@
 
 #else /* USE_SLANG_CURSES */
 
-#if HAVE_NCURSESW_NCURSES_H
+#ifdef HAVE_NCURSESW_NCURSES_H
 # include <ncursesw/ncurses.h>
 #elif HAVE_NCURSES_NCURSES_H
 # include <ncurses/ncurses.h>
@@ -62,7 +62,7 @@
 #define CENTERLINE(win,x,y) mutt_window_move(win, y, (win->cols-strlen(x))/2), addstr(x)
 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
 
-#if ! (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
+#if !(defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
 #define curs_set(x)
 #endif
 
@@ -248,7 +248,7 @@ void ci_start_color (void);
  * functions will properly set the background attributes all the way to the
  * right column.
  */
-#if defined(HAVE_BKGDSET)
+#ifdef HAVE_BKGDSET
 #define SETCOLOR(X) bkgdset(ColorDefs[X] | ' ')
 #define ATTRSET(X) bkgdset(X | ' ')
 #else
index f80189dd8c9a33fa7ddf702213827aeb4755212d..0e9ae42a9a7872977cdc45cf45acbe01688265dc 100644 (file)
@@ -2378,7 +2378,7 @@ static int nm_sync_mailbox(CONTEXT *ctx, int *index_hint)
 
     ctx->path = hd->folder;
     ctx->magic = hd->magic;
-#if USE_HCACHE
+#ifdef USE_HCACHE
     rc = mh_sync_mailbox_message(ctx, i, NULL);
 #else
     rc = mh_sync_mailbox_message(ctx, i);
index 3ea41a1514595b84f508a860a121b6834c30faef..22b561fa6dd974d05523937dd6df8d2a0665be9f 100644 (file)
@@ -23,7 +23,7 @@
 #include "mutt.h"
 #include "mutt_socket.h"
 #include "mutt_tunnel.h"
-#if defined(USE_SSL)
+#ifdef USE_SSL
 # include "mutt_ssl.h"
 #endif
 
@@ -263,7 +263,7 @@ CONNECTION* mutt_conn_find (const CONNECTION* start, const ACCOUNT* account)
     mutt_tunnel_socket_setup (conn);
   else if (account->flags & MUTT_ACCT_SSL)
   {
-#if defined(USE_SSL)
+#ifdef USE_SSL
     if (mutt_ssl_socket_setup (conn) < 0)
     {
       mutt_socket_free (conn);
index ad0e74c98230d1eca91870e4bf07a297b5cecc90..4d5e644dc865543ec782d9cf611b91ca9c2b4a00 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "mutt_socket.h"
 
-#if defined(USE_SSL)
+#ifdef USE_SSL
 int mutt_ssl_starttls (CONNECTION* conn);
 int mutt_ssl_socket_setup (CONNECTION *conn);
 #endif
index 4a07d3cd80cfbfc2c6d6d1fcc2938f91ed42e796..c70215f766af76fa7876cf859ada9735e6aac410 100644 (file)
@@ -269,7 +269,7 @@ err_crt:
   gnutls_x509_crt_deinit (clientcrt);
 }
 
-#if HAVE_GNUTLS_PRIORITY_SET_DIRECT
+#ifdef HAVE_GNUTLS_PRIORITY_SET_DIRECT
 static int tls_set_priority(tlssockdata *data)
 {
   size_t nproto = 4;
@@ -401,7 +401,7 @@ static int tls_negotiate (CONNECTION * conn)
                                           SslClientCert, GNUTLS_X509_FMT_PEM);
   }
 
-#if HAVE_DECL_GNUTLS_VERIFY_DISABLE_TIME_CHECKS
+#ifdef HAVE_DECL_GNUTLS_VERIFY_DISABLE_TIME_CHECKS
   /* disable checking certificate activation/expiration times
      in gnutls, we do the checks ourselves */
   gnutls_certificate_set_verify_flags(data->xcred, GNUTLS_VERIFY_DISABLE_TIME_CHECKS);
index 04296a560f2b8d295a5b3c4679b6ed71dc4e59a7..7837a633596cb4a258a10c1232773fc37e648043 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -391,7 +391,7 @@ void mutt_free_header (HEADER **h)
 #ifdef MIXMASTER
   mutt_free_list (&(*h)->chain);
 #endif
-#if defined USE_POP || defined USE_IMAP || defined USE_NNTP || defined USE_NOTMUCH
+#if defined(USE_POP) || defined(USE_IMAP) || defined(USE_NNTP) || defined(USE_NOTMUCH)
   if ((*h)->free_cb)
     (*h)->free_cb(*h);
   FREE (&(*h)->data);
diff --git a/mx.c b/mx.c
index f3ed78c232f1b92b211c7fc79248395813e23a59..6fd9708287c45ef77b024b8564127160d0b4a34d 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1078,7 +1078,7 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint)
   return 0;
 }
 
-#if USE_NOTMUCH
+#ifdef USE_NOTMUCH
 #include "mutt_notmuch.h"
 #endif
 
index 98239f03332fcc2fc890a52d7e10c5c554c1313e..2eb8e704aadc19a307774ec0da0e46f3543ad6ce 100644 (file)
--- a/newsrc.c
+++ b/newsrc.c
@@ -32,7 +32,7 @@
 #include "rfc2047.h"
 #include "bcache.h"
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #include "hcache.h"
 #endif
 
diff --git a/nntp.c b/nntp.c
index 218a0be203bcaebe9a5c891e7cd8fc532f74ffa1..028290fb462e50c09931fb652c688659d8998faa 100644 (file)
--- a/nntp.c
+++ b/nntp.c
@@ -31,7 +31,7 @@
 #include "mutt_crypt.h"
 #include "nntp.h"
 
-#if defined(USE_SSL)
+#ifdef USE_SSL
 #include "mutt_ssl.h"
 #endif
 
@@ -43,7 +43,7 @@
 #include "smime.h"
 #endif
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #include "hcache.h"
 #endif
 
@@ -663,7 +663,7 @@ int nntp_open_connection (NNTP_SERVER *nserv)
                posting ? _("Posting is ok.") : _("Posting is NOT ok."));
   mutt_sleep (1);
 
-#if defined(USE_SSL)
+#ifdef USE_SSL
   /* Attempt STARTTLS if available and desired. */
   if (nserv->use_tls != 1 && (nserv->hasSTARTTLS || option (OPTSSLFORCETLS)))
   {
diff --git a/nntp.h b/nntp.h
index 78f660dffa8be85fd340a29fc8b2294f31848dd9..8d949df56a6332f0c48d30860e9d81dfeb85bd05 100644 (file)
--- a/nntp.h
+++ b/nntp.h
@@ -25,7 +25,7 @@
 #include "mailbox.h"
 #include "bcache.h"
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #include "hcache.h"
 #endif
 
diff --git a/pop.c b/pop.c
index fbc21c98e77d3f3d566851669777fc0cb6101e99..75a52ce5da57109f576b32c76c2fa418bcd4297e 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -25,7 +25,7 @@
 #include "pop.h"
 #include "mutt_crypt.h"
 #include "bcache.h"
-#if USE_HCACHE
+#ifdef USE_HCACHE
 #include "hcache.h"
 #endif
 
@@ -300,7 +300,7 @@ static int pop_fetch_headers (CONTEXT *ctx)
     {
       if (!ctx->quiet)
        mutt_progress_update (&progress, i + 1 - old_count, -1);
-#if USE_HCACHE
+#ifdef USE_HCACHE
       if ((data = mutt_hcache_fetch (hc, ctx->hdrs[i]->data, strlen(ctx->hdrs[i]->data))))
       {
        char *uidl = safe_strdup (ctx->hdrs[i]->data);
@@ -329,7 +329,7 @@ static int pop_fetch_headers (CONTEXT *ctx)
 #endif
       if ((ret = pop_read_header (pop_data, ctx->hdrs[i])) < 0)
        break;
-#if USE_HCACHE
+#ifdef USE_HCACHE
       else
       {
        mutt_hcache_store (hc, ctx->hdrs[i]->data, strlen(ctx->hdrs[i]->data),
@@ -372,7 +372,7 @@ static int pop_fetch_headers (CONTEXT *ctx)
       mx_update_context (ctx, i - old_count);
   }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     mutt_hcache_close (hc);
 #endif
 
@@ -437,7 +437,7 @@ static int pop_open_mailbox (CONTEXT *ctx)
   memset (ctx->rights, 0, sizeof (ctx->rights));
   mutt_bit_set (ctx->rights, MUTT_ACL_SEEN);
   mutt_bit_set (ctx->rights, MUTT_ACL_DELETE);
-#if USE_HCACHE
+#ifdef USE_HCACHE
   /* flags are managed using header cache, so it only makes sense to
    * enable them in that case */
   mutt_bit_set (ctx->rights, MUTT_ACL_WRITE);
@@ -684,7 +684,7 @@ static int pop_sync_mailbox (CONTEXT *ctx, int *index_hint)
     mutt_progress_init (&progress, _("Marking messages deleted..."),
                        MUTT_PROGRESS_MSG, WriteInc, ctx->deleted);
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     hc = pop_hcache_open (pop_data, ctx->path);
 #endif
 
@@ -699,13 +699,13 @@ static int pop_sync_mailbox (CONTEXT *ctx, int *index_hint)
        if ((ret = pop_query (pop_data, buf, sizeof (buf))) == 0)
        {
          mutt_bcache_del (pop_data->bcache, ctx->hdrs[i]->data);
-#if USE_HCACHE
+#ifdef USE_HCACHE
          mutt_hcache_delete (hc, ctx->hdrs[i]->data, strlen(ctx->hdrs[i]->data));
 #endif
        }
       }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
       if (ctx->hdrs[i]->changed)
       {
        mutt_hcache_store (hc, ctx->hdrs[i]->data, strlen(ctx->hdrs[i]->data),
@@ -715,7 +715,7 @@ static int pop_sync_mailbox (CONTEXT *ctx, int *index_hint)
 
     }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     mutt_hcache_close (hc);
 #endif
 
index fa2261925f711cc8a9f435a10a8ade91c3db7ec6..01109e6399b9acee99fc0aa8bb4957acf7a0e880 100644 (file)
--- a/pop_lib.c
+++ b/pop_lib.c
@@ -22,7 +22,7 @@
 #include "mx.h"
 #include "url.h"
 #include "pop.h"
-#if defined(USE_SSL)
+#ifdef USE_SSL
 # include "mutt_ssl.h"
 #endif
 
@@ -281,7 +281,7 @@ int pop_open_connection (POP_DATA *pop_data)
     return -2;
   }
 
-#if defined(USE_SSL)
+#ifdef USE_SSL
   /* Attempt STLS if available and desired. */
   if (!pop_data->conn->ssf && (pop_data->cmd_stls || option(OPTSSLFORCETLS)))
   {
index 7b89882b25b325a8e4db120328ea176a08a342fd..fe548abc7a640e0495c6b3207ca848896058bbce 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -284,7 +284,7 @@ int mutt_check_overwrite (const char *, const char *, char *, size_t, int *, cha
 int mutt_check_traditional_pgp (HEADER *, int *);
 int mutt_command_complete (char *, size_t, int, int);
 int mutt_var_value_complete (char *, size_t, int);
-#if USE_NOTMUCH
+#ifdef USE_NOTMUCH
 int mutt_nm_query_complete (char *buffer, size_t len, int pos, int numtabs);
 int mutt_nm_tag_complete (char *buffer, size_t len, int pos, int numtabs);
 #endif
index e6870e33ad0b41c16937489a88d49e5bd783981a..7e41905d83dba4f573af9f63c6ac8f018811a6ee 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -335,7 +335,7 @@ int rfc3676_handler (BODY * a, STATE * s)
  */
 void rfc3676_space_stuff (HEADER* hdr)
 {
-#if DEBUG
+#ifdef DEBUG
   int lc = 0;
   size_t len = 0;
   unsigned char c = '\0';
@@ -363,7 +363,7 @@ void rfc3676_space_stuff (HEADER* hdr)
   {
     if (ascii_strncmp ("From ", buf, 5) == 0 || buf[0] == ' ') {
       fputc (' ', out);
-#if DEBUG
+#ifdef DEBUG
       lc++;
       len = mutt_strlen (buf);
       if (len > 0)
diff --git a/send.c b/send.c
index 822213210ad059878c103a14855c8de248e4713c..239682bad2b86e1194c79803c078bf442d97b0f2 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1108,7 +1108,7 @@ static int send_message (HEADER *msg)
     return mix_send_message (msg->chain, tempfile);
 #endif
 
-#if USE_SMTP
+#ifdef USE_SMTP
 #ifdef USE_NNTP
   if (!option (OPTNEWSSEND))
 #endif
index 88e2915d8d4edf40e88c37aa1e0dfdc081cccced..2663b1156df55ed68f44544ab931152caabb90fb 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2249,7 +2249,7 @@ send_msg (const char *path, char **args, const char *msg, char **tempfile)
 
     /* next we close all open files */
     close (0);
-#if defined(OPEN_MAX)
+#ifdef OPEN_MAX
     for (fd = tempfile ? 1 : 3; fd < OPEN_MAX; fd++)
       close (fd);
 #elif defined(_POSIX_OPEN_MAX)
@@ -2671,7 +2671,7 @@ static int _mutt_bounce_message (FILE *fp, HEADER *h, ADDRESS *to, const char *r
       unlink(tempfile);
       return -1;
     }
-#if USE_SMTP
+#ifdef USE_SMTP
     if (SmtpUrl)
       ret = mutt_smtp_send (env_from, to, NULL, NULL, tempfile,
                             h->content->encoding == ENC8BIT);
index 72d67bb54124d8fdd80767d8cdb2395bad7bb6a5..8bf0eea98326f61cf1e86db6f874d5ce27231814 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -37,13 +37,13 @@ static void exit_handler (int sig)
 {
   curs_set (1);
   endwin (); /* just to be safe */
-#if SYS_SIGLIST_DECLARED
+#ifdef SYS_SIGLIST_DECLARED
   printf(_("%s...  Exiting.\n"), sys_siglist[sig]);
 #else
-#if (__sun__ && __svr4__)
+#if (defined(__sun__) && defined(__svr4__))
   printf(_("Caught %s...  Exiting.\n"), _sys_siglist[sig]);
 #else
-#if (__alpha && __osf__)
+#if (defined(__alpha) && defined(__osf__))
   printf(_("Caught %s...  Exiting.\n"), __sys_siglist[sig]);
 #else
   printf(_("Caught signal %d...  Exiting.\n"), sig);
index 9e75f1f6bcef72c6b6fbbac03e812846939d9641..be109332c499843853f4db994f07cecafe0ca500 100644 (file)
--- a/system.c
+++ b/system.c
@@ -81,7 +81,7 @@ int _mutt_system (const char *cmd, int flags)
       switch (fork ())
       {
        case 0:
-#if defined(OPEN_MAX)
+#ifdef OPEN_MAX
          for (fd = 0; fd < OPEN_MAX; fd++)
            close (fd);
 #elif defined(_POSIX_OPEN_MAX)