From 6075feb4875ed2035de460fcdc7858f314ad0bef Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 21 Jan 2017 14:20:55 +0000 Subject: create netsurf inttypes header to have portable integer formatting macros --- utils/http/primitives.c | 2 +- utils/idna.c | 2 ++ utils/utils.h | 25 +++---------------------- 3 files changed, 6 insertions(+), 23 deletions(-) (limited to 'utils') diff --git a/utils/http/primitives.c b/utils/http/primitives.c index f4c4e056e..1e24d2a0d 100644 --- a/utils/http/primitives.c +++ b/utils/http/primitives.c @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -#include #include #include #include +#include "netsurf/inttypes.h" #include "utils/http/primitives.h" /** diff --git a/utils/idna.c b/utils/idna.c index d75f957ed..34cc40f83 100644 --- a/utils/idna.c +++ b/utils/idna.c @@ -28,6 +28,8 @@ #include #include +#include "netsurf/inttypes.h" + #include "utils/errors.h" #include "utils/idna.h" #include "utils/idna_props.h" diff --git a/utils/utils.h b/utils/utils.h index 6f2ee4599..3995071cd 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -23,10 +23,9 @@ * \todo Many of these functions and macros should have their own headers. */ -#ifndef _NETSURF_UTILS_UTILS_H_ -#define _NETSURF_UTILS_UTILS_H_ +#ifndef NETSURF_UTILS_UTILS_H +#define NETSURF_UTILS_UTILS_H -#include #include #ifndef NOF_ELEMENTS @@ -52,29 +51,11 @@ #endif #endif -#ifndef PRIxPTR -#define PRIxPTR "x" -#endif - -#ifndef PRId64 -#define PRId64 "lld" -#endif - -/* Windows does not have sizet formating codes or POSIX mkdir so work - * around that - */ +/* Windows does not have POSIX mkdir so work around that */ #if defined(_WIN32) -/** windows printf formatting for size_t type */ -#define PRIsizet "Iu" -/** windows printf formatting for ssize_t type */ -#define PRIssizet "Id" /** windows mkdir function */ #define nsmkdir(dir, mode) mkdir((dir)) #else -/** c99 standard printf formatting for size_t type */ -#define PRIsizet "zu" -/** c99 standard printf formatting for ssize_t type */ -#define PRIssizet "zd" /** POSIX mkdir function */ #define nsmkdir(dir, mode) mkdir((dir), (mode)) #endif -- cgit v1.2.3