From: Pierre Habouzit Date: Thu, 17 May 2007 20:41:40 +0000 (+0200) Subject: CheckStructMember to check for dirent.d_ino X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=1ad0381f1e44f0717327f9f2146e6bdd654cba96;p=apps%2Fmadmutt.git CheckStructMember to check for dirent.d_ino Signed-off-by: Pierre Habouzit --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 25ded1b..1fb93bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,13 @@ IF(NOT HAVE_ICONV_H) MESSAGE(FATAL_ERROR "inconv.h not found") ENDIF(NOT HAVE_ICONV_H) +# }}} +# types {{{ + +INCLUDE(CheckStructMember) + +CHECK_STRUCT_MEMBER("struct dirent" "d_ino" "dirent.h" HAVE_DIRENT_D_INO) + # }}} # functions {{{ INCLUDE (CheckFunctionExists) diff --git a/cmake/CheckStructMember.cmake b/cmake/CheckStructMember.cmake new file mode 100644 index 0000000..8419e84 --- /dev/null +++ b/cmake/CheckStructMember.cmake @@ -0,0 +1,41 @@ +# - Check if the given struct or class has the specified member variable +# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE) +# +# STRUCT - the name of the struct or class you are interested in +# MEMBER - the member which existence you want to check +# HEADER - the header(s) where the prototype should be declared +# VARIABLE - variable to store the result +# +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +INCLUDE(CheckCSourceCompiles) + +MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT) + SET(_INCLUDE_FILES) + FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") + ENDFOREACH (it) + + SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE " +${_INCLUDE_FILES} +int main() +{ + ${_STRUCT} tmp; + tmp.${_MEMBER}; + return 0; +} +") + CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT}) + +ENDMACRO (CHECK_STRUCT_MEMBER) diff --git a/config.h.cmake b/config.h.cmake index 47b628a..3166c76 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,21 +1,11 @@ -#cmakedefine SENDMAIL "${SENDMAIL}/sendmail" -#cmakedefine MIXMASTER "${MIXMASTER}/mixmaster" +#cmakedefine MAILPATH "${MAILPATH}" +#cmakedefine SENDMAIL "${SENDMAIL}/sendmail" +#cmakedefine MIXMASTER "${MIXMASTER}/mixmaster" #ifndef MIXMASTER -#define MIXMASTER "mixmaster" +#define MIXMASTER "mixmaster" #endif -#cmakedefine MAILPATH "${MAILPATH}" - -#cmakedefine HAVE_LIBIDN 1 -#cmakedefine HAVE_QDBM 1 -#cmakedefine HAVE_GDBM 1 -#cmakedefine USE_FLOCK 1 -#cmakedefine USE_FCNTL 1 -#cmakedefine USE_HCACHE 1 -#cmakedefine USE_NNTP 1 -#cmakedefine USE_LIBESMTP 1 -#cmakedefine USE_SLANG_CURSES 1 - +/* headers */ #cmakedefine HAVE_ALLOCA_H 1 #cmakedefine HAVE_ARGZ_H 1 #cmakedefine HAVE_GETOPT_H 1 @@ -48,6 +38,10 @@ #cmakedefine HAVE_WCHAR_H 1 #cmakedefine HAVE_WCTYPE_H 1 +/* type */ +#cmakedefine HAVE_DIRENT_D_INO 1 + +/* functions */ #cmakedefine HAVE_GETSID 1 #cmakedefine HAVE_ISCTYPE 1 #cmakedefine HAVE_GETOPT 1 @@ -71,3 +65,15 @@ #cmakedefine HAVE_META 1 #cmakedefine HAVE_USE_DEFAULT_COLORS 1 #cmakedefine HAVE_RESIZETERM 1 + +/* libraries */ +#cmakedefine HAVE_LIBIDN 1 +#cmakedefine HAVE_QDBM 1 +#cmakedefine HAVE_GDBM 1 +#cmakedefine USE_FLOCK 1 +#cmakedefine USE_FCNTL 1 +#cmakedefine USE_HCACHE 1 +#cmakedefine USE_NNTP 1 +#cmakedefine USE_LIBESMTP 1 +#cmakedefine USE_SLANG_CURSES 1 + diff --git a/lib-mx/mh.c b/lib-mx/mh.c index 89ae790..f0a1484 100644 --- a/lib-mx/mh.c +++ b/lib-mx/mh.c @@ -656,7 +656,7 @@ static int maildir_parse_dir (CONTEXT * ctx, struct maildir ***last, /* FOO - really ignore the return value? */ maildir_parse_entry (ctx, last, subdir, de->d_name, count, is_old, -#if HAVE_DIRENT_D_INO +#ifdef HAVE_DIRENT_D_INO de->d_ino #else 0 diff --git a/nntp/nntp.c b/nntp/nntp.c index 69dcf0d..f5e7132 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -299,8 +299,9 @@ static int mutt_nntp_query (NNTP_DATA * data, char *line, size_t linelen) * -2 - invalid command or execution error, * -3 - error in funct(*line, *data). */ -static int mutt_nntp_fetch (NNTP_DATA * nntp_data, const char *query, char *msg, - progress_t* bar, int (*funct) (char *, void *), +static int mutt_nntp_fetch (NNTP_DATA * nntp_data, const char *query, + const char *msg, progress_t* bar, + int (*funct) (char *, void *), void *data, int tagged) { char buf[LONG_STRING];