diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-19 17:34:42 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-20 13:42:29 +0000 |
commit | 2eaf0cf8fd6e7c290497fedb08134a89e7b49b1d (patch) | |
tree | 0a4f7bf528e87d0b0a71ce7fccf702b87f4cdec1 /src/3rdparty/freetype/src/raster/ftmisc.h | |
parent | 77c518a50334d4dcf2476a4f39edc1e3990c7f0b (diff) |
Update bundled FreeType to 2.5.5
Removed everything, imported with help of import_from_tarball.sh script,
and then added a pre-generated builds/unix/ftconfig.h
Task-number: QTBUG-44648
Change-Id: Iea948e41f7761f1580382b3763d04c7a61383382
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/freetype/src/raster/ftmisc.h')
-rw-r--r-- | src/3rdparty/freetype/src/raster/ftmisc.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/3rdparty/freetype/src/raster/ftmisc.h b/src/3rdparty/freetype/src/raster/ftmisc.h index f04b5404bb..703155a429 100644 --- a/src/3rdparty/freetype/src/raster/ftmisc.h +++ b/src/3rdparty/freetype/src/raster/ftmisc.h @@ -5,7 +5,7 @@ /* Miscellaneous macros for stand-alone rasterizer (specification */ /* only). */ /* */ -/* Copyright 2005, 2009 by */ +/* Copyright 2005, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -27,6 +27,7 @@ #ifndef __FTMISC_H__ #define __FTMISC_H__ + /* memset */ #include FT_CONFIG_STANDARD_LIBRARY_H @@ -35,6 +36,7 @@ #define FT_LOCAL_DEF( x ) static x + /* from include/freetype2/fttypes.h */ typedef unsigned char FT_Byte; @@ -77,12 +79,22 @@ } FT_MemoryRec; + /* from src/ftcalc.c */ -#include <inttypes.h> +#if ( defined _WIN32 || defined _WIN64 ) + + typedef __int64 FT_Int64; + +#else + +#include "inttypes.h" typedef int64_t FT_Int64; +#endif + + static FT_Long FT_MulDiv( FT_Long a, FT_Long b, @@ -103,6 +115,27 @@ return ( s > 0 ) ? d : -d; } + + static FT_Long + FT_MulDiv_No_Round( FT_Long a, + FT_Long b, + FT_Long c ) + { + FT_Int s; + FT_Long d; + + + s = 1; + if ( a < 0 ) { a = -a; s = -1; } + if ( b < 0 ) { b = -b; s = -s; } + if ( c < 0 ) { c = -c; s = -s; } + + d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c + : 0x7FFFFFFFL ); + + return ( s > 0 ) ? d : -d; + } + #endif /* __FTMISC_H__ */ |