ots-visibility.patch (1960B)
1 diff --git a/include/opentype-sanitiser.h b/include/opentype-sanitiser.h 2 --- a/include/opentype-sanitiser.h 3 +++ b/include/opentype-sanitiser.h 4 @@ -1,15 +1,35 @@ 5 // Copyright (c) 2009-2017 The OTS Authors. All rights reserved. 6 // Use of this source code is governed by a BSD-style license that can be 7 // found in the LICENSE file. 8 9 #ifndef OPENTYPE_SANITISER_H_ 10 #define OPENTYPE_SANITISER_H_ 11 12 +#if defined(_WIN32) || defined(__CYGWIN__) 13 + #define OTS_DLL_IMPORT __declspec(dllimport) 14 + #define OTS_DLL_EXPORT __declspec(dllexport) 15 +#else 16 + #if __GNUC__ >= 4 17 + #define OTS_DLL_IMPORT __attribute__((visibility ("default"))) 18 + #define OTS_DLL_EXPORT __attribute__((visibility ("default"))) 19 + #endif 20 +#endif 21 + 22 +#ifdef OTS_DLL 23 + #ifdef OTS_DLL_EXPORTS 24 + #define OTS_API OTS_DLL_EXPORT 25 + #else 26 + #define OTS_API OTS_DLL_IMPORT 27 + #endif 28 +#else 29 + #define OTS_API 30 +#endif 31 + 32 #if defined(_WIN32) 33 #include <stdlib.h> 34 typedef signed char int8_t; 35 typedef unsigned char uint8_t; 36 typedef short int16_t; 37 typedef unsigned short uint16_t; 38 typedef int int32_t; 39 typedef unsigned int uint32_t; 40 @@ -172,17 +192,17 @@ class OTSStream { 41 TABLE_ACTION_DEFAULT, // Use OTS's default action for that table 42 TABLE_ACTION_SANITIZE, // Sanitize the table, potentially dropping it 43 TABLE_ACTION_PASSTHRU, // Serialize the table unchanged 44 TABLE_ACTION_DROP, // Drop the table 45 TABLE_ACTION_SANITIZE_SOFT, // Sanitize the table, but without failing overall 46 // sanitzation even if this table fails/is dropped 47 }; 48 49 -class OTSContext { 50 +class OTS_API OTSContext { 51 public: 52 OTSContext() {} 53 virtual ~OTSContext() {} 54 55 // Process a given OpenType file and write out a sanitized version 56 // output: a pointer to an object implementing the OTSStream interface. The 57 // sanitisied output will be written to this. In the even of a failure, 58 // partial output may have been written.