Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
platform.h
Go to the documentation of this file.
1 
2 // File: platform.h
3 // Description: Place holder
4 // Author:
5 // Created:
6 //
7 // (C) Copyright 2006, Google Inc.
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17 //
19 
20 #ifndef TESSERACT_CCUTIL_PLATFORM_H__
21 #define TESSERACT_CCUTIL_PLATFORM_H__
22 
23 #define DLLSYM
24 #ifdef _WIN32
25 #ifdef __GNUC__
26 #define ultoa _ultoa
27 typedef struct _BLOB {
28  unsigned int cbSize;
29  char *pBlobData;
30 } BLOB, *LPBLOB;
31 #endif /* __GNUC__ */
32 #define SIGNED
33 #define snprintf _snprintf
34 #if (_MSC_VER <= 1400)
35 #define vsnprintf _vsnprintf
36 #endif /* _WIN32 */
37 #else
38 #define __UNIX__
39 #include <limits.h>
40 #ifndef PATH_MAX
41 #define MAX_PATH 4096
42 #else
43 #define MAX_PATH PATH_MAX
44 #endif
45 #define SIGNED signed
46 #endif
47 
48 #if defined(_WIN32) || defined(__CYGWIN__)
49  #if defined(TESS_EXPORTS)
50  #define TESS_API __declspec(dllexport)
51  #elif defined(TESS_IMPORTS)
52  #define TESS_API __declspec(dllimport)
53  #else
54  #define TESS_API
55  #endif
56  #define TESS_LOCAL
57 #else
58  #if __GNUC__ >= 4
59  #if defined(TESS_EXPORTS) || defined(TESS_IMPORTS)
60  #define TESS_API __attribute__ ((visibility ("default")))
61  #define TESS_LOCAL __attribute__ ((visibility ("hidden")))
62  #else
63  #define TESS_API
64  #define TESS_LOCAL
65  #endif
66  #else
67  #define TESS_API
68  #define TESS_LOCAL
69  #endif
70 #endif
71 
72 #endif // TESSERACT_CCUTIL_PLATFORM_H__