ots-visibility.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h
  2. --- a/gfx/ots/include/opentype-sanitiser.h
  3. +++ b/gfx/ots/include/opentype-sanitiser.h
  4. @@ -4,8 +4,28 @@
  5. #ifndef OPENTYPE_SANITISER_H_
  6. #define OPENTYPE_SANITISER_H_
  7. +#if defined(_WIN32) || defined(__CYGWIN__)
  8. + #define OTS_DLL_IMPORT __declspec(dllimport)
  9. + #define OTS_DLL_EXPORT __declspec(dllexport)
  10. +#else
  11. + #if __GNUC__ >= 4
  12. + #define OTS_DLL_IMPORT __attribute__((visibility ("default")))
  13. + #define OTS_DLL_EXPORT __attribute__((visibility ("default")))
  14. + #endif
  15. +#endif
  16. +
  17. +#ifdef OTS_DLL
  18. + #ifdef OTS_DLL_EXPORTS
  19. + #define OTS_API OTS_DLL_EXPORT
  20. + #else
  21. + #define OTS_API OTS_DLL_IMPORT
  22. + #endif
  23. +#else
  24. + #define OTS_API
  25. +#endif
  26. +
  27. #if defined(_WIN32)
  28. #include <stdlib.h>
  29. typedef signed char int8_t;
  30. typedef unsigned char uint8_t;
  31. @@ -164,9 +184,9 @@ enum TableAction {
  32. TABLE_ACTION_PASSTHRU, // Serialize the table unchanged
  33. TABLE_ACTION_DROP // Drop the table
  34. };
  35. -class OTSContext {
  36. +class OTS_API OTSContext {
  37. public:
  38. OTSContext() {}
  39. virtual ~OTSContext() {}