svn-gvsig-desktop / trunk / libraries / libjni-mrsid-macosx / include / support / lt_define.h @ 9099
History | View | Annotate | Download (3.62 KB)
1 |
/* $Id: lt_define.h 9099 2006-11-29 12:16:22Z mija $ */
|
---|---|
2 |
/* //////////////////////////////////////////////////////////////////////////
|
3 |
// //
|
4 |
// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
|
5 |
// Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
|
6 |
// prohibited. Access to and use of this code is permitted only under //
|
7 |
// license from LizardTech, Inc. Portions of the code are protected by //
|
8 |
// US and foreign patents and other filings. All Rights Reserved. //
|
9 |
// //
|
10 |
////////////////////////////////////////////////////////////////////////// */
|
11 |
/* PUBLIC */
|
12 |
|
13 |
/**
|
14 |
* @file
|
15 |
*
|
16 |
* Preprocessor definitions used throughout LizardTech sources. This file
|
17 |
* should not be included directly; use lt_base.h instead.
|
18 |
*
|
19 |
* @note This file is C-callable.
|
20 |
*/
|
21 |
|
22 |
#ifndef LT_DEFINE_H
|
23 |
#define LT_DEFINE_H
|
24 |
|
25 |
#include "lt_platform.h" |
26 |
|
27 |
#if defined(LT_COMPILER_MS)
|
28 |
#pragma warning(push,4) |
29 |
#endif
|
30 |
|
31 |
|
32 |
/**
|
33 |
* @name Language settings
|
34 |
*/
|
35 |
/*@{*/
|
36 |
|
37 |
#if defined(__cplusplus)
|
38 |
/** compiler supports C++ (as opposed to straight C) */
|
39 |
#define LT_CPLUSPLUS
|
40 |
#endif
|
41 |
|
42 |
/*}@*/
|
43 |
|
44 |
|
45 |
/**
|
46 |
* @name C++ namespace settings
|
47 |
*/
|
48 |
/*@{*/
|
49 |
|
50 |
#if defined(__cplusplus) && \
|
51 |
( defined(LT_COMPILER_MS) || \ |
52 |
defined(LT_COMPILER_GNU) || \ |
53 |
defined(LT_COMPILER_SUN) || \ |
54 |
defined(_USE_NAMESPACE_) ) |
55 |
/** compiler supports namespaces */
|
56 |
#define LT_NAMESPACE_SUPPORT
|
57 |
#else
|
58 |
/** compiler does not support namespaces */
|
59 |
#undef LT_NAMESPACE_SUPPORT
|
60 |
#endif
|
61 |
|
62 |
#ifdef LT_NAMESPACE_SUPPORT
|
63 |
/** declare start of namespace, for declarations */
|
64 |
#define LT_BEGIN_NAMESPACE( theNameSpace ) namespace theNameSpace {
|
65 |
/** declare end of namespace, for declarations */
|
66 |
#define LT_END_NAMESPACE( theNameSpace ) }
|
67 |
|
68 |
/** declare start of nameless namespace, for declarations */
|
69 |
#define LT_BEGIN_NAMELESS_NAMESPACE namespace {
|
70 |
/** declare end of nameless namespace, for declarations */
|
71 |
#define LT_END_NAMELESS_NAMESPACE }
|
72 |
|
73 |
/** declare use of namespace */
|
74 |
#define LT_USE_NAMESPACE( theNameSpace ) using namespace theNameSpace;
|
75 |
/** declare use of name */
|
76 |
#define LT_USE_NAME( theName ) using theName;
|
77 |
#else
|
78 |
#define LT_BEGIN_NAMESPACE( theNameSpace )
|
79 |
#define LT_END_NAMESPACE( theNameSpace )
|
80 |
|
81 |
#define LT_BEGIN_NAMELESS_NAMESPACE
|
82 |
#define LT_END_NAMELESS_NAMESPACE
|
83 |
|
84 |
#define LT_USE_NAMESPACE( theNameSpace )
|
85 |
#define LT_USE_NAME( theName )
|
86 |
#endif
|
87 |
|
88 |
/*@}*/
|
89 |
|
90 |
|
91 |
/**
|
92 |
* @name Debug settings
|
93 |
*/
|
94 |
/*@{*/
|
95 |
|
96 |
#if (defined(LT_OS_WIN) && defined(_DEBUG))
|
97 |
/** symbol for enabling debug code */
|
98 |
#define LT_DEBUG
|
99 |
#endif
|
100 |
|
101 |
/*@}*/
|
102 |
|
103 |
|
104 |
/**
|
105 |
* @name Miscellaneous macros
|
106 |
*/
|
107 |
/*@{*/
|
108 |
|
109 |
/** macro turns its argument into a quoted string */
|
110 |
#define LT_STRINGIFY(x) #x |
111 |
/** macro expands its argument, and it into a quoted string */
|
112 |
#define LT_XSTRINGIFY(x) LT_STRINGIFY(x)
|
113 |
|
114 |
/** return lesser of two parameters */
|
115 |
#define LT_MIN(A,B) ((A) < (B) ? (A) : (B))
|
116 |
/** return greater of two parameters */
|
117 |
#define LT_MAX(A,B) ((A) > (B) ? (A) : (B))
|
118 |
|
119 |
/*@}*/
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
/**
|
126 |
* @name Support for status string generation
|
127 |
*/
|
128 |
/*@{*/
|
129 |
|
130 |
#if defined(LT_STATUSSTRING_GENERATE)
|
131 |
#define LT_STATUSSTRING_ADD(NUM,STR) { NUM, STR },
|
132 |
#else
|
133 |
#define LT_STATUSSTRING_ADD(NUM,STR)
|
134 |
#endif
|
135 |
|
136 |
typedef struct { int code; const char* str; } LTStatusStringTable; |
137 |
/*@}*/
|
138 |
|
139 |
|
140 |
#if defined(LT_COMPILER_MS)
|
141 |
#pragma warning(pop)
|
142 |
#endif
|
143 |
|
144 |
|
145 |
/* globally disable spurious VC++ warning resulting from use of templates */
|
146 |
#ifdef LT_COMPILER_MS
|
147 |
#pragma warning(disable:4786) |
148 |
#endif
|
149 |
|
150 |
|
151 |
/* other includes to provide users of lt_define.h */
|
152 |
#include "lt_types.h" |
153 |
|
154 |
#endif /* LT_DEFINE_H */ |