File: compiler.h

package info (click to toggle)
qt4-x11 4:4.8.7+dfsg-18
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 749,772 kB
  • sloc: cpp: 2,694,360; ansic: 384,353; python: 25,859; sh: 19,554; xml: 17,092; perl: 14,767; yacc: 5,383; asm: 5,038; makefile: 1,258; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (263 lines) | stat: -rw-r--r-- 8,755 bytes parent folder | download | duplicates (9)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
* 
* Distributable under the terms of either the Apache License (Version 2.0) or 
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#if !defined(lucene_compiler_h)
#define lucene_compiler_h

#if defined(_MBCS) || defined(_ASCII)
#undef _ASCII
#undef _UCS2
#define _ASCII
#elif defined(_UNICODE)
#define _UCS2
#elif !defined(_UCS2)
#define _UCS2
#endif

//msvc needs unicode define so that it uses unicode library
#ifdef _UCS2
#undef _UNICODE
#define _UNICODE
#undef _ASCII
#else
#undef _UNICODE
#undef _UCS2
#endif


////////////////////////////////////////////////////////////////////
//  Figure out what compiler we are using
////////////////////////////////////////////////////////////////////

#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined (__COMO__) 
#define _CLCOMPILER_MSVC _MSC_VER
#endif

#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__)
#include "CLucene/config/CompilerGcc.h"

#elif defined(_CLCOMPILER_MSVC)
/* Microsoft Visual C++ */
#include "CLucene/config/CompilerMsvc.h"

#elif defined (__BORLANDC__)
#include "CLucene/config/CompilerBcb.h"

#elif defined (__HP_aCC)
#include "CLucene/config/CompilerAcc.h"

#else
    //Unable to identify the compiler, issue error diagnostic. 
    //Edit <CLucene/config/LuceneMycomp.h> to set STLport up for your compiler.
    //Uncomment this next line
#error "Unable to identify the compiler, issue error diagnostic. Edit <CLucene/config/CompilerMycomp.h> to set Lucene up for your compiler."
#include "CLucene/config/LuceneMycomp.h"
#endif /* end of compiler choice */
////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////
//   Now include platform specific definitions
////////////////////////////////////////////////////////////////////

/* Operating system recognition (basic) */
#if defined (__unix) || defined (__linux__) || defined (__QNX__) || defined (_AIX) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__Lynx__) || defined(hpux) || defined(__hpux)
#undef  _UNIX
#define _UNIX 1
#include "CLucene/config/PlatformUnix.h"

#elif defined(macintosh) || defined (_MAC) || defined(__APPLE__)
#undef _MAC
#define _MAC  1
#include "CLucene/config/PlatformMac.h"

#elif defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__)
#undef _WIN32
#define _WIN32
#include "CLucene/config/PlatformWin32.h"

#elif defined (__WIN16) || defined (WIN16) || defined (_WIN16)
#undef _WIN16
#define _WIN16
#error "CLucene has not been tested on this platform. Please send a report to the lucene administrators if you are able to successfully compile"
#else
#error "CLucene could not identify the platform."
#endif /* platforms */



////////////////////////////////////////////////////////////////////
//   Now we take all that we have learnt, and define some things
////////////////////////////////////////////////////////////////////

//lets just say that we can always do unicode! :)
#ifdef CL_CHARSET_GUESS
#define _UCS2
#endif

#if defined(_ASCII)
#undef _UCS2
#elif defined(_UCS2)
#undef _ASCII
#endif

#ifndef  _LUCENE_NO_NEW_STYLE_CASTS
#define __CONST_CAST(typ,var) const_cast<typ>(var)
#define __REINTERPRET_CAST(typ,var) reinterpret_cast<typ>(var)
#else
#define __CONST_CAST(typ,var) ((typ)(var))
#define __REINTERPRET_CAST,var) ((typ)(var))
#endif

#ifndef _CL_DEPRECATE_TEXT
#define _CL_DEPRECATE_TEXT(_Text)
#endif
#define _CL_DEPRECATED(_NewItem) _CL_DEPRECATE_TEXT("This function or variable has been superceded by newer library or operating system functionality. Consider using" #_NewItem "instead. See online help for details.")


//cnd-debug exit command
#ifndef debugFatalExit
#define debugFatalExit(ret) exit(ret)
#endif

#ifndef _CL_ILONG
#define _CL_ILONG(x)       x ## L
#endif
#ifndef _ILONGLONG
#define _ILONGLONG(x)   x ## LL
#endif

//define whats the values of item intergers *should* be. we can check this in a test
#define LUCENE_INT64_MAX_SHOULDBE _ILONGLONG(0x7FFFFFFFFFFFFFFF)
#define LUCENE_INT32_MAX_SHOULDBE 0x7FFFFFFFL
#define LUCENE_UINT8_MAX_SHOULDBE 0xff

#if defined(__GNU__)
 #define PATH_MAX 4096
#endif

//maximum path length. only used for buffers that use fullpath.
//anything else should use a dynamic length.
#if defined(CL_MAX_PATH)
//do nothing...
#elif defined(PATH_MAX)
#define CL_MAX_PATH PATH_MAX
#elif defined(MAX_PATH)
#define CL_MAX_PATH MAX_PATH
#elif defined(_MAX_PATH)
#define CL_MAX_PATH _MAX_PATH
#else
 #error "CL_MAX_PATH could not be determined"
#endif

//this is the max filename... for now its just the same,
//but this could change, so we use a different name
#define CL_MAX_NAME CL_MAX_PATH
//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb.
//the above logic for CL_MAX_NAME should be correct enough to handle all file names
#define CL_MAX_DIR CL_MAX_PATH

#ifdef _LARGE_FILES
#define LUCENE_MAX_FILELENGTH LUCENE_INT64_MAX_SHOULDBE
#else
#define LUCENE_MAX_FILELENGTH LUCENE_INT32_MAX_SHOULDBE
#endif

//use the LUCENE_STATIC_CONSTANT_SYNTAX to determine LUCENE_STATIC_CONSTANT
#ifndef LUCENE_STATIC_CONSTANT
	//autoconf is not properly detecting the correct method for this, and since there's no real big
	//harm in always using an enum, we'll probably just make this the default.
	/*#if LUCENE_STATIC_CONSTANT_SYNTAX == 1
		#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
	#elif LUCENE_STATIC_CONSTANT_SYNTAX == 2*/
		#define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
	/*#else
		#error "LUCENE_STATIC_CONSTANT not defined, and/or LUCENE_STATIC_CONSTANT_SYNTAX is not defined to a valid value"
	#endif*/
#endif

//end of lucene_compiler_h
#elif !defined(lucene_compiler_h2)
#define lucene_compiler_h2
//here we include the compiler header again, this gives the header a
//second chance at including stuff, after the main inclusions are complete

#if defined (__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi)  && defined(__EDG__)
#include "CLucene/config/CompilerGcc.h"
    
#elif defined(_CLCOMPILER_MSVC)
/* Microsoft Visual C++ */
#include "CLucene/config/CompilerMsvc.h"
        
#elif defined __BORLANDC__
#include "CLucene/config/CompilerBcb.h"

#elif defined (__HP_aCC)
#include "CLucene/config/CompilerAcc.h"
        
#else
//Unable to identify the compiler, issue error diagnostic. 
//Edit <CLucene/config/LuceneMycomp.h> to set STLport up for your compiler.
//Uncomment this next line
#error "Unable to identify the compiler, issue error diagnostic. Edit <CLucene/config/CompilerMycomp.h> to set Lucene up for your compiler."
#include "CLucene/config/LuceneMycomp.h"
#endif /* end of compiler choice */

#ifndef _CL_HAVE_FLOAT_T
//#ifdef _CL_HAVE_LONG_DOUBLE
// long double's are not working (reported by Mark Ashworth on Solaris 64)
//   typedef long double float_t;    /* `float' expressions are evaluated as `long double'.  */
//#else
//  we are going to use qreal now
//  typedef double float_t;
//#endif
#endif

/*todo: but need to define SIZEOF_VOID_P #if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8)
#ifndef _CL_HAVE_INTPTR_T
     typedef int64_t intptr_t;
#endif
#elif (SIZEOF_VOID_P > 2 && SIZEOF_VOID_P <= 4)
#    ifndef _CL_HAVE_INTPTR_T
        typedef int32_t intptr_t;
#    endif
#else
#error "void * is either >8 bytes or <= 2.  In either case, I am confused."
#endif*/

#ifndef _CL_HAVE_INTPTR_T
    typedef int intptr_t;
#endif
    
//end of lucene_compiler_h2
#elif !defined(lucene_compiler_h3)
#define lucene_compiler_h3
//here we include the compiler header again, this gives the header a
//third chance at including stuff, after the main inclusions are complete
 
#if defined (__GNUC__ ) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__)
#include "CLucene/config/CompilerGcc.h"
    
#elif defined(_CLCOMPILER_MSVC)
/* Microsoft Visual C++ */
#include "CLucene/config/CompilerMsvc.h"

#elif defined __BORLANDC__
#include "CLucene/config/CompilerBcb.h"
        
#elif defined (__HP_aCC)
#include "CLucene/config/CompilerAcc.h"

#else
//Unable to identify the compiler, issue error diagnostic. 
//Edit <CLucene/config/LuceneMycomp.h> to set STLport up for your compiler.
//Uncomment this next line
#error "Unable to identify the compiler, issue error diagnostic. Edit <CLucene/config/CompilerMycomp.h> to set Lucene up for your compiler."
#include "CLucene/config/LuceneMycomp.h"
#endif /* end of compiler choice */
   
#endif