summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-01-21 14:20:55 +0000
committerVincent Sanders <vince@kyllikki.org>2017-01-21 14:20:55 +0000
commit6075feb4875ed2035de460fcdc7858f314ad0bef (patch)
tree9ebc96049523deceef76a4170257ffac8b5b71eb /utils
parent11f11e0a7f8f7dd03d5b1fc22a8e54af305fbe6f (diff)
downloadnetsurf-6075feb4875ed2035de460fcdc7858f314ad0bef.tar.gz
netsurf-6075feb4875ed2035de460fcdc7858f314ad0bef.tar.bz2
create netsurf inttypes header to have portable integer formatting macros
Diffstat (limited to 'utils')
-rw-r--r--utils/http/primitives.c2
-rw-r--r--utils/idna.c2
-rw-r--r--utils/utils.h25
3 files changed, 6 insertions, 23 deletions
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 <http://www.gnu.org/licenses/>.
*/
-#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
+#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 <string.h>
#include <libutf8proc/utf8proc.h>
+#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 <inttypes.h>
#include <stdbool.h>
#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