michael@0: diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h michael@0: --- a/gfx/ots/include/opentype-sanitiser.h michael@0: +++ b/gfx/ots/include/opentype-sanitiser.h michael@0: @@ -1,15 +1,35 @@ michael@0: // Copyright (c) 2009 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef OPENTYPE_SANITISER_H_ michael@0: #define OPENTYPE_SANITISER_H_ michael@0: michael@0: +#if defined(_WIN32) || defined(__CYGWIN__) michael@0: + #define OTS_DLL_IMPORT __declspec(dllimport) michael@0: + #define OTS_DLL_EXPORT __declspec(dllexport) michael@0: +#else michael@0: + #if __GNUC__ >= 4 michael@0: + #define OTS_DLL_IMPORT __attribute__((visibility ("default"))) michael@0: + #define OTS_DLL_EXPORT __attribute__((visibility ("default"))) michael@0: + #endif michael@0: +#endif michael@0: + michael@0: +#ifdef OTS_DLL michael@0: + #ifdef OTS_DLL_EXPORTS michael@0: + #define OTS_API OTS_DLL_EXPORT michael@0: + #else michael@0: + #define OTS_API OTS_DLL_IMPORT michael@0: + #endif michael@0: +#else michael@0: + #define OTS_API michael@0: +#endif michael@0: + michael@0: #if defined(_WIN32) michael@0: #include michael@0: typedef signed char int8_t; michael@0: typedef unsigned char uint8_t; michael@0: typedef short int16_t; michael@0: typedef unsigned short uint16_t; michael@0: typedef int int32_t; michael@0: typedef unsigned int uint32_t; michael@0: @@ -182,45 +202,45 @@ class OTSStream { michael@0: // ----------------------------------------------------------------------------- michael@0: // Process a given OpenType file and write out a sanitised version michael@0: // output: a pointer to an object implementing the OTSStream interface. The michael@0: // sanitisied output will be written to this. In the even of a failure, michael@0: // partial output may have been written. michael@0: // input: the OpenType file michael@0: // length: the size, in bytes, of |input| michael@0: // ----------------------------------------------------------------------------- michael@0: -bool Process(OTSStream *output, const uint8_t *input, size_t length); michael@0: +bool OTS_API Process(OTSStream *output, const uint8_t *input, size_t length); michael@0: michael@0: // Signature of the function to be provided by the client in order to report errors. michael@0: // The return type is a boolean so that it can be used within an expression, michael@0: // but the actual value is ignored. (Suggested convention is to always return 'false'.) michael@0: #ifdef __GCC__ michael@0: #define MSGFUNC_FMT_ATTR __attribute__((format(printf, 2, 3))) michael@0: #else michael@0: #define MSGFUNC_FMT_ATTR michael@0: #endif michael@0: typedef bool (*MessageFunc)(void *user_data, const char *format, ...) MSGFUNC_FMT_ATTR; michael@0: michael@0: // Set a callback function that will be called when OTS is reporting an error. michael@0: -void SetMessageCallback(MessageFunc func, void *user_data); michael@0: +void OTS_API SetMessageCallback(MessageFunc func, void *user_data); michael@0: michael@0: enum TableAction { michael@0: TABLE_ACTION_DEFAULT, // Use OTS's default action for that table michael@0: TABLE_ACTION_SANITIZE, // Sanitize the table, potentially droping it michael@0: TABLE_ACTION_PASSTHRU, // Serialize the table unchanged michael@0: TABLE_ACTION_DROP // Drop the table michael@0: }; michael@0: michael@0: // Signature of the function to be provided by the client to decide what action michael@0: // to do for a given table. michael@0: typedef TableAction (*TableActionFunc)(uint32_t tag, void *user_data); michael@0: michael@0: // Set a callback function that will be called when OTS needs to decide what to michael@0: // do for a font table. michael@0: -void SetTableActionCallback(TableActionFunc func, void *user_data); michael@0: +void OTS_API SetTableActionCallback(TableActionFunc func, void *user_data); michael@0: michael@0: // Force to disable debug output even when the library is compiled with michael@0: // -DOTS_DEBUG. michael@0: void DisableDebugOutput(); michael@0: michael@0: // Enable WOFF2 support(experimental). michael@0: void EnableWOFF2(); michael@0: