platform.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ///////////////////////////////////////////////////////////////////////
  2. // File: platform.h
  3. // Description: Place holder
  4. //
  5. // (C) Copyright 2006, Google Inc.
  6. // Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. ///////////////////////////////////////////////////////////////////////
  17. #ifndef TESSERACT_CCUTIL_PLATFORM_H_
  18. #define TESSERACT_CCUTIL_PLATFORM_H_
  19. #define DLLSYM
  20. #ifndef _WIN32
  21. # ifdef __cplusplus
  22. # include <climits>
  23. # else /* C compiler*/
  24. # include <limits.h>
  25. # endif /* __cplusplus */
  26. # ifndef PATH_MAX
  27. # define MAX_PATH 4096
  28. # else
  29. # define MAX_PATH PATH_MAX
  30. # endif
  31. #endif
  32. #if defined(_WIN32) || defined(__CYGWIN__)
  33. # if defined(TESS_EXPORTS)
  34. # define TESS_API __declspec(dllexport)
  35. # elif defined(TESS_IMPORTS)
  36. # define TESS_API __declspec(dllimport)
  37. # else
  38. # define TESS_API
  39. # endif
  40. # define TESS_LOCAL
  41. #else
  42. # if __GNUC__ >= 4
  43. # if defined(TESS_EXPORTS) || defined(TESS_IMPORTS)
  44. # define TESS_API __attribute__((visibility("default")))
  45. # define TESS_LOCAL __attribute__((visibility("hidden")))
  46. # else
  47. # define TESS_API
  48. # define TESS_LOCAL
  49. # endif
  50. # else
  51. # define TESS_API
  52. # define TESS_LOCAL
  53. # endif
  54. #endif
  55. #endif // TESSERACT_CCUTIL_PLATFORM_H_