Skip to content

Commit 0e74118

Browse files
committed
Fixed windows build.
This commit fixes the build on windows, which apparently uses different default sizes. The fix is now relying on <stdint.h> for well-defined definitions of integers of various sizes
1 parent a1bd364 commit 0e74118

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ext/json/ext/vendor/jeaiii-ltoa.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ SOFTWARE.
5353
#ifndef JEAIII_TO_TEXT_H_
5454
#define JEAIII_TO_TEXT_H_
5555

56-
typedef unsigned int u32_t;
57-
typedef unsigned long u64_t;
56+
#include <stdint.h>
57+
58+
typedef uint_fast32_t u32_t;
59+
typedef uint_fast64_t u64_t;
5860

5961
#pragma clang diagnostic push
6062
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
@@ -104,9 +106,9 @@ static struct pair digits_fd[100] =
104106

105107
#undef NUL
106108

107-
static unsigned long mask24 = (u64(1) << 24) - 1;
108-
static unsigned long mask32 = (u64(1) << 32) - 1;
109-
static unsigned long mask57 = (u64(1) << 57) - 1;
109+
static u64_t mask24 = (u64(1) << 24) - 1;
110+
static u64_t mask32 = (u64(1) << 32) - 1;
111+
static u64_t mask57 = (u64(1) << 57) - 1;
110112

111113
static
112114
char* to_text_from_ulong(char* b, u64_t n) {

0 commit comments

Comments
 (0)