wmail: use stdbool.h if available.

This commit is contained in:
Jeremy Sowden 2019-06-12 21:37:15 +01:00 committed by Carlos R. Mafra
parent 24ce08f47c
commit dff64f3b71
3 changed files with 16 additions and 6 deletions

View file

@ -14,6 +14,7 @@ PKG_CHECK_MODULES([dockapp], [dockapp])
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h strings.h sys/time.h])
CPPFLAGS_old="$CPPFLAGS"

View file

@ -59,11 +59,20 @@
///////////////////////////////////////////////////////////////////////////////
// typedefs
#if !defined(__cplusplus) && !defined(c_plusplus)
typedef enum {
false = 0,
true = 1
} bool;
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# ifndef HAVE__BOOL
# ifdef __cplusplus
typedef bool _Bool;
# else
# define _Bool signed char
# endif
# endif
# define bool _Bool
# define false 0
# define true 1
# define __bool_true_false_are_defined 1
#endif

View file

@ -497,7 +497,7 @@ static bool ReadEnum( const char *from, unsigned int line, int *to,
static bool IsWhiteSpace( const char *chr )
{
return ( chr != NULL && ( *chr == ' ' || *chr == '\t' || *chr == '\n' )) ? true : false;
return chr != NULL && ( *chr == ' ' || *chr == '\t' || *chr == '\n' );
}
static const char *SkipWhiteSpaces( const char *str )