Changeset 3869:eb33a92c7ab9

Show
Ignore:
Timestamp:
2005-01-30 18:40:14 (4 years ago)
Author:
Brendan Cully <brendan@…>
Branch:
HEAD
Message:

Begin removing deprecated autoconf 2.13 backward compatibility code.
Add AC_CHECK_TYPES macros for uin32/64 types, use uint64_t instead of long long
in hcache code.

Files:
1 added
1 removed
5 modified

Legend:

Unmodified
Added
Removed
  • configure.in

    r3858 r3869  
    44dnl !!! TO DUMP THEIR RESULTS WHEN MUTT -V IS CALLED            !!! 
    55 
    6 AC_PREREQ(2.12) 
    7 AC_INIT(mutt.h) 
    8 AM_CONFIG_HEADER(config.h) 
     6AC_PREREQ([2.54]) 
     7AC_INIT([mutt.h]) 
     8AM_CONFIG_HEADER([config.h]) 
    99 
    1010mutt_cv_version=`cat $srcdir/VERSION` 
    11  
    1211 
    1312AM_INIT_AUTOMAKE(mutt, $mutt_cv_version) 
    1413AC_GNU_SOURCE 
    1514 
    16 ifdef([AC_LIBOBJ], , [define([AC_LIBOBJ], [LIB[]OBJS="$LIBOBJS $1.o"])]) 
    17  
    1815ALL_LINGUAS="de ru it es uk fr pl nl cs id sk ko el zh_TW zh_CN pt_BR eo gl sv da lt tr ja hu et ca bg" 
    1916 
    2017AC_CANONICAL_HOST 
    2118 
    22 AC_MSG_CHECKING(for prefix) 
     19AC_MSG_CHECKING([for prefix]) 
    2320if test x$prefix = xNONE; then 
    24         mutt_cv_prefix=$ac_default_prefix 
     21  mutt_cv_prefix=$ac_default_prefix 
    2522else 
    26         mutt_cv_prefix=$prefix 
     23  mutt_cv_prefix=$prefix 
    2724fi 
    2825AC_MSG_RESULT($mutt_cv_prefix) 
     
    5956fi 
    6057 
    61 AC_SUBST(DEBUGGER) 
    62  
    63 # The following templates should be used with newer automakes 
    64 # instead of acconfig.h 
    65 # 
    66 #AH_TEMPLATE([sig_atomic_t], 
    67 #            [/* Define to `int' if <signal.h> doesn't define.]) 
    68 #AH_TEMPLATE([HAVE_START_COLOR], 
    69 #            [Define if you have start_color, as a function or macro.]) 
    70 #AH_TEMPLATE([HAVE_TYPEAHEAD], 
    71 #            [Define if you have typeahead, as a function or macro.]) 
    72 #AH_TEMPLATE([HAVE_BKGDSET], 
    73 #            [Define if you have bkgdset, as a function or macro.]) 
    74 #AH_TEMPLATE([HAVE_CURS_SET], 
    75 #            [Define if you have curs_set, as a function or macro.]) 
    76 #AH_TEMPLATE([HAVE_META], 
    77 #            [Define if you have meta, as a function or macro.]) 
    78 #AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS], 
    79 #            [Define if you have use_default_colors, as a function or macro.]) 
    80 #AH_TEMPLATE([HAVE_RESIZETERM], 
    81 #            [Define if you have resizeterm, as a function or macro.]) 
    82 #AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T], 
    83 #            [Some systems declare sig_atomic_t as volatile, some others -- no. 
    84 #             This define will have value `sig_atomic_t' or 
    85 #             `volatile sig_atomic_t' accordingly.]) 
    86 #AH_TEMPLATE([ICONV_NONTRANS], 
    87 #            [Define as 1 if iconv() only converts exactly and we should treat 
    88 #             all return values other than (size_t)(-1) as equivalent.]) 
    89  
     58AC_SUBST([DEBUGGER]) 
     59 
     60AH_TEMPLATE([sig_atomic_t], 
     61            [/* Define to `int' if <signal.h> doesn't define.]) 
     62AH_TEMPLATE([HAVE_START_COLOR], 
     63            [Define if you have start_color, as a function or macro.]) 
     64AH_TEMPLATE([HAVE_TYPEAHEAD], 
     65            [Define if you have typeahead, as a function or macro.]) 
     66AH_TEMPLATE([HAVE_BKGDSET], 
     67            [Define if you have bkgdset, as a function or macro.]) 
     68AH_TEMPLATE([HAVE_CURS_SET], 
     69            [Define if you have curs_set, as a function or macro.]) 
     70AH_TEMPLATE([HAVE_META], 
     71            [Define if you have meta, as a function or macro.]) 
     72AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS], 
     73            [Define if you have use_default_colors, as a function or macro.]) 
     74AH_TEMPLATE([HAVE_RESIZETERM], 
     75            [Define if you have resizeterm, as a function or macro.]) 
     76AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T], 
     77            [Some systems declare sig_atomic_t as volatile, some others -- no. 
     78             This define will have value `sig_atomic_t' or 
     79             `volatile sig_atomic_t' accordingly.]) 
     80AH_TEMPLATE([ICONV_NONTRANS], 
     81            [Define as 1 if iconv() only converts exactly and we should treat 
     82             all return values other than (size_t)(-1) as equivalent.]) 
     83 
     84MUTT_C99_INTTYPES 
    9085 
    9186ac_aux_path_sendmail=/usr/sbin:/usr/lib 
     
    167162# We now require all OPS 
    168163OPS="$OPS \$(srcdir)/OPS.PGP \$(srcdir)/OPS.SMIME \$(srcdir)/OPS.CRYPT " 
    169 AC_SUBST(OPS) 
     164AC_SUBST([OPS]) 
    170165 
    171166 
     
    174169 
    175170AC_DEFINE_UNQUOTED(SUBVERSION,"$SUBVERSION",[ Is this the international version? ]) 
    176 AC_SUBST(SUBVERSION) 
     171AC_SUBST([SUBVERSION]) 
    177172 
    178173AC_PATH_PROG(ISPELL, ispell, no) 
     
    327322 
    328323AC_DECL_SYS_SIGLIST 
    329  
    330 dnl For MD5 and SHA1 on 64-bit systems 
    331 AC_C_BIGENDIAN 
    332 AC_CHECK_HEADERS(inttypes.h stdint.h) 
    333 dnl This is the method autoconf-2.50's new AC_CHECK_TYPE macro uses. 
    334 dnl We need to be backwards compatible to autoconf 2.13, though. -lh 
    335 AC_MSG_CHECKING(for uint32_t) 
    336 AC_TRY_COMPILE([ 
    337 #include <sys/types.h> 
    338 #if HAVE_INTTYPES_H 
    339 #include <inttypes.h> 
    340 #else 
    341 #if HAVE_STDINT_H 
    342 #include <stdint.h> 
    343 #endif 
    344 #endif], 
    345 [if ((uint32_t *) 0) 
    346   return 0; 
    347 if (sizeof (uint32_t)) 
    348   return 0; 
    349 ],[ 
    350     AC_DEFINE(HAVE_UINT32_T,1,[ Define if you have the uint32_t type. ]) 
    351     AC_MSG_RESULT(yes) 
    352   ], AC_MSG_RESULT(no) 
    353 ) 
    354 AC_CHECK_SIZEOF(int) 
    355 AC_CHECK_SIZEOF(long) 
    356324 
    357325AC_TYPE_PID_T 
  • hcache.c

    r3867 r3869  
    6161{ 
    6262  struct timeval timeval; 
    63   unsigned long long uid_validity; 
     63  uint64_t uid_validity; 
    6464} validate; 
    6565 
     
    278278  restore_int(&offset, d, off); 
    279279  (*b)->dptr = (*b)->data + offset; 
    280   restore_int(&(*b)->dsize, d, off); 
     280  restore_int((unsigned int *) &(*b)->dsize, d, off); 
    281281  restore_int((unsigned int *) &(*b)->destroy, d, off); 
    282282} 
     
    548548static void * 
    549549mutt_hcache_dump(void *_db, HEADER * h, int *off, 
    550                  unsigned long long uid_validity) 
     550                 uint64_t uid_validity) 
    551551{ 
    552552  struct header_cache *db = _db; 
     
    557557 
    558558  if (uid_validity) 
    559     memcpy(d, &uid_validity, sizeof (long long)); 
     559    memcpy(d, &uid_validity, sizeof (uint64_t)); 
    560560  else 
    561561  { 
     
    694694int 
    695695mutt_hcache_store(void *db, const char *filename, HEADER * header, 
    696                   unsigned long long uid_validity, 
     696                  uint64_t uid_validity, 
    697697                  size_t(*keylen) (const char *fn)) 
    698698{ 
     
    884884int 
    885885mutt_hcache_store(void *db, const char *filename, HEADER * header, 
    886                   unsigned long long uid_validity, 
     886                  uint64_t uid_validity, 
    887887                  size_t(*keylen) (const char *fn)) 
    888888{ 
  • imap/imap_private.h

    r3810 r3869  
    181181  unsigned int noclose : 1; 
    182182#ifdef USE_HCACHE 
    183   unsigned long long uid_validity; 
     183  uint64_t uid_validity; 
    184184#endif 
    185185   
  • imap/message.c

    r3810 r3869  
    6666#if USE_HCACHE 
    6767  void *hc   = NULL; 
    68   unsigned long long *uid_validity = NULL; 
     68  uint64_t *uid_validity = NULL; 
    6969  char uid_buf[64]; 
    7070#endif /* USE_HCACHE */ 
     
    151151 
    152152      sprintf(uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */ 
    153       uid_validity = (unsigned long long *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen); 
     153      uid_validity = (uint64_t *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen); 
    154154 
    155155      if (uid_validity != NULL 
  • protos.h

    r3810 r3869  
    1818 
    1919 
     20#ifdef HAVE_CONFIG_H 
     21# include "config.h" 
     22#endif 
     23 
     24#ifdef HAVE_INTTYPES_H 
     25# include <inttypes.h> 
     26#endif 
     27 
    2028#include "mbyte.h" 
    2129 
     
    108116HEADER *mutt_hcache_restore(const unsigned char *d, HEADER **oh); 
    109117void *mutt_hcache_fetch(void *db, const char *filename, size_t (*keylen)(const char *fn)); 
    110 int mutt_hcache_store(void *db, const char *filename, HEADER *h, unsigned long long uid_validity, size_t (*keylen)(const char *fn)); 
     118int mutt_hcache_store(void *db, const char *filename, HEADER *h, uint64_t uid_validity, size_t (*keylen)(const char *fn)); 
    111119int mutt_hcache_delete(void *db, const char *filename, size_t (*keylen)(const char *fn)); 
    112120#endif /* USE_HCACHE */