dllbegin.inc 1.4 KB

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