File: GrMstypes.h

package info (click to toggle)
grcompiler 5.2.1-0.2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 23,968 kB
  • sloc: cpp: 48,199; ansic: 7,670; sh: 4,427; makefile: 197; xml: 190; perl: 127; sed: 21
file content (102 lines) | stat: -rw-r--r-- 2,185 bytes parent folder | download | duplicates (8)
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
#ifndef _MSTYPES_H
#define _MSTYPES_H
/********
This header contains the MS Win32 specific types that are still used 
throughout the Graphite code.

It is intended to allow Graphite to build on non-Win32 platforms.  
  
  **Do NOT include this when building against WIN32**
  
  TSE - 15/07/2003
********/

#if defined(_WIN32)
  #error Do not include this header when building against Win32 APIs
#else

#include <algorithm>

using std::min;
using std::max;

//#define __int64 		long long
#define SUCCEEDED(Status) 	((HRESULT)(Status) >= 0)
#define FAILED(Status) 		((HRESULT)(Status)<0)
#define IS_ERROR(Status) 	((unsigned long)(Status) >> 31 == SEVERITY_ERROR)
#define __RPC_FAR

#define ETO_GLYPH_INDEX 	0x0010	// from WinGDI.h

#if 0 // def __GNUC__
#define PACKED __attribute__((packed))
#ifndef _stdcall
#define _stdcall __attribute__((stdcall))
#endif
#ifndef __stdcall
#define __stdcall __attribute__((stdcall))
#endif
#ifndef _cdecl
#define _cdecl __attribute__((cdecl))
#endif
#ifndef __cdecl
#define __cdecl __attribute__((cdecl))
#endif
#ifndef __declspec
#define __declspec(e) __attribute__((e))
#endif
#ifndef _declspec
#define _declspec(e) __attribute__((e))
#endif
#else
#define PACKED
#define _cdecl
#define __cdecl
#endif

#define WINAPI __stdcall

#if defined(GR_NAMESPACE)
namespace gr
{
#endif

typedef wchar_t  OLECHAR;
typedef const OLECHAR	*LPCOLESTR;
typedef OLECHAR			*BSTR;

typedef unsigned short  WORD;
typedef unsigned int 	UINT;
typedef unsigned int 	DWORD;

typedef signed long	    HRESULT;
typedef DWORD 			COLORREF;
typedef unsigned short* LPWSTR;

inline long InterlockedIncrement(long *const intr_lck) {
	return ++*intr_lck;
}

inline long InterlockedDecrement(long *const intr_lck) {
	return --*intr_lck;
}

inline int MulDiv(const int v, const int n, const int d) {
		return int(n < 0 ? double(v * n)/double(d) - 0.5 : double(v * n)/double(d) + 0.5);
}


#if defined(GR_NAMESPACE)
}
#endif

#define S_OK		0
#define E_FAIL		0x80004005L
#define E_POINTER 	0x80004003L
#define E_OUTOFMEMORY	0x8007000EL
#define E_UNEXPECTED	0x80000003L
#define E_INVALIDARG	0x80000002L
#define E_NOTIMPL	0x80000004L

#endif // defined(_WIN32)
#endif // include guard