|
1 | 1 | ///////////////////////////////////////////////////////////////////////
|
2 | 2 | // File: platform.h
|
3 | 3 | // Description: Place holder
|
4 |
| -// Author: |
5 |
| -// Created: |
6 | 4 | //
|
7 | 5 | // (C) Copyright 2006, Google Inc.
|
8 | 6 | // Licensed under the Apache License, Version 2.0 (the "License");
|
|
22 | 20 |
|
23 | 21 | #define DLLSYM
|
24 | 22 | #ifdef _WIN32
|
25 |
| -#ifndef NOMINMAX |
26 |
| -#define NOMINMAX |
27 |
| -#endif /* NOMINMAX */ |
28 |
| -#ifndef WIN32_LEAN_AND_MEAN |
29 |
| -#define WIN32_LEAN_AND_MEAN |
30 |
| -#endif |
31 |
| -#ifdef __GNUC__ |
32 |
| -#define ultoa _ultoa |
33 |
| -#endif /* __GNUC__ */ |
34 |
| -#define SIGNED |
35 |
| -#else |
36 |
| -#ifdef __cplusplus |
37 |
| -#include <climits> |
38 |
| -#else /* C compiler*/ |
39 |
| -#include <limits.h> |
40 |
| -#endif /* __cplusplus */ |
41 |
| -#ifndef PATH_MAX |
42 |
| -#define MAX_PATH 4096 |
| 23 | +# include <windows.h> // MAX_PATH |
| 24 | +# ifndef NOMINMAX |
| 25 | +# define NOMINMAX |
| 26 | +# endif /* NOMINMAX */ |
| 27 | +# ifndef WIN32_LEAN_AND_MEAN |
| 28 | +# define WIN32_LEAN_AND_MEAN |
| 29 | +# endif |
| 30 | +# ifdef __GNUC__ |
| 31 | +# define ultoa _ultoa |
| 32 | +# endif /* __GNUC__ */ |
| 33 | +# define SIGNED |
43 | 34 | #else
|
44 |
| -#define MAX_PATH PATH_MAX |
45 |
| -#endif |
46 |
| -#define SIGNED signed |
| 35 | +# ifdef __cplusplus |
| 36 | +# include <climits> |
| 37 | +# else /* C compiler*/ |
| 38 | +# include <limits.h> |
| 39 | +# endif /* __cplusplus */ |
| 40 | +# ifndef PATH_MAX |
| 41 | +# define MAX_PATH 4096 |
| 42 | +# else |
| 43 | +# define MAX_PATH PATH_MAX |
| 44 | +# endif |
| 45 | +# define SIGNED signed |
47 | 46 | #endif
|
48 | 47 |
|
49 | 48 | #if defined(_WIN32) || defined(__CYGWIN__)
|
50 |
| -#ifndef M_PI |
51 |
| -#define M_PI 3.14159265358979323846 |
52 |
| -#endif |
| 49 | +# ifndef M_PI |
| 50 | +# define M_PI 3.14159265358979323846 |
| 51 | +# endif |
53 | 52 | #endif
|
54 | 53 |
|
55 | 54 | #if defined(_WIN32) || defined(__CYGWIN__)
|
56 |
| - #if defined(TESS_EXPORTS) |
57 |
| - #define TESS_API __declspec(dllexport) |
58 |
| - #elif defined(TESS_IMPORTS) |
59 |
| - #define TESS_API __declspec(dllimport) |
60 |
| - #else |
61 |
| - #define TESS_API |
62 |
| - #endif |
63 |
| - #define TESS_LOCAL |
| 55 | +# if defined(TESS_EXPORTS) |
| 56 | +# define TESS_API __declspec(dllexport) |
| 57 | +# elif defined(TESS_IMPORTS) |
| 58 | +# define TESS_API __declspec(dllimport) |
| 59 | +# else |
| 60 | +# define TESS_API |
| 61 | +# endif |
| 62 | +# define TESS_LOCAL |
64 | 63 | #else
|
65 |
| - #if __GNUC__ >= 4 |
66 |
| - #if defined(TESS_EXPORTS) || defined(TESS_IMPORTS) |
67 |
| - #define TESS_API __attribute__ ((visibility ("default"))) |
68 |
| - #define TESS_LOCAL __attribute__ ((visibility ("hidden"))) |
69 |
| - #else |
70 |
| - #define TESS_API |
71 |
| - #define TESS_LOCAL |
72 |
| - #endif |
73 |
| - #else |
74 |
| - #define TESS_API |
75 |
| - #define TESS_LOCAL |
76 |
| - #endif |
| 64 | +# if __GNUC__ >= 4 |
| 65 | +# if defined(TESS_EXPORTS) || defined(TESS_IMPORTS) |
| 66 | +# define TESS_API __attribute__((visibility("default"))) |
| 67 | +# define TESS_LOCAL __attribute__((visibility("hidden"))) |
| 68 | +# else |
| 69 | +# define TESS_API |
| 70 | +# define TESS_LOCAL |
| 71 | +# endif |
| 72 | +# else |
| 73 | +# define TESS_API |
| 74 | +# define TESS_LOCAL |
| 75 | +# endif |
77 | 76 | #endif
|
78 | 77 |
|
79 | 78 | #endif // TESSERACT_CCUTIL_PLATFORM_H_
|
0 commit comments