dllbegin.inc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
  2. * vi:set ts=4 sts=4 sw=4 noet :
  3. *
  4. * Copyright 2010-2020 wkhtmltopdf authors
  5. *
  6. * This file is part of wkhtmltopdf.
  7. *
  8. * wkhtmltopdf is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * wkhtmltopdf is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with wkhtmltopdf. If not, see <http: *www.gnu.org/licenses/>.
  20. */
  21. #ifndef __WKHTMLTOPDF_DLLBEGIN__
  22. #define __WKHTMLTOPDF_DLLBEGIN__
  23. #if defined _WIN32 || defined __CYGWIN__
  24. #ifdef BUILDING_DLL
  25. #define DLL_PUBLIC __declspec(dllexport)
  26. #else
  27. #define DLL_PUBLIC __declspec(dllimport)
  28. #endif
  29. #define DLL_LOCAL
  30. #else
  31. #if __GNUC__ >= 4
  32. #define DLL_PUBLIC __attribute__ ((visibility("default")))
  33. #define DLL_LOCAL __attribute__ ((visibility("hidden")))
  34. #else
  35. #define DLL_PUBLIC
  36. #define DLL_LOCAL
  37. #endif
  38. #endif
  39. #if defined _WIN32
  40. #define CALLTYPE __stdcall
  41. #else
  42. #define CALLTYPE
  43. #endif
  44. #ifdef __cplusplus
  45. #define CAPI(type) extern "C" DLL_PUBLIC type CALLTYPE
  46. #else
  47. #define CAPI(type) DLL_PUBLIC type CALLTYPE
  48. #endif
  49. #endif /*__WKHTMLTOPDF_DLLBEGIN__*/