From 2700fd712b56f7320d2da09de46ba6ae699c1734 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 1 Mar 2020 16:30:33 +0200 Subject: [PATCH] builtin: add V64_PRINTFORMAT (part 1) --- vlib/compiler/cheaders.v | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vlib/compiler/cheaders.v b/vlib/compiler/cheaders.v index c9911698c0..1c72d28097 100644 --- a/vlib/compiler/cheaders.v +++ b/vlib/compiler/cheaders.v @@ -27,6 +27,19 @@ const ( #endif #define OPTION_CAST(x) (x) + +#ifndef V64_PRINTFORMAT +#ifdef PRIx64 +#define V64_PRINTFORMAT "0x%"PRIx64 +#elif defined(__WIN32__) +#define V64_PRINTFORMAT "0x%I64x" +#elif defined(__LINUX__) && defined(__LP64__) +#define V64_PRINTFORMAT "0x%lx" +#else +#define V64_PRINTFORMAT "0x%llx" +#endif +#endif + ' c_headers = '