summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/raster/ftmisc.h
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit38be0d13830efd2d98281c645c3a60afe05ffece (patch)
tree6ea73f3ec77f7d153333779883e8120f82820abe /src/3rdparty/freetype/src/raster/ftmisc.h
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'src/3rdparty/freetype/src/raster/ftmisc.h')
-rw-r--r--src/3rdparty/freetype/src/raster/ftmisc.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/3rdparty/freetype/src/raster/ftmisc.h b/src/3rdparty/freetype/src/raster/ftmisc.h
new file mode 100644
index 0000000000..d9d73e3373
--- /dev/null
+++ b/src/3rdparty/freetype/src/raster/ftmisc.h
@@ -0,0 +1,84 @@
+/***************************************************************************/
+/* */
+/* ftmisc.h */
+/* */
+/* Miscellaneous macros for stand-alone rasterizer (specification */
+/* only). */
+/* */
+/* Copyright 2005, 2009 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used */
+/* modified and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+ /***************************************************/
+ /* */
+ /* This file is *not* portable! You have to adapt */
+ /* its definitions to your platform. */
+ /* */
+ /***************************************************/
+
+#ifndef __FTMISC_H__
+#define __FTMISC_H__
+
+ /* memset */
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+#define FT_BEGIN_HEADER
+#define FT_END_HEADER
+
+#define FT_LOCAL_DEF( x ) static x
+
+ /* from include/freetype2/fttypes.h */
+
+ typedef unsigned char FT_Byte;
+ typedef signed int FT_Int;
+ typedef unsigned int FT_UInt;
+ typedef signed long FT_Long;
+ typedef unsigned long FT_ULong;
+ typedef signed long FT_F26Dot6;
+ typedef int FT_Error;
+
+#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
+ ( ( (FT_ULong)_x1 << 24 ) | \
+ ( (FT_ULong)_x2 << 16 ) | \
+ ( (FT_ULong)_x3 << 8 ) | \
+ (FT_ULong)_x4 )
+
+
+ /* from src/ftcalc.c */
+
+#include <inttypes.h>
+
+ typedef int64_t FT_Int64;
+
+ static FT_Long
+ FT_MulDiv( 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 >> 1 ) ) / c
+ : 0x7FFFFFFFL );
+
+ return ( s > 0 ) ? d : -d;
+ }
+
+#endif /* __FTMISC_H__ */
+
+
+/* END */