ReactOS 0.4.15-dev-7681-g776c3a3
ftmisc.h
Go to the documentation of this file.
1/***************************************************************************/
2/* */
3/* ftmisc.h */
4/* */
5/* Miscellaneous macros for stand-alone rasterizer (specification */
6/* only). */
7/* */
8/* Copyright 2005-2018 by */
9/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10/* */
11/* This file is part of the FreeType project, and may only be used */
12/* modified and distributed under the terms of the FreeType project */
13/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14/* this file you indicate that you have read the license and */
15/* understand and accept it fully. */
16/* */
17/***************************************************************************/
18
19
20 /***************************************************/
21 /* */
22 /* This file is *not* portable! You have to adapt */
23 /* its definitions to your platform. */
24 /* */
25 /***************************************************/
26
27#ifndef FTMISC_H_
28#define FTMISC_H_
29
30
31 /* memset */
32#include FT_CONFIG_STANDARD_LIBRARY_H
33
34#define FT_BEGIN_HEADER
35#define FT_END_HEADER
36
37#define FT_LOCAL_DEF( x ) static x
38
39
40 /* from include/freetype/fttypes.h */
41
42 typedef unsigned char FT_Byte;
43 typedef signed int FT_Int;
44 typedef unsigned int FT_UInt;
45 typedef signed long FT_Long;
46 typedef unsigned long FT_ULong;
47 typedef signed long FT_F26Dot6;
48 typedef int FT_Error;
49
50#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
51 ( ( (FT_ULong)_x1 << 24 ) | \
52 ( (FT_ULong)_x2 << 16 ) | \
53 ( (FT_ULong)_x3 << 8 ) | \
54 (FT_ULong)_x4 )
55
56
57 /* from include/freetype/ftsystem.h */
58
59 typedef struct FT_MemoryRec_* FT_Memory;
60
61 typedef void* (*FT_Alloc_Func)( FT_Memory memory,
62 long size );
63
65 void* block );
66
67 typedef void* (*FT_Realloc_Func)( FT_Memory memory,
68 long cur_size,
69 long new_size,
70 void* block );
71
72 typedef struct FT_MemoryRec_
73 {
74 void* user;
75
79
81
82
83 /* from src/ftcalc.c */
84
85#if ( defined _WIN32 || defined _WIN64 )
86
87 typedef __int64 FT_Int64;
88
89#else
90
91#include "inttypes.h"
92
94
95#endif
96
97
98 static FT_Long
100 FT_Long b,
101 FT_Long c )
102 {
103 FT_Int s;
104 FT_Long d;
105
106
107 s = 1;
108 if ( a < 0 ) { a = -a; s = -1; }
109 if ( b < 0 ) { b = -b; s = -s; }
110 if ( c < 0 ) { c = -c; s = -s; }
111
112 d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
113 : 0x7FFFFFFFL );
114
115 return ( s > 0 ) ? d : -d;
116 }
117
118
119 static FT_Long
121 FT_Long b,
122 FT_Long c )
123 {
124 FT_Int s;
125 FT_Long d;
126
127
128 s = 1;
129 if ( a < 0 ) { a = -a; s = -1; }
130 if ( b < 0 ) { b = -b; s = -s; }
131 if ( c < 0 ) { c = -c; s = -s; }
132
133 d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
134 : 0x7FFFFFFFL );
135
136 return ( s > 0 ) ? d : -d;
137 }
138
139#endif /* FTMISC_H_ */
140
141
142/* END */
#define __int64
Definition: basetyps.h:16
INT64 int64_t
Definition: types.h:72
void *(* FT_Alloc_Func)(FT_Memory memory, long size)
Definition: ftmisc.h:61
struct FT_MemoryRec_ * FT_Memory
Definition: ftmisc.h:59
int64_t FT_Int64
Definition: ftmisc.h:93
struct FT_MemoryRec_ FT_MemoryRec
signed long FT_F26Dot6
Definition: ftmisc.h:47
unsigned long FT_ULong
Definition: ftmisc.h:46
unsigned char FT_Byte
Definition: ftmisc.h:42
static FT_Long FT_MulDiv_No_Round(FT_Long a, FT_Long b, FT_Long c)
Definition: ftmisc.h:120
int FT_Error
Definition: ftmisc.h:48
void *(* FT_Realloc_Func)(FT_Memory memory, long cur_size, long new_size, void *block)
Definition: ftmisc.h:67
signed long FT_Long
Definition: ftmisc.h:45
static FT_Long FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftmisc.h:99
void(* FT_Free_Func)(FT_Memory memory, void *block)
Definition: ftmisc.h:64
unsigned int FT_UInt
Definition: ftmisc.h:44
signed int FT_Int
Definition: ftmisc.h:43
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
signed long FT_Long
Definition: fttypes.h:242
signed int FT_Int
Definition: fttypes.h:220
GLdouble s
Definition: gl.h:2039
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define d
Definition: ke_i.h:81
#define a
Definition: ke_i.h:78
#define c
Definition: ke_i.h:80
#define b
Definition: ke_i.h:79
static char memory[1024 *256]
Definition: process.c:116
FT_Alloc_Func alloc
Definition: ftsystem.h:174
FT_Realloc_Func realloc
Definition: ftsystem.h:176
FT_Free_Func free
Definition: ftsystem.h:175
void * user
Definition: ftsystem.h:173
static unsigned int block
Definition: xmlmemory.c:101