Statistics
| Revision:

svn-gvsig-desktop / tags / v1_0_2_Build_904 / libraries / libjni-ecw / include / NCSDefs.h @ 43469

History | View | Annotate | Download (6.23 KB)

1 3538 nacho
/********************************************************
2
** Copyright 1999 Earth Resource Mapping Ltd.
3
** This document contains proprietary source code of
4
** Earth Resource Mapping Ltd, and can only be used under
5
** one of the three licenses as described in the
6
** license.txt file supplied with this distribution.
7
** See separate license.txt file for license details
8
** and conditions.
9
**
10
** This software is covered by US patent #6,442,298,
11
** #6,102,897 and #6,633,688.  Rights to use these patents
12
** is included in the license agreements.
13
**
14
** FILE:           NCSDefs.h
15
** CREATED:        Tue Mar 2 09:19:00 WST 1999
16
** AUTHOR:         Simon Cope
17
** PURPOSE:        General NCS defines
18
** EDITS:
19
** [01] sjc 30Apr00 Merged Mac SDK port
20
** [02]  ny 03Nov00 Merge WinCE/PALM SDK changes
21
** [03] tfl 14Jul04 Added radians/degrees conversion factors
22
 *******************************************************/
23
24
#ifndef NCSDEFS_H
25
#define NCSDEFS_H
26
27
#ifdef __cplusplus
28
extern "C" {
29
#endif
30
31
#ifndef NCSTYPES_H
32
#include "NCSTypes.h"
33
#endif
34
35
#include <float.h>
36
37
#ifdef LINUX
38
#ifndef NULL
39
#define NULL 0
40
#endif
41
#endif
42
43
#ifdef HPUX
44
// This should be defined as "inline", but the compiler doenst
45
// like our "static inline type function()" prototypes, probably
46
// have to change them all to static type inline function()"
47
// Use the next line when this is sorted.
48
//#define __inline inline
49
#define __inline
50
#endif
51
52
#if defined(MACINTOSH)||defined(SOLARIS)||defined(IRIX)||defined(PALM)||defined(HPUX)||defined(MACOSX)
53
#define NCSBO_MSBFIRST
54
#else        // WIN32, LINUX (i386)
55
#define NCSBO_LSBFIRST
56
#endif
57
58
#if !defined(_WIN32_WCE)&&!defined(UNALIGNED)
59
#define UNALIGNED
60
#endif        /* !_WIN32_WCE */
61
62
#ifdef PALM
63
// FIXME
64
#define NCS_PALM_CREATOR_ID 'NCS1'
65
#endif
66
67
#ifdef HPUX
68
// The system headers clash, so use their versions of MAX/MIN instead.
69
#include <sys/param.h>
70
71
#else
72
73
#ifndef MAX
74
#define MAX(a, b) ((a) > (b) ? (a) : (b))
75
#endif
76
#ifndef MIN
77
#define MIN(a, b) ((a) > (b) ? (b) : (a))
78
#endif
79
80
#endif
81
82
#ifndef TRUE
83
#define TRUE 1
84
#endif
85
#ifndef FALSE
86
#define FALSE 0
87
#endif
88
89
#ifdef WIN32
90
91
#ifndef MAXDOUBLE
92
#define MAXDOUBLE   DBL_MAX                        //1.7976931348623158e+308
93
#define NCS_FQNAN        _FPCLASS_QNAN        //0x0002
94
#define NCS_NAN                _FPCLASS_SNAN
95
#endif        /* !MAXDOUBLE */
96
97
#if defined(_WIN32_WCE)
98
#define NCS_NO_UNALIGNED_ACCESS
99
#endif // _WIN32_WCE
100
101
#elif defined PALM
102
103
#define NCS_FQNAN        0x0002
104
105
#elif defined MACINTOSH
106
107
#define NCS_FQNAN        0x0002
108
#define NCS_NAN                NAN
109
#ifndef MAXDOUBLE
110
#define MAXDOUBLE   DBL_MAX
111
#endif
112
113
#elif defined MACOSX
114
//#include <values.h>
115
#include <limits.h>
116
#include <ctype.h>
117
118
#define NCS_FQNAN        0x0002
119
#define NCS_NAN                NAN
120
#ifndef MAXDOUBLE
121
#define MAXDOUBLE   DBL_MAX
122
#endif
123
124
//FIXME: These should probably be moved somewhere else
125
#define HDC                        CGrafPtr
126
#define LPRECT                Rect *
127
#define RECT                Rect
128
#define HBITMAP                PixMapHandle
129
#define COLORREF        DWORD
130
#define HRGN                RgnHandle
131
#define UINT                UINT32
132
#define HWND                DWORD
133
#define STDMETHOD(x)        virtual INT32 x
134
#define LRESULT        INT32
135
#define HRESULT        long
136
#define WPARAM        UINT32
137
#define LPARAM         INT32
138
#define VARIANT        void *
139
#define HPEN                DWORD
140
#define HBRUSH        DWORD
141
#define BSTR                short *
142
#define BOOL                BOOLEAN
143
#define LPSTR        char *
144
#define HCURSOR        CursHandle
145
#define WORD                UINT16
146
#define STDMETHODIMP        INT32
147
//#define boolean        BOOLEAN
148
#define LOWORD(x)                ((UINT16)((long)(x) & 0xffff))
149
#define HIWORD(x)                ((UINT16)((long)(x) >> 16))
150
#define S_OK     ((LRESULT)0x00000000L)
151
#define S_FALSE  ((LRESULT)0x00000001L)
152
#define SUCCEEDED(Status)         ((Status) >= 0)
153
#define FAILED(Status)                 ((Status)<0)
154
#define MB_OK
155
#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
156
#define GetRValue(rgb)      ((BYTE)(rgb))
157
#define GetGValue(rgb)      ((BYTE)(((WORD)(rgb)) >> 8))
158
#define GetBValue(rgb)      ((BYTE)((rgb)>>16))
159
#define USES_CONVERSION
160
#define MK_LBUTTON        0x0001
161
#define MK_RBUTTON        0x0002
162
#define MK_SHIFT                0x0004
163
#define MK_CONTROL        0x0008
164
#define MK_MBUTTON        0x0010
165
#define VK_SHIFT                0x10
166
#define SetCursor(X) 0; if( X ) SetCursor(*X)
167
#define SetCapture(X)
168
#define ReleaseCapture(X)
169
#define IntersectRect(A, B, C) SectRect(B, C, A)
170
#define         ZeroMemory(DATA, SIZE) memset(DATA, 0, SIZE)
171
172
#elif defined SOLARIS || defined LINUX || defined HPUX
173
174
#ifdef LINUX
175
#define wcsicmp wcscasecmp
176
#endif
177
178
#include <values.h>
179
#include <limits.h>
180
#include <ctype.h>
181
182
// Solaris can't access types on unaligned addressed
183
#define NCS_NO_UNALIGNED_ACCESS
184
185
#if defined(SOLARIS) || defined(HPUX)
186
// SPARC has slow BYTE bit ops
187
#define NCS_SLOW_CPU_BYTE_OPS
188
#endif
189
190
#else
191
192
#error DEFINE SYSTEM INCLUDES FOR TYPES
193
194
#endif        /* WIN32 */
195
196
typedef enum {
197
        NCSCS_RAW        = 0,
198
        NCSCS_UTM        = 1,
199
        NCSCS_LL        = 2
200
} NCSCoordSys;
201
202
/*Coodinate system defines*/
203
#define NCS_LINEAR_COORD_SYS        "linear"
204
#define        NCS_FEET_FACTOR                        0.30480061
205
/*[03]*/
206
#define NCS_RADIANS_TO_DEGREES        57.29577951L
207
#define NCS_DEGREES_TO_RADIANS        1.745329252E-2L
208
209
#if defined(WIN32)
210
#if defined(_LIB)||defined(NCSECW_STATIC_LIBS)
211
#define NCS_EXPORT
212
#define NCS_IMPORT
213
#else
214
#define NCS_EXPORT __declspec(dllexport)
215
#define NCS_IMPORT __declspec(dllimport)
216
#endif
217
#ifdef _WIN32_WCE
218
#define NCS_CALL
219
#else
220
#define NCS_CALL __cdecl
221
#endif
222
#define NCS_CB_CALL __cdecl
223
#else
224
#define NCS_EXPORT
225
#define NCS_IMPORT
226
#define NCS_CALL
227
#define NCS_CB_CALL
228
#endif
229
230
#ifndef MAX_PATH
231
#ifdef MACINTOSH
232
233
        //        Note: Verify that this is OK for all MAC/OS Platform
234
#define MAX_PATH        256
235
236
#elif defined PALM
237
238
#define MAX_PATH         1024
239
240
#elif defined SOLARIS || defined LINUX || defined HPUX
241
242
#define MAX_PATH        PATH_MAX
243
244
#elif defined MACOSX
245
246
#define MAX_PATH 1024
247
248
#else        /* PALM */
249
250
#define MAX_PATH        PATHNAMELEN
251
252
#endif
253
#endif        /* !MAX_PATH */
254
255
#define NCSIsNullString(s) ((s) == (char *)0 || (*(s)) == '\0')
256
257
#if        __ICL >= 700
258
#ifdef NCS_VECTOR_CC
259
//Note: need /QaxMiKW /Qvec_report3 /Qrestrict ICC flags to use vectorisation
260
#define NCS_RESTRICT restrict
261
#else
262
#define NCS_RESTRICT
263
#endif
264
#else
265
#define NCS_RESTRICT
266
#endif
267
268
#ifdef _OPENMP
269
#define NCS_OPENMP
270
#endif // _OPENMP
271
272
#ifdef NCS_OPENMP
273
#define NCS_VECTOR_CC
274
#endif // NCS_OPENMP
275
276
#ifndef NCS_INLINE
277
#ifdef WIN32
278
#define NCS_INLINE __forceinline
279
#elif defined __GNUC__
280
#define NCS_INLINE __inline__
281
#else
282
#define NCS_INLINE __inline
283
#endif // WIN32
284
#endif // NCS_INLINE
285
286
#ifndef NCS_FASTCALL
287
#ifdef WIN32
288
#define NCS_FASTCALL __fastcall
289
#else // WIN32
290
#define NCS_FASTCALL
291
#endif // WIN32
292
#endif // NCS_FASTCALL
293
294
#ifdef __cplusplus
295
}
296
#endif
297
298
#endif /* NCSDEFS_H */