Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
ffdac8d6
by Alexei Podtelezhnikov at 2021-08-19T20:41:55-04:00
2 changed files:
Changes:
... | ... | @@ -43,7 +43,8 @@ |
43 | 43 |
*
|
44 | 44 |
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
|
45 | 45 |
* `int` and `long` in bytes at compile-time. So far, this works for all
|
46 |
- * platforms the library has been tested on.
|
|
46 |
+ * platforms the library has been tested on. We also check `ULLONG_MAX`
|
|
47 |
+ * to see if we can use 64-bit `long long` later.
|
|
47 | 48 |
*
|
48 | 49 |
* Note that on the extremely rare platforms that do not provide integer
|
49 | 50 |
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
|
... | ... | @@ -66,6 +67,15 @@ |
66 | 67 |
#define FT_LONG_MIN LONG_MIN
|
67 | 68 |
#define FT_LONG_MAX LONG_MAX
|
68 | 69 |
#define FT_ULONG_MAX ULONG_MAX
|
70 |
+#ifdef LLONG_MAX
|
|
71 |
+#define FT_LLONG_MAX LLONG_MAX
|
|
72 |
+#endif
|
|
73 |
+#ifdef LLONG_MIN
|
|
74 |
+#define FT_LLONG_MIN LLONG_MIN
|
|
75 |
+#endif
|
|
76 |
+#ifdef ULLONG_MAX
|
|
77 |
+#define FT_ULLONG_MAX ULLONG_MAX
|
|
78 |
+#endif
|
|
69 | 79 |
|
70 | 80 |
|
71 | 81 |
/**************************************************************************
|
... | ... | @@ -60,6 +60,18 @@ |
60 | 60 |
|
61 | 61 |
#endif /* !defined(FT_SIZEOF_LONG) */
|
62 | 62 |
|
63 |
+#ifndef FT_SIZEOF_LONG_LONG
|
|
64 |
+ |
|
65 |
+ /* The size of a `long long` type if available*/
|
|
66 |
+#if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL
|
|
67 |
+#define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT )
|
|
68 |
+#else
|
|
69 |
+#define FT_SIZEOF_LONG_LONG 0
|
|
70 |
+#endif
|
|
71 |
+ |
|
72 |
+#endif /* !defined(FT_SIZEOF_LONG_LONG) */
|
|
73 |
+ |
|
74 |
+ |
|
63 | 75 |
/**************************************************************************
|
64 | 76 |
*
|
65 | 77 |
* @section:
|
... | ... | @@ -180,7 +192,7 @@ |
180 | 192 |
#define FT_INT64 long
|
181 | 193 |
#define FT_UINT64 unsigned long
|
182 | 194 |
|
183 |
-#elif defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
|
|
195 |
+#elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT )
|
|
184 | 196 |
|
185 | 197 |
#define FT_INT64 long long int
|
186 | 198 |
#define FT_UINT64 unsigned long long int
|