Fix 64bit compilation issues. * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef `FT_Int64' here. * src/base/ftcalc.c: Remove typedef of `FT_Int64'. (FT_DivFix): Fix cast. * src/base/fttrigon.c: Remove typedef of `FT_Int64'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
diff --git a/ChangeLog b/ChangeLog
index 97bc8a1..06840be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2013-05-05 Werner Lemberg <wl@gnu.org>
+ Fix 64bit compilation issues.
+
+ * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef
+ `FT_Int64' here.
+
+ * src/base/ftcalc.c: Remove typedef of `FT_Int64'.
+ (FT_DivFix): Fix cast.
+ * src/base/fttrigon.c: Remove typedef of `FT_Int64'.
+
+2013-05-05 Werner Lemberg <wl@gnu.org>
+
[raster] Fix clang issues.
Fix suggested by <octoploid@yandex.com>.
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index 4502fd8..4aaddff 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -200,6 +200,18 @@ FT_BEGIN_HEADER
/* */
typedef unsigned XXX FT_UInt32;
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int64 */
+ /* */
+ /* A typedef for a 64bit signed integer type. The size depends on */
+ /* the configuration. Only defined if there is real 64bit support; */
+ /* otherwise, it gets emulated with a structure (if necessary). */
+ /* */
+ typedef signed XXX FT_Int64;
+
/* */
#endif
@@ -293,6 +305,10 @@ FT_BEGIN_HEADER
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
+#ifdef FT_LONG64
+ typedef FT_INT64 FT_Int64;
+#endif
+
#define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index cadbeca..bdedcc9 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -43,13 +43,9 @@
#undef FT_MulFix
#endif
-/* we need to define a 64-bits data type here */
+/* we need to emulate a 64-bit data type if a real one isn't available */
-#ifdef FT_LONG64
-
- typedef FT_INT64 FT_Int64;
-
-#else
+#ifndef FT_LONG64
typedef struct FT_Int64_
{
@@ -58,7 +54,7 @@
} FT_Int64;
-#endif /* FT_LONG64 */
+#endif /* !FT_LONG64 */
/*************************************************************************/
@@ -302,7 +298,7 @@
q = 0x7FFFFFFFL;
else
/* compute result directly */
- q = (FT_UInt32)( ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b );
+ q = (FT_UInt32)( ( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / b );
return ( s < 0 ? -(FT_Long)q : (FT_Long)q );
}
diff --git a/src/base/fttrigon.c b/src/base/fttrigon.c
index 09719ad..4ffdcb7 100644
--- a/src/base/fttrigon.c
+++ b/src/base/fttrigon.c
@@ -35,11 +35,6 @@
#include FT_TRIGONOMETRY_H
-#ifdef FT_LONG64
- typedef FT_INT64 FT_Int64;
-#endif
-
-
/* the Cordic shrink factor 0.858785336480436 * 2^32 */
#define FT_TRIG_SCALE 0xDBD95B16UL