gfx/ots/ots-visibility.patch
author Sean Stangl <sean.stangl@gmail.com>
Tue, 14 May 2019 16:16:20 +0000
changeset 532647 bfa4ce8a0ef6b464e349f252b1f8e46cbf9bba11
parent 485827 fde2be8dca92ce77b2b6aefdcf5029ad99b52f18
permissions -rw-r--r--
Bug 1551339 - Update VIXL to recent Utils and Globals files. r=nbp This is preliminary work to allowing encoding of JSCVTFP, the instruction that exists on new AArch64 devices that greatly speeds up websites that use floating-point math. Differential Revision: https://phabricator.services.mozilla.com/D30997

diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h
--- a/gfx/ots/include/opentype-sanitiser.h
+++ b/gfx/ots/include/opentype-sanitiser.h
@@ -4,8 +4,28 @@
 
 #ifndef OPENTYPE_SANITISER_H_
 #define OPENTYPE_SANITISER_H_
 
+#if defined(_WIN32) || defined(__CYGWIN__)
+  #define OTS_DLL_IMPORT __declspec(dllimport)
+  #define OTS_DLL_EXPORT __declspec(dllexport)
+#else
+  #if __GNUC__ >= 4
+    #define OTS_DLL_IMPORT __attribute__((visibility ("default")))
+    #define OTS_DLL_EXPORT __attribute__((visibility ("default")))
+  #endif
+#endif
+
+#ifdef OTS_DLL
+  #ifdef OTS_DLL_EXPORTS
+    #define OTS_API OTS_DLL_EXPORT
+  #else
+    #define OTS_API OTS_DLL_IMPORT
+  #endif
+#else
+  #define OTS_API
+#endif
+
 #if defined(_WIN32)
 #include <stdlib.h>
 typedef signed char int8_t;
 typedef unsigned char uint8_t;
@@ -164,9 +184,9 @@ enum TableAction {
   TABLE_ACTION_PASSTHRU, // Serialize the table unchanged
   TABLE_ACTION_DROP      // Drop the table
 };
 
-class OTSContext {
+class OTS_API OTSContext {
   public:
     OTSContext() {}
     virtual ~OTSContext() {}