From f8533bb42247761b6b28bdff208cf03289d2fc75 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 2 Jul 2017 21:03:29 +0000 Subject: snapshot of project "lynx", label v2-8-9dev_14e --- WWW/Library/Implementation/HTUtils.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'WWW/Library/Implementation/HTUtils.h') diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 744557ab..bd6391bb 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -1,5 +1,5 @@ /* - * $LynxId: HTUtils.h,v 1.122 2016/11/23 22:16:51 tom Exp $ + * $LynxId: HTUtils.h,v 1.124 2017/07/02 20:40:14 tom Exp $ * * Utility macros for the W3 code library * MACROS FOR GENERAL USE @@ -19,11 +19,11 @@ /* see AC_FUNC_ALLOCA macro */ #ifdef __GNUC__ -# define alloca __builtin_alloca +# define alloca(size) __builtin_alloca(size) #else # ifdef _MSC_VER # include -# define alloca _alloca +# define alloca(size) _alloca(size) # else # if HAVE_ALLOCA_H # include @@ -191,7 +191,11 @@ extern int ignore_unused; #undef small /* see */ #endif -#ifdef HAVE_ATOLL +#if defined(__DARWIN_NO_LONG_LONG) +#undef HAVE_ATOLL +#endif + +#if defined(HAVE_ATOLL) #define LYatoll(n) atoll(n) #else extern off_t LYatoll(const char *value); @@ -575,6 +579,8 @@ extern int WWW_TraceMask; #include #endif +#define DigitsOf(type) (int)((sizeof(type)*8)/3) + /* * Printing/scanning-formats for "off_t", as well as cast needed to fit. */ @@ -602,13 +608,18 @@ extern int WWW_TraceMask; #endif #ifndef PRI_off_t -#if defined(HAVE_LONG_LONG) && (SIZEOF_OFF_T > SIZEOF_LONG) +#define GUESS_PRI_off_t +#if (SIZEOF_OFF_T == SIZEOF_LONG) +#define PRI_off_t "ld" +#define SCN_off_t "ld" +#define CAST_off_t(n) (long)(n) +#elif defined(HAVE_LONG_LONG) #define PRI_off_t "lld" #define SCN_off_t "lld" #define CAST_off_t(n) (long long)(n) #else #define PRI_off_t "ld" -#define SCN_off_t "ld" +/* SCN_off_t requires workaround */ #define CAST_off_t(n) (long)(n) #endif #endif -- cgit 1.4.1-2-gfad0